ESP32/IoT B.Tech/Diploma Beginner

IoT Smart Electricity Energy Meter with ESP32 & Blynk 2.0

Build an IoT-based Smart Electricity Energy Meter with ESP32 & Blynk 2.0 App & measure voltage, current, power & total energy consumed online

  • Suitable forB.Tech/Diploma ESP32/IoT students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Overview
In this project, we will build an IoT-based Smart Electricity Energy Meter using ESP32 and the newly updated Blynk 2.0 application. We have previously built an
IoT DC Energy Meter
GSM Prepaid Energy Meter
and also an IoT
Energy Meter using ESP32
using the old Blynk Application, but with the recent upgrade of the Blynk platform, it was necessary to upgrade our Energy Meter project as well. Our aim is to automate the process of monitoring electricity consumption and make it a more streamlined experience.
Traditionally, monitoring electricity consumption involves manual meter readings, which can be time-consuming and inconvenient. The Internet of Things provides a solution by automating remote data collection, thereby saving time and money. The concept of a Smart Energy Meter has gained significant popularity worldwide in recent years, making this an excellent opportunity to build our own IoT-based electricity energy meter.
We will create an IoT-based Smart Electricity Energy Meter using ESP32 and the updated Blynk 2.0 application. By using the best current sensor (SCT-013) and voltage sensor (ZMPT101B), we can measure voltage, current, power, and total energy consumed in kWh. The readings will be sent to the Blynk 2.0 application and displayed on a dashboard accessible from any location. In case of power outages, the energy meter data will be stored in ESP32’s EEPROM, ensuring continuous readings. Let’s start our project to automate electricity consumption monitoring.
Bill of Materials
Below, is the list of components necessary for constructing an IoT-based Smart Electricity Energy meter. You can order most of these components online from the following links.
S.N.
Components
Quantity
1
ESP32 WiFi Module
1
Amazon
AliExpress
2
ZMPT101B AC Voltage Sensor Module
1
Amazon
AliExpress
3
SCT-013-030 Non-invasive AC Current Sensor
1
Amazon
AliExpress
4
20x4 I2C LCD Display
1
Amazon
AliExpress
5
Micro-USB Cable
1
Amazon
AliExpress
6
Resistor 10K
2
Amazon
AliExpress
7
Resistor 100ohm
1
Amazon
AliExpress
8
Capacitor 10uF
1
Amazon
AliExpress
9
Connecting Wires
10
Amazon
AliExpress
10
Breadboard
1
Amazon
AliExpress
SCT-013 Current Sensor
The SCT-013 is a non-invasive split-core type clamp meter sensor designed to measure AC current up to 100 amperes. This type of current sensor is commonly known as a current transformer (CT) and is used for measuring alternating current in a building. The SCT-013 is convenient to use, as it can be easily attached to either the live or neutral wire without any electrical work involving high voltage.
The sensor has a primary winding, magnetic core, and secondary winding, which is composed of many turns of fine wire enclosed in the transformer casing.
Specifications
1. Input Current:
0-30A AC
2. Output Signal:
DC 0-1 V
3. Non-linearity:
2-3 %
4. Build-in sampling resistance (RL):
62 Ω
5. Turn Ratio:
1800:1
6. Resistance Grade:
Grade B
7. Work Temperature:
-25 °C~+70 °C
8. Dielectric Strength (between shell and output):
1000 V AC / 1 min 5 mA
ZMPT101B AC Single Phase Voltage Sensor
The ZMPT101B AC Single Phase Voltage Sensor Module is a high-precision device built on the ZMPT101B voltage transformer. This makes it an ideal choice for measuring accurate AC voltage with an Arduino or ESP32.
The module is capable of measuring AC voltage within a range of 250V and offers adjustable analog output. It is easy to use, featuring a multi-turn trim potentiometer for adjusting and calibrating the ADC output.
Specifications
1. Voltage up to
250 volts
can be measured
2. Lightweight with on-board micro-precision voltage transformer
3. High precision on-board op-amp circuit
4. Operating temperature :
40ºC ~ + 70ºC
5. Supply voltage
5 volts
to 30 volts
You can use ZMPT101B for
AC Voltage Monitoring
applications.
Circuit Diagram & Hardware Setup
The circuit diagram for the IoT-based Electricity Energy Meter using ESP32 is shown below. The design was created using the Fritzing software and the connection diagram is simple.
The VCC & GND pins of both the SCT-013 Current Sensor and ZMPT101B Voltage Sensor are connected to the
Vin
&
GND
of ESP32, which is a
5V
supply. The output analog pin of the ZMPT101B Voltage Sensor is connected to the
GPIO35
of ESP32 and the output analog pin of the SCT-013 Current Sensor is connected to the
GPIO34
of ESP32. Additionally, two
10K resistors
and a single
100-ohm resistor
, along with a
10uF capacitor
, are required to complete the circuit.
To measure the current and voltage, the AC wires must be connected to the
input AC Terminal
of the Voltage Sensor. For the Current Sensor, only a single live or neutral wire needs to be inserted inside the
clip
part.
An optional
20×4 I2C LCD display
can also be used, but it requires additional connections. Connect the VCC, GND, SDA & SCL of the LCD Display to ESP32 5V, GND, GPIO21 & GPIO 22 of ESP32 respectively. A 10K Potentiometer at the back of the I2C Module is used to adjust the LCD contrast. Alternatively, the
ESP32/SCT-013/ZMPT101B
Energy Meter data can be monitored on the
Blynk Application
without connecting the LCD display.
Setting Up Blynk 2.0 Web and Mobile Dashboard
Blynk
is an application that runs over
Android
and
IOS
devices to
control any IoT based application
using Smartphones. It allows you to create your Graphical user interface for IoT application. Here we will display the IoT Energy Meter Data on Blynk Web Dashboard and also in mobile Application.
Visit
blynk.io
and sign up using the email ID.
First Create a New Template.
Assign the name, Hardware & Connection Type.
From the Web Dashboard, Create 4 widgets Gauge.
The 4 widgets are here to display the value of Vrms, Irms, Power & KWh. Do the settings as per the image below.
Finally the Web Dashboard looks something like this and is ready to receive the Smart Energy Meter Data from ESP32.
Apart from the Web Dashboard, you can also set up your Mobile App Dashboard.
You can download and install the
Blynk Application
from
Google Play Store
. IOS users can download from the
App Store
Once the installation is completed, open the app & sign-up using your Email id and Password. Then set up the app similar like Web Dashboard.
Required Library Installation
1. EmonLib Library
The Emonlib Library is used for
Electricity Energy Meter
. EmonLib is a Continuous Monitoring of Electricity Energy repeats, every
5 or 10s
, a sequence of voltage and current measurements. EemonLib continuously measures in the background the voltage and all the current input channels, calculates a
true average quantity
for each, and then informs the sketch that the measurements are available and should be read and processed.
Download
EmonLib Library
2. Blynk Library
Blynk is the most popular
Internet of Things
platform for connecting any hardware to the cloud, designing apps to control them, and managing your deployed products at scale. With Blynk Library you can connect over 400 hardware models including A
rduino, ESP8266 & ESP32
to the
Blynk Cloud
Download
Blynk Library
ZMPT101B Voltage Sensor Calibration
Initially the ZMPT101B Voltage Sensor requires calibration as it doesn’t come pre-calibrated. To calibrate the sensor, we can use an Arduino UNO/Nano Board. Since Arduino UNO/Nano has a perfect linear ADC pin, it can be a good choice for calibration. You can use analog pin A0 of Arduino to calibrate the sensor.
Now upload the following code to the Arduino Board.
1
2
3
4
5
6
7
8
9
10
void
setup
(
)
{
Serial
begin
(
9600
)
;
}
void
loop
(
)
{
Serial
println
(
analogRead
(
A0
)
)
;
delay
(
100
)
;
}
After uploading the code, open the Serial Plotter. If the Serial Plotter doesn’t show the sine wave, then rotate the potentiometer to calibrate the sensor. Once it shows a proper sine wave, you can assume it is a proper calibration.
Source Code/Program for IoT Smart Energy Meter
This code is an Arduino sketch that implements an IoT energy meter us

Technologies used

ESP32ESP8266ArduinoBlynkWiFiBLEGSMLCDAndroidI2CADC

Hardware components

  • ESP32
  • ESP8266
  • Arduino

Software & tools

  • Blynk
  • Fritzing

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.