This photo show the prototype of the light unit. Arduino Energy meter INA219
measure current and energy with 1000 Samples/second


I need a simple but powerful high speed energy meter!
In this project I use my breakout board to measure current, running time and energy.
A common INA219 current sensing board is used and the Arduino handles the communication.
The current is measured 1000 times/second and will be presented in mA and the energy in mAh.
Now I can measure energy consumption in my my li-ion battery projects.
I can also measure how much energy a solar cell produces during a day.
The display will show current, running time and energy.


Features:
  • Extreme high speed
  • Measure continuously
  • Current resolution is 1 mA
  • Energy resolution is 0.1mAh
  • Max voltage = 26V
  • Max Current = 3.2A (Can be increased!)
  • Based around Arduino
  • Board size = 100 mm x 84 mm
  • This project comes in a pre-made KIT, see more details below

  • All contribution to this page are most welcome!

    Background
    One reason I build this project is the need to measure energy consumed in Li-ion battery applications.
    I am working on a battery application using a SIM800L module. (SIM800 is a complete Quad-band GSM/GPRS)

    Click here to view a larger pic How much energy does the SIM800L need to work properly, and can I run it on solar cells?
    The SIM800 is communicating with high speed to its cellular base station. The current peaks can be as high as 2A according to datasheet.
    I needed to build a high speed energy meter, so I can measure how much energy the unit consume during operation.

    The pcb of this project is special, since I made it as a breakout board or general purpose board for experimenting purpose.
    I will use this board in many coming experiments
    I will talk more about the breakout bord in next section...

    Arduino Breakout bord
    Lets have a look at my general purpose pcb. This pcb was developed to be used in many of my experimental projects.
    If you wish to read details about the pcb and how it works,
    I advice you to visit my rf generator project. I explain in details all parts of the general purpose pcb.

    In this project I will only focus on the Arduino, Nokia display and the INA219 current board.
    I advice you to click on the blue pcb to the right, and enlarge it while I explain how it works.
    At the top right corner of the pcb is an Arduino Nano module. The only difference between Nano and Uno is physical size.
    Both circuits has the same Processor ATmega328 and clock speed of 16 MHz.

    In the top centre of the pcb you will find a Nokia 5110 LCD display. This display is my favourite.
    It has great contras in day light and when it is dark,
    the background LEDs giver perfect view. Another advantage with this display is that it is very simple to use. You can write both texts and make drawings.
    It is common labelled as Nokia 5110 but the real name is lph7366 (lph7366.pdf) and the driver circuit inside is pcd8544.pdf.
    Nokia 5110 was the phone using this display.


    Click here to view a larger schematic Hardware and schematic
    To the right, you can click on the schematic to enlarge it.
    Main power to the board can come from USB port of the Arduino or as RAW power to the pin list left side.
    The Arduino has a 5V power regulator which will feed the ATmega with +5V and the LEDs. The +5V will go to another power regulator of +3.3V placed on the board.
    The 3.3V will feed the display. Both the +3.3V and +5.0V can be found on test points of the board to be used on the experimental pad array.

    LCD display
    The LCD display has a SPI interface and it is connected to the Arduino at D9, D8, D6, D5, D4. The display work with 3.3V levels, so I have added divider resistors
    to each line. The resistor reduce the 5V levels from Arduino down to 3V lever which suits the LCD better. Behind the LCD is four white LEDs to give backlight.

    Buttons and LEDs
    The buttons and LEDs are not beeing used in this project!

    Arduino Nano
    As I said earlier, there is no difference between the Nano and Uno....but there is. Yes, both use the ATmega328p but the Nano has had problem with its boot.
    There has been some documented problem using the watchdog timer. Second, programming is slower than the Uno.

    So what I have done is to change the boot to latest Uno boot (Optiboot). This means that the unit behaves as an Arduino Uno. Great!
    From this on, it is a Uno and have all advantages an Uno has.


    Software
    The software was very difficult to write, because I had to handle current measurement and at the same time handle the update to the LCD display.
    Every millisecond a measurement must be executed. I have solved it by using timer interupts and my own code for i2c communication.
    The library of i2c use interrups and can not be used therefore. By the way, I do not like interrups....
    All together, the display updates the information 3-4 times per second which give a smooth and good reading. At the same time the Atmega328 measure the current 1000 time per seconds, exactly!


    Testing with SIM800L
    Below you will see a SIM800L GPRS module connected to a LI-ion 4.2V battery. In serial is the current measure module INA219 (purple pcb).



    During startup of the SIM800L it communicates with the base station. This takes about 20-30 seconds depending on rf conditions. On the SIM800L Module is a red LED which blinks to indicate status.
    When the unit is fully connected to a cellular base station, the LED blink every 3:d seconds.
    Since the IN219 measure the current 1000 times per seconds, I will get a pretty good integration of the consumed energy. This would not have been possible with a common slow energy meter.
    In the picture above you can see that the display show the time which has elapsed, 1 min and 31 seconds. The current is 13mA and the SIM800L has consumed 0.5 mAh from the battery.

    Great!

    This means that the SIM800L consumes about 0.5 mAh from the li-ion battery during startup. So my 1800 mAh li-ion battery will be able to start the unit 3600 times (theoretically).
    Or, if I want to start the SIM800L unit 1 time per day, I will need a solar cell that produces at least 0.5 mAh per day.


    KIT
    Order a KIT
    Kit include pre assembled board ready to use as energy meter.
    Unit will have perfect contrast and functionality!

    Order here



    Final word
    I hope you have enjoyed reading about this rf project.
    Hopefully you have found new inspiration for your own projects.



    Back to main Page  |  Contact Me  |  Cheap components

    Copyright © Last modified on 23 December 2020.