Skip to content
Awais Asghar.
Embedded & IoT2024

IoT Electricity Theft Detection

A smart meter that spots tampering and bypass with anomaly alerts.

Addresses a real problem for Pakistani utilities: an IoT meter compares expected and measured consumption, detects anomalies that indicate theft, and raises remote alerts for the distribution operator.

IoT Electricity Theft Detection thumbnail

README · rendered from GitHub

IoT Based Electricity Theft Detection System

Project Status Sensors Platform Language IDE License

Image

Introduction

Electricity theft is a major issue affecting power utilities and national economies. According to Islamabad Times, nearly 360 billion rupees worth of electricity was stolen in 2022-23. This IoT-based solution detects unauthorized consumption by monitoring the current differential in a circuit using ACS712 sensors. If theft is detected, the system disconnects the power using a relay, activates a buzzer, and sends an SMS alert to the configured number via GSM.

Image Image Image

Project Overview

This smart electricity meter is built using:

  • Arduino UNO: Microcontroller for logic processing.
  • ACS712 Current Sensors: Measure current at two different points.
  • LCD 16x2 Display: Show current readings and alerts.
  • Relay Module: Cuts off power if theft is detected.
  • Buzzer: Audible alert on theft.
  • GSM Module: Sends SMS to user (in expanded version).
  • Potentiometer (10k): Controls contrast for LCD.

The system compares two current values. If the difference exceeds a threshold, it assumes power is being illegally diverted.


Features

  • Dual Current Monitoring using ACS712 sensors
  • Differential Current Detection to spot theft
  • Relay Cutoff + Buzzer Alarm when theft is detected
  • SMS Alert via GSM module (optional/expandable)
  • Real-Time LCD Display of current values and theft status
  • Auto Reset After Alert (if desired via code update)

Hardware Components

ComponentQuantity
Arduino UNO1
ACS712 Current Sensor (20A)2
LCD Display (16x2)1
Relay Module1
Buzzer1
GSM Module (SIM800L)1 (optional)
Potentiometer (10k)1
Jumper Wires-
Breadboard/PCB1
Power Supply1
Image Image

Working Principle

  1. The system constantly measures current from two separate points using ACS712 sensors.
  2. If both values are close (within threshold), the system assumes normal usage.
  3. If there's a significant difference, the system detects power theft.
  4. On detection:
    • The relay is triggered to cut off power.
    • A buzzer sounds an alert.
    • A message is sent via GSM (if configured).
Image

Software Flow & Logic

Image

Working Logic

  • Read both sensors and calculate current values
  • Compute differential current
  • If differentialCurrent ≥ threshold (e.g., 50):
    • Display “POWER THEFT”
    • Trigger relay + buzzer
    • Optionally send SMS alert
  • Else, display both currents and differential

Pin Configuration

ComponentArduino Pin
LCD RS, E, D4-D7D7, D6, D5, D4, D3, D2
ACS712 Sensor 1A0
ACS712 Sensor 2A1
BuzzerD8
RelayD9
GSM TX/RXD10/D11 (if used)

Code Summary

  • Libraries Used: LiquidCrystal
  • Sensor Sensitivity: 100mV/A
  • Voltage Reference: 5V (5000 mV)
  • Offset Voltage: 2500 mV (for both sensors)
  • RMS Calculation: (Vpeak - offset) / sensitivity / √2

> Ensure that ACS712 sensors are properly calibrated and isolated from mains supply!


Sample Output

LCD Display: I1 = 2.55 I2 = 2.53 A Vd = 0.02

OR

POWER THEFT !! -Disconnected-


SMS Alert Integration

To enable SMS alerts:

  • Connect SIM800L GSM module
  • Use Serial to send AT commands
  • Configure destination number using AT+CMGS

Example:

Serial.println("AT+CMGF=1");
Serial.println("AT+CMGS=\"+923XXXXXXXXX\"");
Serial.println("Power Theft Detected!");

Future Enhancements

  • Integrate IoT Cloud Platform (e.g., ThingSpeak, Blynk) for remote monitoring
  • Replace GSM with Wi-Fi (ESP8266) for real-time internet connectivity
  • Develop a Mobile App Dashboard for live data tracking
  • Incorporate Machine Learning models to analyze and predict theft behavior
  • Add an Auto Reset Relay function after theft alert acknowledgment
Image

Applications

This system has wide-ranging real-world use cases, particularly in countries facing energy theft and distribution losses. Some of the key applications include:

  • Residential Electricity Monitoring: Detect unauthorized connections or tampering in household energy usage.
  • Commercial & Industrial Energy Management: Prevent illegal power usage in factories, shops, and commercial facilities.
  • Smart Grid Integration: Can be scaled into smart grids for automated theft detection and control at the transformer/distribution level.
  • Utility Company Deployment: Helps utility providers reduce revenue losses and monitor consumer integrity.
  • Educational & Research Projects: Ideal for IoT, embedded systems, and energy efficiency-based academic research or student final-year projects.
  • Remote Locations Monitoring: With GSM/WiFi integration, the system can operate in remote areas without physical inspection.
  • Tamper Detection in Prepaid/Postpaid Meters: Add-on module to modern meters for enhanced security and power usage audit.
Image

Troubleshooting

IssueSolution
LCD not displayingCheck potentiometer setting and wiring
No current readingCalibrate sensor, verify VCC & GND
Relay not switchingConfirm digital HIGH signal and connections
GSM not workingUse active SIM, check signal & power supply
False theft alertsTune or raise the differential threshold

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute it with proper attribution.

Demo Video

https://github.com/user-attachments/assets/ea9b1b55-9d12-4969-9dc2-6b3e9aedabbd


Remarks:

Image

More in Embedded

Related projects

See all
  • Embedded2025

    FreeRTOS Smart Energy Monitor

    STM32F746 tasks compute Vrms, Irms and kWh; an ESP32 pushes it to a cloud dashboard.

    • STM32F746
    • FreeRTOS
    • ESP32
    • C/C++
  • Embedded2024

    Crowd-Sourced AQI Monitor

    Six sensors, Bluetooth to a phone app, and AQI within 1% of the US Embassy station.

    • Arduino UNO
    • C/C++
    • PMS5003
    • MQ-series
  • Embedded2024

    Fully Automated Egg Incubator

    ATmega328P climate control and egg turning that hatched every pigeon egg in 18 days.

    • ATmega328P
    • Arduino IDE
    • Atmel Studio
    • Proteus