Open Green Energy

Open Source DIY Projects on Green energy

DIY Arduino Multifunction Energy Meter

Make an Arduino Multifunction Energy Meter

 

In this post, I will show you how to make an Arduino 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.

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 )

 

Schematic Diagram

 

 

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.

Schematic_DIY+Arduino+Multi+Function+Power+Meter+V1.0_2020-07-13_22-00-43

 

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.

 

 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.

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

 

 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.

 

 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.

 

 Solder the Screw Terminals

 

 

 

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 the power supply to the Arduino and two green terminals are used for source and load connection.

 

 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

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

 

 

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

 

 

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

 

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 the 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.

 

 Software and Libraries

 

 

 

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 installation, all the libraries, set the correct board and COM port, then upload the code.

 

Arduino code :

 

 

 Final Testing

 

 

 

 

Arduino Multifunction Energy Meter

 

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.

 

 

 

 

Related Posts

Fig-12.2: Wire Gauge Systems Fig-12.4: Cable Sizing Example       Fig-12.5: DC Cable Size Chart   Fig-13.1: Battery and

Read More