Smart Digital Energy Meter using power line communication modem

Smart Energy Meter   look similar to electronic meters but they are better than both the electro mechanical meters  and the electronic meters in the sense  that  in  addition  to  providing  the  usual  services  of  a  regular  meter,  they  are connected back to the utility through the PLC . It means that there is no need of  an  official  from  the  utility  (which  provides  you  electricity)  to  come  at  your doorstep  and  take  the  meter  readings.  This  can  be  achieved  by  the  use  of microcontroller unit that continuously monitors and records the energy meter readings in its permanent memory location. Smart meters can also be used to shut off service to households and commercial establishments that don‟t pay their bills.The size of smart meters and traditional meters is same  and smart meters are digital  .  Smart  Energy  Meter  measures  more  detailed  readings  than  KWhr  so  that utility can plan the expansion of network and power quality . The Smart Energy Meter is designed so that it measures voltage and load currents by the use of  voltage and current  sensors  instead  of  potential  and  current  transformers  and  then  feeds  these values of voltage and current into energy metering IC.Initial  indications  from  deployents  globally  indicate  that  putting  in  place monitoring systems such as smart meters prevents loss due to electricity theft. It can also  lead  to  lower  power  consumption  as  consumers  who  were  earlier  using  „free‟ power  reduce it  and resort to using only as much as they can pay for legally. Also smart meters  ease the burden on  customers who regularly pay bills by billing them very accurately and often less. GSM and bluetooth technologies are both incorporated in this system. GSM  allows data transfer between the energy  meter and consumer on a regular basis. Here the bill details are send to the consumer in every two months.Bluetooth   provides the facility of accessing the bill details according to their requirement. 

objectives:

  •   Real time monitoring of energy meter by KSEB through Power line carrier(PLC) Communication
  •   Communication with consumer through GSM and Bluetooth
  •  Daily updation of electricity bill in the display
  •  Disconnection and reconnection of consumer supply by KSEB according to the bill payment.
  • Power theft control
BLOCK DIAGRAM







CIRCUIT










 PROGRAM


/*-----------------------------------------------------
lcd- 
D7 -PIN0      E -PIN4
D6 -PIN1      RS -PIN5
D5 -PIN2
D4 -PIN3
RELAY-PIN10 
CT 1-------------A0-
CT 2-------------A1-
TRANSFORMER------A2-

-----------------------------------------------------*/

int c1,c2,v,x,p=0,t=0,y=2,z=0;//ct1,ct1,trans,theft,power,unit,amt
u8 u=0;
char g[5],l;
void setup()
 {
 pinMode(10,OUTPUT);
  pinMode(11,OUTPUT); pinMode(12,OUTPUT); pinMode(21,OUTPUT);
    digitalWrite(11,LOW);  digitalWrite(12,LOW);  digitalWrite(21,LOW);
  
 Serial.begin(9600);
  lcdinit ();
  digitalWrite(10,HIGH);
  delay(1000);
  digitalWrite(10,LOW);
lcd.setCursor(0,1);
lcd.printf("u=%d",u);



}

void loop()
{
lcd.clear();
//time();
voltcurrntlcd();        
theft ();
p=((c2*v)/100) + p;
serial1();

lcd.setCursor(9,1);
z=u*y;
lcd.printf("Rs=%d",z);

lcd.setCursor(0,1);
lcd.printf("u=%d",u);

lcd.setCursor(3,1);
lcd.printf("t=%d",t);
delay(100);
t=t+1;
if(p>13000)
{
u=u+1;
p=0;
//z=u*y+z;
//bluetooth();
}



if(t>600)   
{
digitalWrite(11,HIGH);
Serial.write('A');   del();Serial.write('M');   del();Serial.write('T'); del();Serial.write('-');   del();
z=u*y;
adctoascii();
Serial.write(g[2]);   del();Serial.write(g[3]);  del();Serial.write(0xd);  del();
u=0;
t=0;
//z=0;
digitalWrite(11,LOW);
message();
bluetooth();
}
 }
  
  
  void bluetooth(void)
{
digitalWrite(21,HIGH);

 Serial.printf("amt=");
   Serial.println(z, DEC);
   
 Serial.write(0xd);//ENTER
 digitalWrite(21,LOW);   
}  
 void message(void)
{
digitalWrite(12,HIGH);
Serial.printf("AT+CMGF=1;");//TEXT MODE
Serial.write(0xd);//ENTER
delay(1000);
Serial.printf("AT+CMGS=");
Serial.write(0X22);
Serial.printf("9526418115");//NUMBER
Serial.write(0X22);
Serial.write(0xd);//ENTER
delay(1000);
Serial.printf("Rs-");Serial.write(g[2]);   Serial.write(g[3]); 
Serial.write(0x1a);
del ();

 digitalWrite(12,LOW);

 void del (void)
 {
 delay(500);
 }
 void serial1(void)
 {
if(Serial.available()>0)
{
l=Serial.read();
//Serial.write(l);
if(l=='k') //tarif
{

while(!(Serial.available()>0));
l=Serial.read();
y=(l-0x30);
}

if(l=='d'){
digitalWrite(10,HIGH);
}

else if (l=='c')
digitalWrite(10,LOW);

}
 }

void lcdinit (void)
{
//LCDPINS----- RS -PIN5   E -PIN4     D4 -PIN3   D5 -PIN2     D6 -PIN1    D7 -PIN0
lcd.pins(5, 4, 3, 2, 1, 0, 0, 0, 0, 0); // RS, E, D4 ~ D8
lcd.begin(16, 2);  // set up the LCD's number of columns and rows: 
lcd.clear();//CLEAR DATA IN LCD
 lcd.clear();
}



void voltcurrntlcd (void)
{
lcd.setCursor(0,0);
c2 = analogRead(A1)*10; // energy meter
   delay(10);
lcd.printf("I=%d",c2);


c1 = analogRead(A0)*10;
   delay(10);


lcd.setCursor(7,0);
v = analogRead(A2)*8/10;
   delay(10);
lcd.printf("V=%d",v);

}

void theft (void)
{
x=c1-c2;
if(x>200) 
{
digitalWrite(11,HIGH);
Serial.write('t');   del();Serial.write('h');   del();Serial.write('e');  del();
Serial.write('f');   del();Serial.write('t');   del();
Serial.write('-');   del();
Serial.write('n');   del();Serial.write('0');   del();
Serial.write('-');   del();Serial.write('7');   del();
digitalWrite(11,LOW);
}
}

void adctoascii (void)
{
g[4]='\0'; //LSB section
g[3]=(z%10)+0x30;
g[2]=z/10%10+0x30;
g[1]=z/100%10+0x30;
g[0]=z/1000+0x30;//MSB section
}