DIY Arduino Multifunction Energy Meter V1.0

by opengreenenergy in Circuits > Arduino

28595 Views, 183 Favorites, 0 Comments

DIY Arduino Multifunction Energy Meter V1.0

MFT V1.0.jpg
F7CSJGIKCKIR150.LARGE (1).jpg
Screenshot (222).png
DIY Arduino Multi-function Energy Meter
3d cover.png
BookBrushImage3D-eReader-front.png.png

In this Instructable, I will show you how to make an Arduino based Multifunction Energy Meter. This little Meter is a very useful device that displays important information on electrical parameters. The device can measure 6 useful electrical parameters: Voltage, Current, Power, Energy, Capacity, and Temperature. This device is suitable only for DC loads such as Solar PV systems. You can also use this meter for battery capacity measurement.

The Meter can measure up to voltage range from 0 - 26V and a maximum current of 3.2A.

My Book : DIY Off-Grid Solar Power for Everyone

You can order my Book on Off-Grid Solar Power from Amazon

  1. eBook
  2. Paperback - Black & White
  3. Paperback - Color Print


Support me On Patreon:

If you enjoy my work here on Instructables, consider joining my Patreon, it will be a great help for me to make more interesting projects in the future.

Patreon Link: https://www.patreon.com/opengreenenergy



Supplies

Components Used:

1. Arduino Pro Micro ( Amazon )

2. INA219 ( Amazon )

3. 0.96" OLED ( Amazon )

4. DS18B20 ( Amazon )

5. Lipo Battery ( Amazon )

6. Screw Terminals ( Amazon )

7. Female / Male Headers ( Amazon )

8. Perforated Board ( Amazon )

9. 24 AWG Wire ( Amazon )

10. Slide Switch ( Amazon )

Tools & Instruments Used:

1. Soldering Iron ( Amazon )

2. Wire Stripper ( Amazon )

3. Multimeter ( Amazon )

4. Electrical Tester ( Amazon )

How It Works?

Schematic_DIY Arduino Multi Function Power Meter V1.0_2020-07-13_22-00-31.png

The heart of the Energy Meter is an Arduino Pro Micro board. The Arduino senses the current and voltage by using the INA219 current sensor and temperature is sensed by temperature sensor DS18B20. According to this voltage and current, Arduino does the maths for calculating power and energy.


The Whole Schematic is divided into 4 groups


1. Arduino Pro Micro


The power required for Arduino Pro Micro is supplied from a LiPo/ Li-Ion Battery through a slide switch.


2. Current Sensor


The Current Sensor INA219 is connected to the Arduino board in I2C communication mode ( SDA and SCL pin).


3. OLED Display


Similar to the current Sensor, the OLED display is also connected to the Arduino board in the I2C communication mode. However, the address for both the device is different.


4. Temperature Sensor


Here I have used the DS18B20 temperature sensor. It uses a one-wire protocol to communicate with the Arduino.

Breadboard Testing

IMG_5241.jpg
IMG_5243.jpg

First, we will make the circuit on a Breadboard. The main advantage of a solderless breadboard is that it’s, solderless. Thus you can easily change the design just by unplugging components and leads as you need to.


After making the breadboard testing, I made the circuit on a Perforated Board

Prepare the Arduino Board

Screenshot (254).png
Screenshot (255).png
Screenshot (253).png

The Arduino Pro Micro comes without soldering the headers pin. So you have to solder the headers into the Arduino first.


Insert your male headers long-side-down into a breadboard. Now, with the headers installed, you can easily drop the Arduino board into place on top of the headers pin. Then solder all the pins to the Arduino Board.

Prepare the Headers

IMG_5257.jpg
IMG_5256.jpg

To mount the Arduino, OLED display, current sensor, and temperature sensor, you need some female straight headers pin. When you purchase the straight headers, they'll be too long for the components to be used. So, You'll need to trim them down to an appropriate length. I used a nipper to trim down it.


Following are the details about the headers :


1. Arduino Board - 2 x 12 pins


2. INA219 - 1 x 6 pins


3. OLED - 1 x 4 pins


4. Temp. Sensor - 1 x 3 pins

Solder the Female Headers

Screenshot (231).png
Screenshot (230).png
IMG_5275.jpg
IMG_5283.jpg
IMG_5287.jpg

After preparing the female headers pin, solder them to the perforated board. After soldering the header pins, check whether all the components fit perfectly or not.


Note: I will recommend solder the current sensor directly to the board instead of through the female header.


I have connected through the header pin for reusing the INA219 for other projects.

Mount the Temperature Sensor

Screenshot (234).png
Screenshot (235).png

Here I am using the DS18B20 temperature sensor in the TO-92 package. By considering the easy replacement, I have used a 3 pin female header. But you can directly solder the sensor to the perforated board.

Solder the Screw Terminals

Screenshot (261).png
Screenshot (262).png
Screenshot (263).png

Here screw terminals are used for external connection to the board. The external connections are


1. Source ( Battery / Solar Panel )


2. Load


3. Power supply to Arduino


The blue screw terminal is used for power supply to the Arduino and two green terminals are used for source and load connection.

Make the Circuit

Screenshot (232).png
Screenshot (233).png
Screenshot (236).png
Schematic_DIY Arduino Multi Function Power Meter V1.0_2020-07-13_22-00-31.png

After soldering the female headers and screw terminals, you have to join the pads as per the schematic diagram shown above.


The connections are pretty straight forward


INA219 / OLED -> Arduino


VCC -> VCC


GND - > GND


SDA -> D2


SCL-> D3


DS18B20 -> Arduino


GND - > GND


DQ -> D4 through a 4.7K pull-up resistor


VCC -> VCC


At last, connect the screw terminals as per the schematic.


I have used 24AWG colored wires to make the circuit. Solder the wire as per the circuit diagram.

Mounting the Standoffs

Screenshot (237).png
Screenshot (238).png

After soldering and wiring, mount the standoffs at 4 corners. It will provide sufficient clearance to the soldering joints and wires from the ground.

PCB Design

top.png
bottom.png

I have designed a custom PCB for this project. Due to the current pandemic COVID-19 situation, I am not able to place an order for this PCB. So I have not tested the PCB yet.


You can download the Gerber files from PCBWay


When you place an order from PCBWay, I will get a 10% donation from PCBWay for a contribution to my work. Your little help may encourage me to do more awesome work in the future. Thank you for your cooperation.

Power and Energy

F2J0SBKK84NHIC1.LARGE.jpg

Power: Power is the product of voltage (volt) and current (Amp)


P=VxI


Unit of power is Watt or KW


Energy: Energy is the product of power (watt) and time (Hour)


E= Pxt


Unit of Energy is Watt Hour or Kilowatt Hour (kWh)


Capacity: Capacity is product of Current (Amp) and time (Hour)


C = I x t


Unit of capacity is Amp-Hour


To monitor the power and energy above logic is implemented in software and the parameters are displayed in a 0.96-inch OLED display.


Image credit: imgoat

Software and Libraries

Screenshot (242).png
Screenshot (240).png
Screenshot (245).png
Screenshot (246).png

First, download the code attached below. Then download the following libraries and install them.


1. Adafruit INA219 Library


2. Adafruit SSD1306 Library


3. DallasTemperature


After install all the libraries, set the correct board and COM port, then upload the code.

Final Testing

Screenshot (226).png
Screenshot (225).png
Screenshot (227).png
Screenshot (222).png

To test the board, I have connected a 12V battery as a source and a 3W LED as a load.


The battery is connected to the screw terminal below the Arduino and LED is connected to the screw terminal below the INA219. The LiPo battery is connected to the blue screw terminal and then switch ON the circuit by using the slide switch.


You can see all the parameters are displaying on the OLED screen.


The parameters in the first column are


1. Voltage


2. Current


3. Power


The parameters in the second column are


1. Energy


2. Capacity


3. Temperature


To check the accuracy I used my multimeter and a Tester as shown above. The accuracy is close to them. I am really satisfied with this pocket-sized gadget.


Thanks for reading my Instructable.

If you like my project, don't forget to share it. Comments and feedback are always welcome.