Summary
Monitoring electricity consumption is a practical way to understand how much power household appliances use and how small changes in usage can affect your electricity bill. Instead of relying only on the monthly utility bill, you can build your own energy meter that measures voltage, current, power, and energy consumption in real time. In this tutorial, we'll build a smart energy meter using Arduino Uno. Unlike the ESP32 version shown in the reference project, this build uses an Arduino Uno, making it ideal for beginners who are already familiar with the Arduino ecosystem. The project uses a ZMPT101B AC Voltage Sensor and an ACS712 Current Sensor to measure electrical parameters. A 16×2 I2C LCD displays the readings, while a push button lets you switch between display pages and reset the accumulated energy value. Safety Note: This project involves AC mains voltage. Never work on live electrical wiring. Disconnect the mains supply before making any connections, use properly insulated components, and seek assistance from a qualified person if you are unfamiliar with AC wiring. The Arduino side operates at low voltage, but the sensors interface with mains electricity and should be handled carefully. The project overview in this tutorial is based on the concepts demonstrated in the reference video.

How the Smart Energy Meter Works
The system continuously measures the voltage and current flowing through an electrical load.
The Arduino performs the following calculations:
-
Reads AC voltage from the ZMPT101B sensor.
-
Reads current from the ACS712 sensor.
-
Calculates instantaneous power.
Power (W) = Voltage × Current
-
Continuously accumulates energy consumption.
Energy (kWh) = Power × Time
-
Estimates electricity cost using a fixed tariff entered in the Arduino program.
The LCD displays two pages:
Page 1
-
Voltage (V)
-
Current (A)
-
Power (W)
Page 2
-
Total Energy (kWh)
-
Estimated Cost (₹)
A push button switches between the two display pages. Holding the button for a few seconds resets the stored energy and cost values.
Components and Supplies
Components Required
You'll need the following components:
-
ACS712 Current Sensor (5A/20A/30A)
-
Breadboard or Veroboard
-
5V Adapter for Arduino
-
AC Socket
-
AC Plug
-
Load (LED bulb, soldering iron, fan, etc.) Understanding the Sensors
ZMPT101B Voltage Sensor
The ZMPT101B safely measures AC voltage through an isolated transformer circuit.
Instead of connecting the Arduino directly to mains voltage, the module outputs a low-voltage analog signal proportional to the AC voltage.
The Arduino converts this analog signal into RMS voltage using calibration.
ACS712 Current Sensor
The ACS712 measures the current flowing through the load.
The phase wire passes through the module.
As current increases, the sensor's analog output changes proportionally.
The Arduino converts this analog value into amperes using the sensor sensitivity.
Circuit Connections
LCD (I2C)
-
VCC → 5V
-
GND → GND
-
SDA → A4
-
SCL → A5
ZMPT101B
-
VCC → 5V
-
GND → GND
-
OUT → A0
Connect the AC input terminals across the mains supply.
ACS712
-
VCC → 5V
-
GND → GND
-
OUT → A1
The live wire passes through the sensor module before reaching the load.
Push Button
-
One terminal → Digital Pin 2
-
Other terminal → GND
Enable the Arduino's internal pull-up resistor in software.

Assembling the Project
Begin by mounting the Arduino and LCD on the breadboard or Veroboard.
Connect the LCD first and verify that it powers on correctly.
Next, connect the ZMPT101B voltage sensor and ACS712 current sensor to the Arduino's analog inputs.
Install the push button in an easily accessible location.
Finally, connect the AC socket, ACS712 sensor, and ZMPT101B module according to the circuit.
Double-check every connection before powering the system. Programming Logic
Step 1: Initialize the Hardware
Start by including the required libraries and defining the pins.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int voltagePin = A0;
const int currentPin = A1;
const int buttonPin = 2;
float energy = 0.0;
float cost = 0.0;
const float tariff = 8.0; // ₹ per kWh
unsigned long previousMillis = 0;
The LCD is initialized, the analog pins for the voltage and current sensors are assigned, and variables are created to store energy consumption and cost.
Step 2: Measure AC Voltage
The Arduino reads multiple samples from the ZMPT101B sensor and converts them into an approximate RMS voltage.
const float voltageCalibration = 0.80;
int rawVoltage = analogRead(voltagePin);
float voltage = (rawVoltage * (5.0 / 1023.0)) * 230.0 * voltageCalibration;
In a practical project, multiple samples should be averaged before calculating the final voltage to improve stability.
Step 3: Measure Current
The ACS712 outputs approximately 2.5V when no current is flowing.
Subtracting this offset gives the actual current value.
const float sensitivity = 0.185; // ACS712 5A version
int rawCurrent = analogRead(currentPin);
float sensorVoltage = rawCurrent * (5.0 / 1023.0);
float current = (sensorVoltage - 2.5) / sensitivity;
if(current < 0)
current = -current;
If you're using the 20A or 30A ACS712 version, update the sensitivity value according to the module specifications.
Step 4: Calculate Power
Once voltage and current have been measured, calculating power is straightforward.
float power = voltage * current;
This gives the instantaneous power consumption in watts.
Step 5: Calculate Energy Consumption
Energy depends on both power and time.
The Arduino continuously accumulates energy as the appliance operates.
unsigned long currentMillis = millis();
float hours = (currentMillis - previousMillis) / 3600000.0;
energy += (power * hours) / 1000.0;
previousMillis = currentMillis;
Dividing by 1000 converts watt-hours into kilowatt-hours.
Step 6: Calculate Electricity Cost
Once energy has been calculated, estimating the electricity bill becomes very simple.
cost = energy * tariff;
You can change the tariff value according to your local electricity board.
For example:
const float tariff = 7.5;
or
const float tariff = 9.0;
Step 7: Display Values on the LCD
Display the live electrical parameters on the first screen.
lcd.setCursor(0,0);
lcd.print("V:");
lcd.print(voltage,1);
lcd.print(" I:");
lcd.print(current,2);
lcd.setCursor(0,1);
lcd.print("P:");
lcd.print(power,1);
lcd.print(" W");
When the push button is pressed, switch to the second page.
lcd.clear();
lcd.setCursor(0,0);
lcd.print("E:");
lcd.print(energy,3);
lcd.print("kWh");
lcd.setCursor(0,1);
lcd.print("Rs:");
lcd.print(cost,2);
This provides a clean separation between real-time electrical measurements and accumulated usage statistics.
Step 8: Reset Energy Using the Push Button
Holding the button for a few seconds resets the accumulated values.
if(digitalRead(buttonPin) == LOW)
{
energy = 0;
cost = 0;
}
Calibrating the Sensors
Calibration is the most important part of this project.
Voltage Calibration
Measure the mains voltage using a digital multimeter.
Compare it with the LCD reading.
If the Arduino shows:
228 V
but the multimeter reads:
231 V
Slightly adjust the voltage calibration factor in the program until both values closely match.
Current Calibration
Connect a known load.
For example:
A 60W soldering iron.
Measure the current using a clamp meter or multimeter.
Compare this with the Arduino reading.
Adjust the current calibration factor until both values match closely.
Calibration should be performed gradually rather than making large changes. Testing the Project
Testing becomes much easier if you use loads with known power ratings.
Test 1: 7W LED Bulb
Connect a 7W LED bulb.
Verify:
-
Voltage appears correctly.
-
Current is very low.
-
Power is approximately 7W.
Test 2: 60W Soldering Iron
Replace the bulb with a soldering iron.
Observe:
-
Higher current
-
Power close to 60W
-
Energy increasing steadily
This confirms that the Arduino updates measurements correctly for different loads.
Test 3: LCD Navigation
Press the push button.
Confirm that the display changes between:
Page 1
Voltage, Current, Power
and
Page 2
Energy, Cost
Hold the button for three seconds.
The accumulated energy should reset.

Common Problems
Voltage Reading Is Incorrect
Usually caused by:
-
Incorrect calibration factor
-
Loose sensor wiring
-
Electrical noise
Current Always Reads Zero
Check:
-
ACS712 orientation
-
Sensor output connection
-
Offset calibration
LCD Displays Nothing
Verify:
-
I2C wiring
-
LCD address
-
Contrast adjustment
Running an I2C scanner sketch can help identify the correct LCD address.
Readings Fluctuate Excessively
Average more analog samples before performing calculations.
Adding simple software filtering usually improves stability.
Final Thoughts
Building a smart energy meter is an excellent way to learn how Arduino can measure real-world electrical parameters and convert raw sensor data into useful information. Along the way, you'll gain experience with analog signal processing, sensor calibration, LCD interfacing, timing calculations, and embedded programming.
For anyone interested in an energy meter project India, this build provides a practical introduction to energy monitoring using readily available Arduino components. Once you've mastered the basic version, you can gradually add wireless connectivity, cloud dashboards, and data logging to create a more advanced home energy monitoring system.








