Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home IoT & Smart Home

IoT Smart Energy Monitor: Measure Home Power with ESP32

IoT Smart Energy Monitor: Measure Home Power with ESP32

March 11, 2026 /Posted byJayesh Jain / 0

An IoT smart energy monitor with ESP32 is one of the most impactful home automation projects you can build. With electricity bills rising across India and smart metering becoming more common, building your own non-invasive energy monitor gives you real-time insight into how much power your home is consuming — appliance by appliance. This project uses affordable current sensors and the ESP32’s Wi-Fi capability to stream live power data to your phone or a cloud dashboard.

In this guide, we cover the hardware selection, circuit design, Arduino code, and cloud integration needed to build a fully functional smart energy monitor from scratch — all with components available in India.

Table of Contents

  1. How Non-Invasive Energy Monitors Work
  2. Components Required
  3. Circuit Design and Wiring
  4. Arduino Code for Power Measurement
  5. Sending Data to a Cloud Dashboard
  6. Calculating Cost Savings and ROI
  7. Advanced Features to Add
  8. Frequently Asked Questions

How Non-Invasive Energy Monitors Work

Unlike traditional energy meters that require cutting into mains wiring, a non-invasive energy monitor uses a Current Transformer (CT) sensor that clips around a live wire. The changing magnetic field created by the AC current induces a small proportional current in the CT’s secondary coil, which the microcontroller measures to calculate the actual current flowing through the wire.

Combined with knowledge of the mains voltage (230V AC at 50 Hz in India), the microcontroller can calculate:

  • Apparent Power (VA): Vrms × Irms
  • Real Power (W): Vrms × Irms × Power Factor
  • Energy Consumption (kWh): Real Power integrated over time

The most popular CT sensor for DIY energy monitors in India is the YHDC SCT-013 series, which comes in variants rated for 30A, 100A, and 200A — suitable for monitoring individual circuits or the entire home mains.

For accurate power factor measurement (important for inductive loads like motors, compressors, and fluorescent lights), you need a voltage reference. This can be done with a small 9V AC transformer connected to another ADC pin, allowing the ESP32 to measure both voltage and current waveforms simultaneously and calculate the true phase angle between them.

Components Required

Here is everything you need to build a complete IoT energy monitor:

Component Specification Purpose
ESP32 Dev Board NodeMCU-32S or similar Main microcontroller with Wi-Fi
CT Sensor SCT-013-030 (30A) or SCT-013-100 (100A) Non-invasive current measurement
Burden Resistor 33Ω for 30A version Converts CT current to measurable voltage
Voltage Divider 2× 10kΩ resistors Biases CT output to mid-rail
Capacitor 10µF electrolytic Filters bias voltage
3.5mm Audio Jack Female stereo CT sensor connector
Ai Thinker NodeMCU-32S ESP32 Development Board

Ai Thinker NodeMCU-32S ESP32 Development Board – IPEX Version

The heart of your energy monitor. Dual-core 240MHz processor with 12-bit ADC channels, built-in Wi-Fi and Bluetooth — ideal for real-time power measurement and cloud upload.

View on Zbotic

Circuit Design and Wiring

The ESP32’s ADC input accepts 0-3.3V. The CT sensor output is a small AC current centred around 0V. To interface it with the ESP32’s ADC, you need to:

  1. Add a burden resistor across the CT output to convert current to voltage.
  2. Create a voltage bias at VCC/2 (1.65V) using two equal resistors as a voltage divider, so the AC waveform oscillates around mid-rail instead of going negative.
  3. Add a decoupling capacitor to stabilise the bias voltage.

Connect the CT sensor output (via a 3.5mm jack) to the bias circuit, and the junction of the burden resistor and bias resistors to GPIO 34 (or any ADC1 channel) of the ESP32. GPIO 34 is recommended because it is input-only and has no internal pull-up/pull-down that could interfere with ADC readings.

Important Safety Note

The CT sensor is the only component that contacts your home’s mains wiring. All other components operate at safe low voltage. Never remove the CT sensor from the wire while it is open-circuit (without the burden resistor connected) — the voltage can spike to dangerous levels. Always connect the burden resistor before clamping the CT around a live wire.

Arduino Code for Power Measurement

We will use the excellent EmonLib library, which handles all the signal processing for current and power calculation. Install it from the Arduino Library Manager by searching for “EmonLib”.

#include <WiFi.h>
#include <EmonLib.h>
#include <time.h>

EnergyMonitor emon1;

const char* ssid     = "YourWiFiSSID";
const char* password = "YourWiFiPassword";

// India mains voltage
const float MAINS_VOLTAGE = 230.0;

// Calibration value — adjust based on your CT sensor and burden resistor
// For SCT-013-030 with 33Ω burden: calibration ≈ 111.1
const double CALIBRATION = 111.1;

void setup() {
  Serial.begin(115200);

  // Initialize CT sensor on ADC pin 34
  emon1.current(34, CALIBRATION);

  // Connect to Wi-Fi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("nWi-Fi connected!");

  // Sync NTP time
  configTime(19800, 0, "pool.ntp.org");
}

void loop() {
  // Read RMS current (number of samples, crossings)
  double Irms = emon1.calcIrms(1480);

  // Calculate apparent power
  double apparentPower = Irms * MAINS_VOLTAGE;

  // Get timestamp
  struct tm t;
  getLocalTime(&t);
  char timeStr[20];
  strftime(timeStr, sizeof(timeStr), "%H:%M:%S", &t);

  Serial.printf("[%s] I=%.3fA  P=%.1fVAn",
                timeStr, Irms, apparentPower);

  delay(2000);
}

Calibrating Your CT Sensor

The calibration value depends on your specific CT sensor and burden resistor. To calibrate accurately:

  1. Connect a known load (e.g., a 100W incandescent bulb — draw should be ≈0.435A at 230V)
  2. Use a clamp meter to measure the actual current
  3. Adjust the calibration constant in the sketch until your ESP32 reading matches the clamp meter
4x18650 Battery Shield

4×18650 Battery Shield for Arduino/ESP32/ESP8266

Power your ESP32 energy monitor with a reliable lithium battery shield — provides uninterrupted monitoring even during power cuts, with an on/off switch for convenience.

View on Zbotic

Sending Data to a Cloud Dashboard

Raw serial output is useful for development, but a proper IoT energy monitor should send data to a cloud platform where you can view graphs, set alerts, and analyse trends. Popular free options for Indian makers include:

Blynk

Blynk is beginner-friendly and has a free tier that is sufficient for a single energy monitor. Add the Blynk library, create a project on the Blynk app, and use Blynk.virtualWrite(V1, apparentPower) to push data every few seconds. The app displays a live gauge and historical graph.

ThingSpeak (MathWorks)

ThingSpeak is free for up to 4 channels and stores up to 3 million data points. Use the ESP32’s HTTPClient to POST data to your channel’s API endpoint every 15 seconds. ThingSpeak also supports MATLAB-powered analytics for deeper insight into your consumption patterns.

MQTT + Node-RED + Grafana

For a more advanced, self-hosted setup, install Mosquitto MQTT broker and Node-RED on a Raspberry Pi on your home network. The ESP32 publishes power readings to an MQTT topic, Node-RED subscribes and stores them in InfluxDB, and Grafana provides beautiful time-series dashboards. This approach gives you complete data ownership.

// Example: Send to ThingSpeak
#include <HTTPClient.h>

const String apiKey = "YOUR_THINGSPEAK_API_KEY";

void sendToThingSpeak(float watts, float amps) {
  if (WiFi.status() == WL_CONNECTED) {
    HTTPClient http;
    String url = "http://api.thingspeak.com/update?api_key=" + apiKey
                 + "&field1=" + String(watts)
                 + "&field2=" + String(amps);
    http.begin(url);
    int code = http.GET();
    http.end();
  }
}

Calculating Cost Savings and ROI

Once you have a week of energy data, you can start identifying high-consumption appliances and peak usage times. In India, most residential consumers are on a slab-rate tariff where the first 100 units (kWh) per month are cheaper and subsequent units are billed at a higher rate.

Here is a simple calculation to add to your dashboard:

  • Daily kWh: Sum all watt-hours readings and divide by 1000
  • Monthly kWh: Daily kWh × 30
  • Estimated monthly bill: Based on your state’s DISCOM tariff (e.g., ₹6/unit in Maharashtra for 101-300 units)

Many users report finding phantom loads from devices left on standby — TVs, set-top boxes, desktop computers, and phone chargers. Eliminating standby power on just a few devices can save ₹100-500 per month on your electricity bill.

DHT11 Temperature Humidity Sensor

DHT11 Digital Relative Humidity and Temperature Sensor Module

Add temperature and humidity monitoring alongside your energy data — correlate AC usage with ambient conditions to optimise cooling schedules and save on electricity bills.

View on Zbotic

Advanced Features to Add

Once your basic monitor is working, consider these enhancements to make it truly smart:

Multi-Circuit Monitoring

The ESP32 has multiple ADC channels (ADC1: GPIO 32-39). You can connect up to 4-6 CT sensors simultaneously to monitor individual circuits — kitchen, bedroom, AC, water heater — each independently. This gives you a detailed breakdown of per-circuit consumption rather than just whole-home data.

Automatic Alerts

Set thresholds in your ESP32 code to trigger alerts if power consumption exceeds a limit (e.g., above 3000W for more than 10 minutes). Send an alert via Telegram bot, push notification through Blynk, or an email via SMTP. This can catch faulty appliances, forgotten ovens, or unusual consumption.

Monthly Bill Prediction

Track cumulative kWh since the 1st of the month in SPIFFS or EEPROM. Apply your local DISCOM’s tariff schedule to calculate a predicted bill. Display this on an OLED screen or send a weekly WhatsApp update via a webhook.

Integration with Home Assistant

If you run Home Assistant on a Raspberry Pi, add the ESP32 energy monitor as an MQTT sensor. Home Assistant’s Energy Dashboard can then show your home’s consumption history alongside solar production data, giving you a complete energy overview in one place.

Frequently Asked Questions

Is it safe to build a DIY energy monitor?

Yes, when done correctly. The CT sensor is the only component near mains voltage, and it is specifically designed for safe, non-invasive clamping. The ESP32 circuit operates entirely at 3.3V/5V. However, always turn off the MCB and circuit breaker before opening your distribution board, and if you are not comfortable working with electrical panels, consult a licensed electrician to clamp the CT sensor for you.

How many circuits can one ESP32 monitor?

The ESP32 has 6 usable ADC1 channels (GPIO 32-39). However, ADC2 channels are shared with Wi-Fi and cannot be used reliably when Wi-Fi is active. So practically you can monitor 4-6 circuits simultaneously with one ESP32, using ADC1 channels only.

What is the accuracy of a CT sensor energy monitor?

A well-calibrated SCT-013 setup typically achieves ±2-3% accuracy, which is comparable to many commercial energy monitors. For purely resistive loads (heaters, incandescent bulbs), accuracy is higher. For inductive loads (motors, compressors), you need voltage measurement to accurately calculate real power and power factor.

Can I monitor a 3-phase connection?

Yes, but you need one CT sensor per phase (3 total) and ideally a voltage reference per phase as well. The ESP32 has enough ADC channels for this. Libraries like EmonLib can handle multi-phase calculations with some customisation.

Build Your Smart Energy Monitor Today

Get all the ESP32 boards, sensors, and modules you need for your IoT energy monitoring project at Zbotic — fast shipping across India.

Shop IoT Components

Tags: Energy Monitor, ESP32, iot, Power Meter, smart home
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
ESP32-C3 Beginner Guide: RISC-...
blog esp32 c3 beginner guide risc v wifible on a budget 595297
blog esp32 spiffs and littlefs store files in flash memory 595303
ESP32 SPIFFS and LittleFS: Sto...

Related posts

Svg%3E
Read more

IoT Home Insurance Sensor Kit: Leak, Smoke, and Motion

April 1, 2026 0
Table of Contents IoT and Home Insurance Water Leak Detection Smoke and Fire Detection Motion and Intrusion Sensing Building the... Continue reading
Svg%3E
Read more

IoT Pet Tracker: GPS Collar with Geofencing Alerts

April 1, 2026 0
Table of Contents Introduction and Overview Hardware Components Required GPS Module Integration with ESP32 Cloud Platform Setup Real-Time Tracking Dashboard... Continue reading
Svg%3E
Read more

IoT Aquaponics Controller: Fish and Plant Automation

April 1, 2026 0
Table of Contents The Water Monitoring Challenge in India Sensor Technologies for Water Building the Sensor Node Data Transmission and... Continue reading
Svg%3E
Read more

IoT Composting Monitor: Temperature and Moisture Tracking

April 1, 2026 0
Table of Contents Why Temperature Monitoring Matters Sensor Selection Guide Hardware Assembly and Wiring Firmware Development Cloud Data Logging Alert... Continue reading
Svg%3E
Read more

IoT Beehive Monitor: Weight, Temperature, and Humidity

April 1, 2026 0
Table of Contents Why Monitor Beehives Weight Measurement System Temperature and Humidity Sensing Building the Monitor Data Analysis for Bee... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now