IoT DC Energy Meter using ESP8266 & Blynk (36V, 30A)
IoT Based DC Power Energy Meter with ESP8266 & INA226 Sensor to monitor Source-Load Voltage, Current, Power & kWh in Blynk App up to 36V, 30A
- Suitable forB.Tech/Diploma ESP8266/IoT students
- Build time1-2 weeks
- LevelBeginner
- Available atAjvika Labs, Kakinada
About this project
Overview
In this project, we will build our own
Wireless IoT Based DC Power Energy Meter
using
ESP8266
&
INA226
Current Sensor. This energy meter is capable of measuring
DC Source Voltage
, Load Voltage, Current,
Power,
and
Energy
Consumption. We can monitor the data online on
Blynk Application
. The maximum voltage and current this energy meter can measure are
26V
and
30A
respectively.
Earlier we build
IoT AC Energy Meter
using ESP32 which could measure voltage, current, and power parameters. But the device is only made for measuring AC parameters. The
DC Energy meter
requires DC related sensors. To measure
DC parameters
, we need
DC Current/Voltage Sensors
. The
INA226
is the best choice for these meters as it can measure DC Voltage up to
36V
. By adjusting the
Shunt resistance
on INA226, the maximum current it can measure is
30A
An
IoT DC Power Energy Meter
can transmit the sensor data to a central system or application using
Internet of Things (IoT)
technology. Such meters can provide valuable data in
real time
about power usage, which can be used to monitor and manage
energy consumption
more effectively, identify inefficiencies, or automate certain power-related processes.
Bill of Materials
For the IoT DC Power Energy Meter, we need the following components. The components are mostly SMD type with 0805 packages for resistor, capacitor, and LED.
S.N.
Components
Designator
Footprint
Quantity
Part Number
ESP8266-12E
U1
WIFIM-SMD_ESP-12E
ESP-12E
LM7805 5V Regulator
U2
TO-220-3
LM7805
INA226
U3
1x8 2.54MM
INA226
HT7333 LDO
U4
SOT-89-3
HT7333-7
Resistor 220E
R9
R0805
Resistor 330
R6
R0805
Resistor 12K
R1,R2,R3,R4,R5
R0805
Resistor 22K
R7,R8
R0805
Capacitor 0.1uF
C1
C0805
Capacitor 470pF
C2
C0805
Capacitor 10uF
C3,C4
C0805
Capacitor 47uF, 10V
C6
CAP-TH_BD6.3-P2.50-D0.5-FD
Capacitor 220uF, 50V
C5
CAP-TH_BD8.0-P3.50-D0.6-FD
LED Red
LED1
LED0805
Transistor BC847
Q1,Q2
SOT-23-3
BC847A
Push Button
FLS,RST
SW-SMD_L4.0-W3.0-LS4.8
TS-1071AS-A1B3-D4
Slide Switch
SW1
SW-TH_MK-12D18-G040
MK-12D18-G020
Header Pins 1x6
PROG
Male Header 1x6 2.54mm
Header Pins (1x4)
U5
Female Header 1x4 2.54mm
Terminal Block (1x2)
LOAD, BAT.
TERMINAL_BLOCK_2P_5
INA226 DC Current Sensor
The INA226 is an advanced, high-side current shunt and power monitor IC developed by Texas Instruments. It operates over an I2C-compatible or SMBus-compatible interface, offering direct digital communication with a microcontroller.
It provides more extensive capabilities than the INA219, including better accuracy, more extensive voltage, and current range, as well as integrated math functions that directly report power in watts. The INA226 module is built with an INA226 chip, a few resistors, and a capacitor that helps reduce noise, or unwanted electrical signals.
Features & Specifications of INA226
Operational Voltage: 2.7 – 5.5 Volts
Bus Voltage Range: 0 – 36 Volts
Current Sensing Range: ± 500mA to ± 50A
Power consumption: Continuous mode: 0.35 mA; Power-Down Mode: 2.3.µA
Measurement modes:
: continuous or on-demand (“triggered”)
Averaging of 1, 4, 64, 128, 256, 512 or 1024 individual measurements
A/D conversion time is adjustable in eight levels: 0.14 to 8.2 ms
Current Sensing Resistor Selection
The
maximum current
that the INA226 can measure is not determined directly by the chip itself, but rather by the value of the
shunt resistor
used in conjunction with it.
The INA226 measures the
voltage drop
across a
shunt resistor
, and from that calculates the current using
Ohm’s law (I = V/R)
. Since the INA226 can measure a maximum shunt voltage of
81.92mV
(with a resolution of 2.5µV), the maximum current is dependent on the
resistance
of the shunt.
Below is a table of suggested shunts.
Shunt Resistance
Max Current (A)
Part Size
Part Number
Power Rating (W)
Max Power (W)
0.003
27.31
2512
ERJMS4SF3M0U
2.24
0.004
20.48
2512
ERJMS4SF4M0U
1.68
0.005
16.38
2512
ERJMS4HF5M0U
1.34
0.006
13.65
2512
ERJMS4HF6M0U
1.12
0.007
11.70
2512
ERJMS4HF7M0U
0.96
0.008
10.24
2512
ERJMS4HF8M0U
0.84
0.009
9.10
2512
ERJMS4HF9M0U
0.75
0.010
8.19
2512
ERJMS4HF10MU
0.67
To learn in detail about the INA226 Current Sensor, we already published a dedicated detailed article. You can follow this article for more information:
Measuring Current, Voltage, Power with INA226 Current Sensor
Designing of IoT DC Power Energy Meter
Let us take a look at the circuit for IoT DC Power Energy Meter using ESP8266 & INA226. We could have used
INA219 Current Sensor
for this project, but INA226 has voltage limitations of 26V and the maximum current it can measure is ±3.2A.
We need an energy meter that can measure more voltage and current. The INA226 is the best alternative considering the cost and accuracy. We can measure the voltage up to 36V and the current up to 30A. The current setting is based on the shunt resistance that needs to be selected based on the above table.
Since the device is IoT Based, we used ESP8266 raw chip for this purpose. The entire device is powered using an external power source. Here is the complete schematic for the project.
The external DC source such as Battery or a Solar Panel is used to power the circuit. The input voltage should be between 7V to 36V only. The Switch SW1 is used to power on/off the circuit. The Input voltage is fed to the 7805 Voltage regulator IC. Use a proper heat sink for 7805 if the supply voltage is greater than 12V. The capacitor C5 (220uF, 50V) filters input voltages and makes stability. The LM7805 IC outputs 5V DC which is fed to LDO HT7333. The HT7333 limits the voltage to 3.3V. The entire circuit operates at 3.3V. The LED1 indicates whether the circuit is powered on or off.
Moving to the ESP8266 chip part, we have used our
ESP8266 Automatic Programmer Circuit
. There is no need to press the reset or boot button while uploading the code. You can connect USB-to-TTL Converter Module to PROG Pins & program the circuit. The programming process is automatic and handled by two switches (FLS and RST), two BC547 transistors (Q1 and Q2), and a few other components.
The RTS signal resets the ESP8266, while the DTR signal puts it in flash mode, with Q1 and Q2 preventing the chip’s reset when both signals are low. Upon detecting an upload command, the ESP module auto-switches to flash mode for seamless sketch uploading. In the absence of an upload command, ESP-12E/F starts in normal mode.
For the INA226 Current sensor, the SDA and SCL pins are connected to the SDA & SCL pins of the ESP8266 Chip. The Vin+ pin should be connected to a power source and the Vin- to the load as shown in the design schematic. The INA226 Sensor has VBus Pin, which is used to measure the Load Voltage. Therefore we need to connect the VBus pin to Vin- pin.
The U5 part in the circuit is the I2C and Power pins. You can directly connect a 0.96″ I2C OLED Display here or a 3.3V LCD Display.
Project PCB Design, Gerber File & PCB Ordering Online
The above schematic is designed using EasyEDA. You can convert the schematic to the PCB.
The PCB has SMD components with resistors, capacitors, and LED with an SMD package of 0805. The transistors, and push buttons are also in the SMD package. The front side of the PCB has all the components to be mounted.
The Gerber File for the PCB is given below. You can simply download the Gerber File and order the PCB from
ALLPCB
at
1$
only.
Download Gerber File
:
ESP8266 Energy Meter PCB
You can use this Gerber file to order high-quality PCB for this project. To do that visit the
ALLPCB
official website by clicking here:
https://www.allpcb.com/
You can now upload the Gerber File by choosing the Quote Now option. From these options, you can choose the Material Type, Dimensions, Quantity, Thickness, Solder Mask Color and other required parameters.
After filling in all details, select your country and shipping method. Finally, you
In this project, we will build our own
Wireless IoT Based DC Power Energy Meter
using
ESP8266
&
INA226
Current Sensor. This energy meter is capable of measuring
DC Source Voltage
, Load Voltage, Current,
Power,
and
Energy
Consumption. We can monitor the data online on
Blynk Application
. The maximum voltage and current this energy meter can measure are
26V
and
30A
respectively.
Earlier we build
IoT AC Energy Meter
using ESP32 which could measure voltage, current, and power parameters. But the device is only made for measuring AC parameters. The
DC Energy meter
requires DC related sensors. To measure
DC parameters
, we need
DC Current/Voltage Sensors
. The
INA226
is the best choice for these meters as it can measure DC Voltage up to
36V
. By adjusting the
Shunt resistance
on INA226, the maximum current it can measure is
30A
An
IoT DC Power Energy Meter
can transmit the sensor data to a central system or application using
Internet of Things (IoT)
technology. Such meters can provide valuable data in
real time
about power usage, which can be used to monitor and manage
energy consumption
more effectively, identify inefficiencies, or automate certain power-related processes.
Bill of Materials
For the IoT DC Power Energy Meter, we need the following components. The components are mostly SMD type with 0805 packages for resistor, capacitor, and LED.
S.N.
Components
Designator
Footprint
Quantity
Part Number
ESP8266-12E
U1
WIFIM-SMD_ESP-12E
ESP-12E
LM7805 5V Regulator
U2
TO-220-3
LM7805
INA226
U3
1x8 2.54MM
INA226
HT7333 LDO
U4
SOT-89-3
HT7333-7
Resistor 220E
R9
R0805
Resistor 330
R6
R0805
Resistor 12K
R1,R2,R3,R4,R5
R0805
Resistor 22K
R7,R8
R0805
Capacitor 0.1uF
C1
C0805
Capacitor 470pF
C2
C0805
Capacitor 10uF
C3,C4
C0805
Capacitor 47uF, 10V
C6
CAP-TH_BD6.3-P2.50-D0.5-FD
Capacitor 220uF, 50V
C5
CAP-TH_BD8.0-P3.50-D0.6-FD
LED Red
LED1
LED0805
Transistor BC847
Q1,Q2
SOT-23-3
BC847A
Push Button
FLS,RST
SW-SMD_L4.0-W3.0-LS4.8
TS-1071AS-A1B3-D4
Slide Switch
SW1
SW-TH_MK-12D18-G040
MK-12D18-G020
Header Pins 1x6
PROG
Male Header 1x6 2.54mm
Header Pins (1x4)
U5
Female Header 1x4 2.54mm
Terminal Block (1x2)
LOAD, BAT.
TERMINAL_BLOCK_2P_5
INA226 DC Current Sensor
The INA226 is an advanced, high-side current shunt and power monitor IC developed by Texas Instruments. It operates over an I2C-compatible or SMBus-compatible interface, offering direct digital communication with a microcontroller.
It provides more extensive capabilities than the INA219, including better accuracy, more extensive voltage, and current range, as well as integrated math functions that directly report power in watts. The INA226 module is built with an INA226 chip, a few resistors, and a capacitor that helps reduce noise, or unwanted electrical signals.
Features & Specifications of INA226
Operational Voltage: 2.7 – 5.5 Volts
Bus Voltage Range: 0 – 36 Volts
Current Sensing Range: ± 500mA to ± 50A
Power consumption: Continuous mode: 0.35 mA; Power-Down Mode: 2.3.µA
Measurement modes:
: continuous or on-demand (“triggered”)
Averaging of 1, 4, 64, 128, 256, 512 or 1024 individual measurements
A/D conversion time is adjustable in eight levels: 0.14 to 8.2 ms
Current Sensing Resistor Selection
The
maximum current
that the INA226 can measure is not determined directly by the chip itself, but rather by the value of the
shunt resistor
used in conjunction with it.
The INA226 measures the
voltage drop
across a
shunt resistor
, and from that calculates the current using
Ohm’s law (I = V/R)
. Since the INA226 can measure a maximum shunt voltage of
81.92mV
(with a resolution of 2.5µV), the maximum current is dependent on the
resistance
of the shunt.
Below is a table of suggested shunts.
Shunt Resistance
Max Current (A)
Part Size
Part Number
Power Rating (W)
Max Power (W)
0.003
27.31
2512
ERJMS4SF3M0U
2.24
0.004
20.48
2512
ERJMS4SF4M0U
1.68
0.005
16.38
2512
ERJMS4HF5M0U
1.34
0.006
13.65
2512
ERJMS4HF6M0U
1.12
0.007
11.70
2512
ERJMS4HF7M0U
0.96
0.008
10.24
2512
ERJMS4HF8M0U
0.84
0.009
9.10
2512
ERJMS4HF9M0U
0.75
0.010
8.19
2512
ERJMS4HF10MU
0.67
To learn in detail about the INA226 Current Sensor, we already published a dedicated detailed article. You can follow this article for more information:
Measuring Current, Voltage, Power with INA226 Current Sensor
Designing of IoT DC Power Energy Meter
Let us take a look at the circuit for IoT DC Power Energy Meter using ESP8266 & INA226. We could have used
INA219 Current Sensor
for this project, but INA226 has voltage limitations of 26V and the maximum current it can measure is ±3.2A.
We need an energy meter that can measure more voltage and current. The INA226 is the best alternative considering the cost and accuracy. We can measure the voltage up to 36V and the current up to 30A. The current setting is based on the shunt resistance that needs to be selected based on the above table.
Since the device is IoT Based, we used ESP8266 raw chip for this purpose. The entire device is powered using an external power source. Here is the complete schematic for the project.
The external DC source such as Battery or a Solar Panel is used to power the circuit. The input voltage should be between 7V to 36V only. The Switch SW1 is used to power on/off the circuit. The Input voltage is fed to the 7805 Voltage regulator IC. Use a proper heat sink for 7805 if the supply voltage is greater than 12V. The capacitor C5 (220uF, 50V) filters input voltages and makes stability. The LM7805 IC outputs 5V DC which is fed to LDO HT7333. The HT7333 limits the voltage to 3.3V. The entire circuit operates at 3.3V. The LED1 indicates whether the circuit is powered on or off.
Moving to the ESP8266 chip part, we have used our
ESP8266 Automatic Programmer Circuit
. There is no need to press the reset or boot button while uploading the code. You can connect USB-to-TTL Converter Module to PROG Pins & program the circuit. The programming process is automatic and handled by two switches (FLS and RST), two BC547 transistors (Q1 and Q2), and a few other components.
The RTS signal resets the ESP8266, while the DTR signal puts it in flash mode, with Q1 and Q2 preventing the chip’s reset when both signals are low. Upon detecting an upload command, the ESP module auto-switches to flash mode for seamless sketch uploading. In the absence of an upload command, ESP-12E/F starts in normal mode.
For the INA226 Current sensor, the SDA and SCL pins are connected to the SDA & SCL pins of the ESP8266 Chip. The Vin+ pin should be connected to a power source and the Vin- to the load as shown in the design schematic. The INA226 Sensor has VBus Pin, which is used to measure the Load Voltage. Therefore we need to connect the VBus pin to Vin- pin.
The U5 part in the circuit is the I2C and Power pins. You can directly connect a 0.96″ I2C OLED Display here or a 3.3V LCD Display.
Project PCB Design, Gerber File & PCB Ordering Online
The above schematic is designed using EasyEDA. You can convert the schematic to the PCB.
The PCB has SMD components with resistors, capacitors, and LED with an SMD package of 0805. The transistors, and push buttons are also in the SMD package. The front side of the PCB has all the components to be mounted.
The Gerber File for the PCB is given below. You can simply download the Gerber File and order the PCB from
ALLPCB
at
1$
only.
Download Gerber File
:
ESP8266 Energy Meter PCB
You can use this Gerber file to order high-quality PCB for this project. To do that visit the
ALLPCB
official website by clicking here:
https://www.allpcb.com/
You can now upload the Gerber File by choosing the Quote Now option. From these options, you can choose the Material Type, Dimensions, Quantity, Thickness, Solder Mask Color and other required parameters.
After filling in all details, select your country and shipping method. Finally, you
Technologies used
Hardware components
- ESP32
- ESP8266
- OLED
- INA226
Software & tools
- Blynk
- EasyEDA
What you get
- Working project / hardware kit, tested before delivery
- Complete source code with explanation
- Project demo and guidance for your viva
- Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed.
Payment is in two parts:
• 50% advance to start the project
• Remaining 50% before delivery
Note:
• Documentation and PPT are not included by default
• If you need documentation/PPT, it can be arranged for extra time and cost
We'll confirm the exact timeline and cost with you after reviewing your requirements.