RAJESH SINHA
Published © CERN-OHL

Smart Energy Meter with Home automation

A Smart Energy Meter with Home Automation system integrates real-time energy monitoring with automated control of household devices. It trac

IntermediateFull instructions providedOver 2 days757
Smart Energy Meter with Home automation

Things used in this project

Hardware components

SCT-013
×1
AC Single Phase Voltage Sensor (ZMPT101B)
×1
NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
Arduino UNO
Arduino UNO
×1
connecting wires
×1
5 mm LED: Red
5 mm LED: Red
×4

Software apps and online services

Arduino IDE
Arduino IDE
web brows

Story

Read more

Schematics

Circuit Diagram of Smart Energy Meter with Home automation

Code

Arduino code

Arduino
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "EmonLib.h"
#include <SoftwareSerial.h>

EnergyMonitor emon;

#define vCalibration 83.3
#define currCalibration 0.50
SoftwareSerial mySerial(10, 11);

float kWh = 0;
unsigned long lastmillis = millis();

LiquidCrystal_I2C lcd(0x27, 16, 2); // Address 0x27, 16 columns, 2 rows

void myTimerEvent()
{
  emon.calcVI(20, 2000);
  kWh = kWh + emon.apparentPower * (millis() - lastmillis) / 3600000000.0;
  yield();
  Serial.print("Vrms: ");
  Serial.print(emon.Vrms, 2);
  Serial.print("V");

  Serial.print("\tIrms: ");
  Serial.print(emon.Irms, 4);
  Serial.print("A");

  Serial.print("\tPower: ");
  Serial.print(emon.apparentPower, 4);
  Serial.print("W");

  Serial.print("\tkWh: ");
  Serial.print(kWh, 5);
  Serial.println("kWh");

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Vrms:");
  lcd.print(emon.Vrms, 2);
  lcd.print("V");
  lcd.setCursor(0, 1);
  lcd.print("Irms:");
  lcd.print(emon.Irms, 4);
  lcd.print("A");
  delay(2500);

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Power:");
  lcd.print(emon.apparentPower, 4);
  lcd.print("W");
  lcd.setCursor(0, 1);
  lcd.print("kWh:");
  lcd.print(kWh, 4);
  lcd.print("W");
  delay(2500);

  lastmillis = millis();
}

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

  lcd.init();
  lcd.backlight();

  emon.voltage(A0, vCalibration, 1.7);
  emon.current(0, currCalibration);

  lcd.setCursor(3, 0);
  lcd.print("IoT Energy");
  lcd.setCursor(5, 1);
  lcd.print("Meter");
  delay(3000);
  lcd.clear();
}

void loop()
{
  myTimerEvent();
  delay(2000);
}

Credits

RAJESH SINHA
14 projects • 11 followers
Hey there! I'm Rajesh. I'm passionate about building innovative projects.mail id:- rajeshkumar15022004@gmail.com
Contact

Comments

Please log in or sign up to comment.