Iot Smart Energy Meter With Sms Alerts & Real-time Data

About the project

Monitor AC power metrics over Wi-Fi using ESP32 & PZEM-004T, view on MQTT dashboard, and receive SMS alerts on abnormal electrical condition

Project info

Difficulty: Easy

Platforms: AdafruitDFRobotEspressif

Estimated time: 4 hours

License: MIT license (MIT)

Items used in this project

Hardware components

PZEM-004T PZEM-004T x 1
Adafruit RGB Backlight LCD - 16x2 Adafruit RGB Backlight LCD - 16x2 x 1
DFRobot I2C 16x2 Arduino LCD Display Module DFRobot I2C 16x2 Arduino LCD Display Module x 1
Espressif ESP32 Espressif ESP32 x 1

Software apps and online services

Arduino IDE Arduino IDE

Hand tools and fabrication machines

fritzing fritzing x 1

Story

Overview

This project demonstrates how to build an IoT-enabled smart energy meter that measures real-time electrical parameters, including voltage, current, power, energy, frequency, and power factor. It displays these parameters locally, streams them online, and sends SMS alerts when abnormal conditions are detected. It uses an ESP32, a PZEM-004T energy sensor, and a lightweight MQTT dashboard for remote monitoring.

Smart Energy Meter Using IoT

Smart Energy Meter Using IoT

Key Features
  • 📊 Real-time Power Monitoring — Tracks voltage, current, power, energy, frequency, and power factor.
  • 🌐 Remote Dashboard — Uses MQTT to stream data to a web dashboard accessible from anywhere.
  • 📩 SMS Alerts — Sends alerts via Circuit Digest Cloud API when abnormal conditions (e.g., high voltage) are detected.
  • 🖥 Local Display — Shows values on a 16×2 LCD with anI2C interface.

Block Diagram

Block Diagram

How It Works
  • Measurement: The PZEM-004T module measures AC parameters using its internal metering IC and an external current transformer
  • Data Acquisition: ESP32 communicates with the PZEM via UART (Modbus) to read electrical values.
  • Local Display: Values are shown on a 16×2 LCD in a rotating manner (e.g., voltage → current → power factor).
  • Remote Streaming: ESP32 publishes the readings to an MQTT broker (e.g., HiveMQ) for dashboard visualisation.
  • Alert Logic: When a parameter crosses a predefined threshold (e.g., voltage > 255 V), the ESP32 triggers an SMS alert via the Circuit Digest Cloud API.

Circuit diagarm

Circuit diagarm

Firmware Highlights
  • Libraries: Includes WiFi, MQTT, PZEM interface, and I2C LCD support.
  • Parameter Loop: Continuously reads and publishes sensor data.
  • SMS Trigger: Sends a JSON payload to Circuit Digest Cloud when an alert condition is met.
  • Dashboard Support: Web interface connects to MQTT over WebSockets for dynamic updates.

MQTT Dashboard Setup
  • Save the provided HTML file from the project repo.
  • Open it in a browser.
  • Configure the MQTT broker URL to match your setup (e.g., ws://broker.hivemq.com:8000/mqtt).

Dashboard

Dashboard

Use Cases
  • 🏠 Home Energy Monitoring — Track real consumption from anywhere.
  • Safety Alerts — Get notified about overloads or faults.
  • 🧰 DIY Power Analytics — Base platform for automation and analytics.

Tips & Troubleshooting
  • If the current reads zero, ensure the CT clamp is placed correctly around the live conductor only.
  • Incorrect LCD output often means wrong I2C address — try scanning 0x27 or 0x3F
  • Stable Wi-Fi is needed for SMS alerts via the API.

Summary

This Smart Energy Meter Using IoT brings local and remote power monitoring together with alerting capability, making it an excellent choice for makers and home automation enthusiasts. With minimal hardware and open protocols like MQTT and HTTP, you gain both visibility and safety insights into your electrical system.

Schematics, diagrams and documents

Schematic Diagram

Code

GitHub Repository

Credits

Leave your feedback...