Programmable Load Shedding - Electronicsprojects
Programmable Load Shedding - Electronicsprojects
Electronicsprojects
* This is a blog for elec… search
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
Automatic Dam … 2
Programmable Load Shedding
SPEAKING MIC… 70
ABSTRACT
Programmable L… 16 In today’s world, there is a continuous need for
automatic appliances
with the increase in standard of living, there is a sense
of urgency for
developing circuits that would ease the complexity of life.
The project is designed
to operate an electrical load multiple number
of times as per the program. It overcomes
the difficulties of switching the
load ON/OFF manually. This proposed has an
inbuilt real time clock
(RTC) to keep tracking the time and thus to switch
ON/OFF the load
accordingly.
Load shedding is what electric utilities do when
there is a huge
demand for electricity that exceeds the supply. Thus in a
distribution
system it needs to be precisely controlled for specific period of
time.
Programmable load shedding time management system is a reliable circuit
that takes over the manual task of switch ON/OFF the electrical devices
with
respect to time. It uses real time clock (RTC) interfaced to a
microcontroller
of 8051 family. While the set time equals to the real time,
then
microcontroller gives command to the corresponding relay to turn
ON the load
and then another command to switch OFF as per the
program. Multiple ON/OFF time
entry is the biggest advantage with this
project. A matrix keypad helps ente
BLOCK DIAGRAM
[http://3.bp.blogspot.com/-
BuKnOX_o4cE/UxS6DQmdugI/AAAAAAAAAIc/_CtQlSP4l_U/s1600/PROJECT.jpg]
CIRCUIT DIAGRAM
Electronicsprojects
* This is a blog for elec… search
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
Automatic Dam … 2
SPEAKING MIC… 70
Programmable L… 16
[http://4.bp.blogspot.com/-lBWRrkoLSuA/UxS63Hzdl-I/AAAAAAAAAIk/wnpjW0P-
rEE/s1600/circuit+diagram.jpg]
SOFTWARE
IMPLIMENTATION
ALGORITHM
STEP 01: Start.
STEP 15: Set the new value of alarm time as the power
Electronicsprojects
* This is a blog for elec…
on time. search
STEP 16: display the current time and power on
time on
LCD. Sidebar
Snapshot
Timeslide
Classic
Flipcard
Magazine
Mosaic
Automatic Dam … 2 STEP 17: If current time matches the alarm time goto
step 16.
PROGRAMS:
LCD
#include
<REGX52.H>
#define data
P1
#define rs
P3_5
#define rw
P3_4
#define en
P3_3
unsigned char
msg[88];
void
delay(unsigned int);
void
LCD_busy();
void
LCD_command(unsigned char var);
void
LCD_data(unsigned char var);
void
LCD_string(unsigned char *var);
void
LCD_init(void);
void
LCD_READY(void);
void
LCD_init(void)
{
LCD_command (0x38);
LCD_command (0x0C);
LCD_command (0x01);
LCD_command (0x06);
}
void LCD_command(unsigned char var)
{
LCD_READY();
data
= var; //Function set: 2
Line, 8-bit, 5x8 dots
rs
= 0; //Selected command
register
rw
= 0; //We are writing in
instruction register
en
= 1; //Enable H->L
en
= 0;
}
void
LCD_string(unsigned char *var)
{
while(*var) //till string ends
Dynamic
LCD_data(*var++); //send
Views theme. Powered characters one by one
by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/programmable-load-shedding.html 3/17
9/21/21, 10:11 AM Programmable Load Shedding | Electronicsprojects
}
Electronicsprojects
* This is a blog for
void
LCD_data(unsigned elec
char var)… search
{
LCD_READY();
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
data
= var; //Function set: 2
Line, 8-bit, 5x7 dots
Automatic Dam … 2 rs
= 1; //Selected data
register
rw
= 0; //We are writing
SPEAKING MIC… 70 en =
1; //Enable H->L
en
= 0;
Programmable L… 16 }
void
LCD_READY(void)
{
P1_7=1;
rs=0;
rw=1;
do
{
en=0;
en=1;
delay(1);
}while(P1_7);
}
void
delay(unsigned int m)
{
unsigned int i,j;
for(i=0;i<m;i++)
for(j=0;j<10;j++);
}
KEYPAD
#include <regx52.H>
#include "lcd.h"
char key_scan();
unsigned char key[4][3]={'1','2','3',
'4','5','6',
'7','8','9',
'*','0','#'};
char key_scan()
{
unsigned char col, row;
P2=0xF0;
while(1)
{
do
{
col=P2&0x70;
Dynamic
}while(col!=0x70);
Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/programmable-load-shedding.html 4/17
9/21/21, 10:11 AM Programmable Load Shedding | Electronicsprojects
do
Electronicsprojects
*{ This is a blog for elec…
search
do
Classic
Flipcard
Magazine
Mosaic
Sidebar
{ Snapshot
Timeslide
delay(20);
Automatic Dam … 2 col=P2&0x70;
}while(col==0x70);
SPEAKING MIC… 70 delay(20);
col=P2&0x70;
Programmable L… 16 }while(col==0x70);
while(1)
{
P2=0x7E;
col=P2&0x70;
if(col!=0x70)
{
row=0;
break;
}
P2=0x7D;
col=P2&0x70;
if(col!=0x70)
{
row=1;
break;
}
P2=0x7B;
col=P2&0x70;
if(col!=0x70)
{
row=2;
break;
}
P2=0x77;
col=P2&0x70;
row=3;
break;
}
if(col==0x60)
return(key[row][0]);
else if(col==0x50)
return(key[row][1]);
else if(col==0x30)
return(key[row][2]);
}
}
Dynamic Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/programmable-load-shedding.html 5/17
9/21/21, 10:11 AM Programmable Load Shedding | Electronicsprojects
RTC
Electronicsprojects#include
<regx52.H>
* This is a blog for elec… search
#include
<absacc.h>
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
#include
"lcd.h"
#include
"rtc1.h"
Automatic Dam … 2
#include
"keypad.h"
SPEAKING MIC… 70
void
rtc_init()
{
Programmable L… 16
XBYTE[10]=0x20;
delay(100);
}
void
time_set()
{
unsigned char
temp[3];
XBYTE[11]=0x83;
LCD_command(0x01);
LCD_string("Enter
the Time : ");
LCD_command(0xC0);
LCD_string("HH:mm:ss");
LCD_command(0xC0);
//Enter hour
temp[0]=key_scan();
LCD_data(temp[0]);
temp[1]=key_scan();
LCD_data(temp[1]);
LCD_string(":");
XBYTE[4]=int_value(temp);
//Enter min
temp[0]=key_scan();
LCD_data(temp[0]);
temp[1]=key_scan();
LCD_data(temp[1]);
LCD_string(":");
XBYTE[2]=int_value(temp);
//Enter sec
temp[0]=key_scan();
LCD_data(temp[0]);
temp[1]=key_scan();
LCD_data(temp[1]);
XBYTE[0]=int_value(temp);
delay(500);
XBYTE[11]=0x03;
}
Dynamic Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/programmable-load-shedding.html 6/17
9/21/21, 10:11 AM Programmable Load Shedding | Electronicsprojects
void
alarm_set()
Electronicsprojects {
* This is a blog for elec… search
unsigned char
temp[3];
XBYTE[11]=0x83;
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
LCD_command(0x01);
Automatic Dam … 2 LCD_string("Enter
the Time : ");
LCD_command(0xC0);
SPEAKING MIC… 70 LCD_string("HH:mm:ss");
LCD_command(0xC0);
Programmable L… 16 //Enter hour
temp[0]=key_scan();
LCD_data(temp[0]);
temp[1]=key_scan();
LCD_data(temp[1]);
LCD_string(":");
XBYTE[5]=int_value(temp);
//Enter min
temp[0]=key_scan();
LCD_data(temp[0]);
temp[1]=key_scan();
LCD_data(temp[1]);
LCD_string(":");
XBYTE[3]=int_value(temp);
//Enter sec
temp[0]=key_scan();
LCD_data(temp[0]);
temp[1]=key_scan();
LCD_data(temp[1]);
XBYTE[1]=int_value(temp);
delay(800);
LCD_command(0x01);
LCD_string("Enter
OFF Time:");
LCD_command(0xC0);
temp[0]=key_scan();
LCD_data(temp[0]);
if(temp[0]=='#')
{XBYTE[11]=0x03;return;}
temp[1]=key_scan();
LCD_data(temp[1]);
XBYTE[14]=int_value(temp);
XBYTE[11]=0x03;
}
void
bcdconv(unsigned var)
{
unsigned char
x,y;
x=var&0x0F;
Dynamic Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/programmable-load-shedding.html 7/17
9/21/21, 10:11 AM Programmable Load Shedding | Electronicsprojects
y=y>>4;
Electronicsprojects
* This is a blog for elec…
y=y|0x30; search
LCD_data(y);
LCD_data(x);
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
}
Automatic Dam … 2
int
int_value(unsigned char var[])
SPEAKING MIC… 70 {
int val;
Programmable L… 16 val=(var[0]<<4)|(var[1]&0x0F);
return(val);
}
MAIN
PROGRAM
#include <regx52.H>
#include <absacc.h>
#include "lcd.h"
#include "rtc1.h"
#include "keypad.h"
int time;
void update();
void relay();
void time_display();
void alarm_display();
int main()
{
int irq;
irq=XBYTE[12];
P3_2=1;
rtc_init();
LCD_init();
while(1)
{
LCD_command(0x01);
time_display();
if(XBYTE[12]&0x20)
relay();
if(P3_2==0)
update();
alarm_display();
delay(7500);
}
}
void update()
{
char n;Dynamic Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/programmable-load-shedding.html 8/17
9/21/21, 10:11 AM Programmable Load Shedding | Electronicsprojects
LCD_command(0x01);
Electronicsprojects
* This is
LCD_string("1. Timea blog
Update"); for elec… search
LCD_command(0xC0);
LCD_string("2.
Classic
Flipcard
Magazine
Mosaic
Sidebar
ALARM Snapshot
UPDATE");Timeslide
n=key_scan();
Automatic Dam … 2 switch(n)
{
SPEAKING MIC… 70 case
'1' : time_set();
break;
Programmable L… 16
case
'2' : alarm_set(); break;
default :
LCD_command(0x01);
LCD_string("Try
Again");
delay(100);
LCD_command(0x01);
}
}
void time_display()
{
unsigned char hr,min,sec;
LCD_command(0x80);
LCD_string("TIME : ");
hr=XBYTE[4];
min=XBYTE[2];
sec=XBYTE[0];
bcdconv(hr);
LCD_string(":");
bcdconv(min);
LCD_string(":");
bcdconv(sec);
}
void alarm_display()
{
LCD_command(0xC0);
LCD_string("PW_OFF: ");
bcdconv(XBYTE[5]);
LCD_string(":");
bcdconv(XBYTE[3]);
LCD_string(":");
bcdconv(XBYTE[1]);
}
void relay()
Electronicsprojects {
* This is a blog for elec… search
int al_hr,al_min,hh,mm,temp;
temp=XBYTE[12];
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
time=XBYTE[14];
Automatic Dam … 2 time=(((time>>4)*10)+(time&0x0F));
P3_1=0;
SPEAKING MIC… 70 hh=XBYTE[5];
mm=XBYTE[3];
Programmable L… 16 hh=(((hh>>4)*10)+(hh&0x0F));
mm=(((mm>>4)*10)+(mm&0x0F));
al_min=time+mm;
al_hr=al_min/60;
al_hr=al_hr+hh;
al_min=al_min%60;
al_hr=al_hr%24;
al_min=(((al_min/10)<<4)|(al_min%10));
al_hr=(((al_hr/10)<<4)|(al_hr%10));
XBYTE[3]=al_min;
XBYTE[5]=al_hr;
LCD_command(0xC0);
LCD_string("PWR_ON: ");
bcdconv(al_hr);
LCD_string(":");
bcdconv(al_min);
LCD_string(":");
bcdconv(XBYTE[1]);
mm=(((mm/10)<<4)|(mm%10));
hh=(((hh/10)<<4)|(hh%10));
while(1)
{
time_display();
if(XBYTE[12]&0x20)
{
P3_1=1;
XBYTE[3]=mm;
XBYTE[5]=hh;
break;
}
}
COMPONENT VIEW
Electronicsprojects
* This is a blog for elec… search
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
Automatic Dam … 2
SPEAKING MIC… 70
Programmable L… 16
[http://4.bp.blogspot.com/-AdU9KPo5BN8/UxS8Co-
ectI/AAAAAAAAAIw/tj6fWTKG2EQ/s1600/component.jpg]
PCB LAYOUT
[http://4.bp.blogspot.com/-
uCHmBuz7oxw/UxS8TUBUpwI/AAAAAAAAAI4/1YmroeiKzho/s1600/pcblayout.jpg]
· Economical
and reliable
Electronicsprojects
* This is a blog for elec… search
· Manpower
dependency is less..
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
Automatic Dam …
BLOCK DIAGRAM EXPLANATION
The various blocks in
the circuit are
SPEAKING MIC… 70
1 Transformer
2 Regulator
Programmable L… 16
3 LCD display
4
Microcontroller
5 RTC
6 Keypad
7 Output relay
MICROCONTROLLER
The AT89S52 is a low-power, high-performance CMOS
8-bit
microcontroller with 8K bytes of in-system programmable Flash memory.
The
device is manufactured using. Atmel’s high-density nonvolatile
memory
technology and is compatible with the industry standard 80C51
instruction set and
pinout. The on-chip Flash allows the program memory
to be reprogrammed
in-system or by a conventional nonvolatile memory
programmer. By combining a
versatile 8-bit CPU with in-system
programmable Flash on a monolithic chip, the
Atmel AT89S52 is a
powerful microcontroller which provides a highly-flexible
and cost-
effective solution to many embedded control applications. The AT89S52
provides the following standard features: 8K bytes of Flash, 256 bytes of
RAM,
32 I/O lines, Watchdog timer, two data pointers, three 16-bit
timer/counters, a
six-vector two-level interrupt architecture, a full duplex
serial port, on-chip
oscillator, and clock circuitry. In additon, the AT89S52
is designed with
static logic for operation down to zero
frequency and
supports two software selectable power saving modes. The Idle
Mode
stops the CPU while allowing the RAM, timer/counters, serial port, and
interrupt
system to continue functioning. The Power-down mode saves the
RAM contents but
freezes the oscillator, disabling all other chip functions
until the next
interrupt or hardware reset.
TRANSFORMER
A transformer is a static electric that transfers
energy by inactive
coupling between its
winding circuits. A varying current in the primary
winding creates a varying
magnetic flux in the transformer’s core and thus
a varying magnetic flux
through the secondary winding. this varying
magnetic flux induces a varying
electromotive force(emf) or
REGULATOR
a regulator is
a system used to maintain a steady voltage. The resistance
of the regulator
varies in accordance with the load resulting in a constant
output voltage. The
regulating device is made to act like a
variable resistor [http://en.wikipedia.org/wiki/Resistor] ,
continuously
adjusting a voltage
divider [http://en.wikipedia.org/wiki/Voltage_divider]
Dynamic Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/programmable-load-shedding.html 12/17
9/21/21, 10:11 AM Programmable Load Shedding | Electronicsprojects
* This is a blog for elec… search
heat. By contrast,
and regulated voltages as
aswitching regulator
[http://en.wikipedia.org/wiki/Switching_regulator] uses an active
device
Classic
Flipcard
Magazine
Mosaic
Sidebar
LCD
LCD
(Liquid Crystal Display) screen is an electronic display module and
find a wide
range of applications. A 16x2 LCD display is very basic
module and is very
commonly used in various devices and circuits. These
modules are preferred
over seven
segments
[http://www.engineersgarage.com/content/seven-segment-display] and
other multi segment LED [http://www.engineersgarage.com/content/led] s.
The reasons being:
LCDs are economical; easily programmable; have no
limitation of displaying
special & even custom
characters
[http://www.engineersgarage.com/microcontroller/8051projects/create-
custom-characters-LCD-AT89C51] (unlike in seven
segments), animations
[http://www.engineersgarage.com/microcontroller/8051projects/display-
custom-animations-LCD-AT89C51] and
so on.
KEY PAD
Dynamic Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/programmable-load-shedding.html 13/17
9/21/21, 10:11 AM Programmable Load Shedding | Electronicsprojects
of this Sidebar
method isSnapshot
Timeslide
that it requires a large number of the
MCU’s I/O pins to
connect the keyboard. For example, to connect a 4×3 keyboard
requires
Automatic Dam … 2 seven digital I/O pins.It scans row and coloumn to know what is the
input.
SPEAKING MIC… 70
RELAY OUTPUT
16
Relay is used to obtain
the output. From the output of the relay, the
Programmable L…
control goes to the main power
supply. The whole system acts as an
automatic switch.
CIRCUIT OPERATION
The programmable load
shedding time management for utility department
circuit consists of an 8592
microcontroller ic,16*2 LCD module,7805
voltage regulator ic,4*3 keypad
,DS12887 RTC IC,relay,aCrystal
oscillator.
The 7805 voltage
regulator converts the input voltage to 5V and is given
to the Vcc (pin :40) of
the 8952 microcontroller.This voltage is necessary
to enable the
microcontroller .A DS12887 RTC interfaces with port0 of
the microcontroller
ie,from pins 32 to 39.The rtc shows the real time at
every instant. Once the
RTC is programmed ,it will work continuously
even though the power goes
off in between.The keypad is interfaced
with
port2 of the microcontroller ie from
pins21 to28.The keypad is used to
set the real time,,the time for load
shedding time and the time
duration.The 16*2 LCD is interfaced to port1of the
microcontroller ie
from pins 1 to 8.The crystal oscillator helps to provide the
working
frequency 11.059MHz for the microcontroller.
The microcontroller
programmed in such a way that we can set the actual
time and load shedding
time.Using the program we can monitor both real
time and load shedding time.
Program always check the equality and
whenever it get matched output relay turn
off.Then it began to check
equality with target time and real time,whenever it get matched relay
turns on.
Classic
Flipcard
Magazine
Mosaic
· Accuracy
Sidebar
inSnapshot
time Timeslide
· Effective distribution
of power
Automatic Dam … 2
· We can set the time in
advance
SPEAKING MIC… 70
Programmable L… 16
Posted 3rd March 2014 by Anonymous
16
View comments
Replies
Reply
Reply
Electronicsprojects
* This is a blog for elec…
Replies
search
Reply
SPEAKING MIC… 70
Programmable L… 16
Anonymous 5 November 2017 at 01:31
pls fuldocument of speaking microcontrolor for deaf and dump
[email protected]
Reply
[email protected]
Reply
Reply
Electronicsprojects
* Reply
This is a blog for elec… search
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Anonymous Timeslide
31 March 2021 at 18:04
please send the full report with circuit diagram on mail id-
Automatic Dam … 2 [email protected]
Reply
SPEAKING MIC… 70
Comment as:
DK (Google)
Sign out
Publish
Notify me
Preview