Introduction: DIY Arduino Multifunction Energy Meter V1.0
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.
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 )
Step 1: How It Works?
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.
Step 2: Breadboard Testing
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
Step 3: Prepare the Arduino Board
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.
Step 4: Prepare the Headers
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
Step 5: Solder the Female Headers
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.
Step 6: Mount the Temperature Sensor
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.
Step 7: Solder the Screw Terminals
Here screw terminals are used for external connection to the board. The external connections are
1. Source ( Battery / Solar Panel )
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.
Step 8: Make the Circuit
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
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.
Step 9: Mounting the Standoffs
After soldering and wiring, mount the standoffs at 4 corners. It will provide sufficient clearance to the soldering joints and wires from the ground.
Step 10: PCB Design
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.
Step 11: Power and Energy
Power: Power is the product of voltage (volt) and current (Amp)
Unit of power is Watt or KW
Energy: Energy is the product of power (watt) and time (Hour)
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.
Step 12: Software and Libraries
First, download the code attached below. Then download the following libraries and install them.
After install all the libraries, set the correct board and COM port, then upload the code.
Step 13: Final Testing
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
The parameters in the second column are
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.
Participated in the
Pocket-Sized Speed Challenge