✨ Use RCAPP and get 5% off 👇
Skip to content
Free Delivery on Orders Above Rs 999/- Pan-India
Cash on Delivery Available for Orders above Rs.500/- and Upto Rs 3000/-
SAVE more when you BUY more. Upto 30% Off on BULK PURCHASE
GST Invoices for Your Business
Dedicated Technical Support Team
Safely Delivering Genuine Products PAN INDIA

Build a Smart Energy Meter Using Arduino

Build a Smart Energy Meter Using Arduino
-
Written By - Robocraze -
📅 Updated on 08 Jul 2026
Summarize with AI
✅ Prompt copied

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.

Build a Smart Energy Meter Using Arduino

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: 

  1. Reads AC voltage from the ZMPT101B sensor 

  1. Reads current from the ACS712 sensor 

  1. Calculates instantaneous power.  

Power (W) = Voltage × Current 

  1. Continuously accumulates energy consumption.  

Energy (kWh) = Power × Time 

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

128x64 Graphic LCD -Yellow Backlight - 128x64 yellow backlight LCD for microcontroller projects. -LCD Display -Robocraze128x64 Graphic LCD -Yellow Backlight - 128x64 yellow backlight LCD for microcontroller projects. -LCD Display -Robocraze

    128x64 Graphic LCD -Yellow Backlight

    JHD 128x64 Graphic LCD -Yellow Backlight This is the original jHD128x64 LCD display with Yellow backlight, It is simple to use and works with the vast majority of microcontrollers on the market. With this Graphic LCD, you can do a lot of graphic things. You...
    Rs 459/-
    Rs 459/-
    Rs 750/-
    Save Rs 291/-
    16x2 Green LCD with Soldered I2C/IIC Interface16x2 Green LCD with Soldered I2C/IIC Interface

    16x2 Green LCD with Soldered I2C/IIC Interface

    16x2 Green LCD with Soldered I2C/IIC Interface If you need an easy-to-use display for your project, the 16x2 Green LCD with Soldered I2C/IIC Interface is a great option. It shows 16 characters across 2 lines with a clear green backlight, so you can read...
    Rs 223/-
    Rs 223/-
    Rs 249/-
    Save Rs 26/-
    1660 Tie-Point Solderless Breadboard – Large breadboard for circuit prototyping. Electronic Components - Robocraze1660 Tie-Point Solderless Breadboard – Large breadboard for circuit prototyping. Electronic Components - Robocraze

    1660 tie-point Solderless Breadboard

    1660 tie-point Solderless Breadboard The 1660 Points Solderless Breadboard is an excellent size with more than enough room for more advanced prototyping. There are two terminal strips with 1260 tie-points and 4 distribution strips with 400 tie-points.  The breadboards accept a variety of wire sizes from 20 to...
    Rs 429/-
    Rs 429/-
    Rs 699/-
    Save Rs 270/-
    170 Points Mini Breadboard – Compact solderless breadboard for quick prototyping. Electronic Components - Robocraze170 Points Mini Breadboard – Compact solderless breadboard for quick prototyping. Electronic Components - Robocraze

      170 Points Mini Breadboard

      170 Points Mini Breadboard This 170 Points Mini Breadboard is the ideal companion for seamless electronics prototyping, designed to provide a hassle-free experience. With a 2x17 row layout and a total of 170 pins, this prototyping breadboard offers abundant space to create and test...
      Rs 20/-
      Rs 20/-
      Rs 29/-
      Save Rs 9/-
      Arduino UNO Prototyping Shield – Expand Arduino projects with this prototyping shield. Electronic Components - RobocrazeArduino UNO Prototyping Shield – Expand Arduino projects with this prototyping shield. Electronic Components - Robocraze

        Arduino UNO Prototyping Shield

        UNO Prototyping Shield for Arduino UNO Prototype Shield is used in the cases where you want to build more applications without using any external Breadboard. This prototyping shield for Arduino helps in expanding the functionalities of UNO board and create extra connections for embedded...
        Rs 99/-
        Rs 99/-
        Rs 114/-
        Save Rs 15/-
        Arduino UNO R3 SMD – Compact compatible Arduino Board with SMD ATmega328 for embedded development. Buy now! -RobocrazeArduino UNO R3 SMD – Compact compatible Arduino Board with SMD ATmega328 for embedded development. Buy now! -Robocraze

          Arduino UNO R3 SMD ATmega328 Compatible Board

          Arduino UNO R3 SMD Board Compatible with Arduino One of the most accessible ways to step into the world of electronics innovation is with the SMD Arduino UNO R3 Development Board with Cable. Known for its reliability and performance, this board is widely regarded...
          Rs 210/-
          Rs 210/-
          Rs 349/-
          Save Rs 139/-
          ZMPT101B Voltage Sensor – Precise AC voltage transformer module for circuits. -Electronic Components -RobocrazeZMPT101B Voltage Sensor – Precise AC voltage transformer module for circuits. -Electronic Components -Robocraze

            ZMPT101B AC Single Phase Voltage Sensor Transformer Module

            ZMPT101B AC Single Phase Voltage Sensor Transformer Module ZMPT101B AC Voltage Sensor is the best for the purpose of the DIY project, where we need to measure the accurate AC voltage with a voltage transformer. This is an ideal choice to measure the AC...
            Rs 110/-
            Rs 110/-
            Rs 144/-
            Save Rs 34/-
            20A ACS712 Current Sensor - High-precision current sensing up to 20A. -Current Sensor -Robocraze20A ACS712 Current Sensor - High-precision current sensing up to 20A. -Current Sensor -Robocraze

              20A ACS712 Current Sensor

              20A ACS712 Current Sensor The 20A ACS712 Range Current Sensor Module ACS712 consists of a precise, low-offset, linear Hall circuit with a copper conduction path located near the surface of the die. Applied current flowing through this copper conduction path generates a magnetic field in which...
              Rs 79/-
              Rs 79/-
              Rs 124/-
              Save Rs 45/-
              30A ACS712 Current Sensor - Measures AC/DC current up to 30A with precision. -Current Sensor -Robocraze30A ACS712 Current Sensor - Measures AC/DC current up to 30A with precision. -Current Sensor -Robocraze

                30A ACS712 Current Sensor

                30A ACS712 Current Sensor The 30A ACS712 Current Sensor consists of a precise, low-offset, linear Hall circuit with a copper conduction path located near the surface of the die. Applied current flowing through this copper conduction path generates a magnetic field in which the Hall IC converts...
                Rs 79/-
                Rs 79/-
                Rs 169/-
                Save Rs 90/-

                Components Required 

                You'll need the following components: 

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

                Arduino Project

                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. 

                Circuit connections

                 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. 

                Excerpt

                Learn how to build a smart energy meter using Arduino to monitor voltage, current, power, and energy consumption in real time with this beginner-friendly DIY project guide.
                Prev Post
                Next Post

                Leave a comment

                Please note, comments need to be approved before they are published.

                Thanks for subscribing!

                This email has been registered!

                Shop the look

                Choose Options

                Edit Option
                Back In Stock Notification
                Compare
                Product SKU Description Collection Availability Product Type Other Details

                Choose Options

                this is just a warning
                Login
                Shopping Cart
                0 items
                FREE SHIPPING!
                ₹100 OFF
                ₹200 OFF
                ₹999
                ₹2500
                ₹4900
                WhatsApp Chat Chat