Want to know why your monthly Electricity bills are "so high"? Take a closer look at the Lights or Fans, when a person inside the room leaves the room hastily, He or She unknowingly leaves the Lights switched on.
So, what next? The only way for this is Intelligent Automated Home Lighting System. In this system when a person enters the room the tube lights are switched on automatically. The light switches go off automatically when there is no body inside the room. The whole Intelligent Automated Home Lighting System is now at the tip of your motion. As one moves inside the room the bulb switches on and as one leaves the room it switches off.
Here we have used 8051 micro-controller along with two sensors. They are IR Sensors or LED light falling on the LDR to act together as sensors to detect the motion inside the room and microcontroller acts as a person counter and increments or decrements depending upon the number of people inside the room. If there is no body inside the room then the Bulbs, Tube lights Fans etc switch off automatically on the exit of the last person who was inside the room.
Block Diagram:
Circuit Component Description
Before explaining the working let's find out what are LDR Sensors:
· When the light level is less intense, resistance of the LDR is high
· But, when light shines onto the LDR, resistance falls
Block Diagram Explanation of each LDR working
Sensor Working
As properties are already stated
Case 1
When nobody interrupts the light falling on LDR:
The resistance of LDR is low and hence the base of the transistor does not get sufficient voltage to turn on the transistor and hence the collector voltage is almost equal to supply voltage that is 5V in this case.
Case 2
When a person interrupts the light falling on LDR:
The resistance of LDR is high and hence transistor switches on and the collector voltage almost becomes equal to zero voltage.
These different collector voltages are picked by the microcontroller pins and decides whether the person is going into the room or out of the room.
LDR sensor is just used for experimental purpose in reality photo-transistor like the IR Sensors should be used because of good sensitivity.
Like this one:
Code:
CODE:IT IS WRITTEN IN ASM LANGUAGE:
org 0000h
ljmp main
org 0100h
main:mov p0,#00h //make p0 as o/p port BULB IS CONNECTED HERE
mov p3,#0ffh //make p3 as i/p port LDR SENSORS ARE CONNECTED HERE
mov p2,#00h //make p2 as o/p port FND IS CONNECTED HERE
mov r0,#00h
mov p2,#0ffh
up:
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
f2:jb p3.0,f1 // CONTINUOUSLY CHECK FOR A LOW ON SENSOR-1 AND SENSOR-2 ALTERNATELY
lcall delay //
lcall delay // DELAY TO CAPTURE THAT EVENT PROPERLY
lcall delay //
lcall delay //
lcall delay //
k2:jb p3.2,k2 //AFTER LOW OCCURRED AT SENSOR-1 THEN CHECK FOR SENSOR-2 WHETHER THE PERSON IS REALLY ENTERING THE ROOM
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
inc r0
setb p0.0
lcall delay
lcall delay
lcall delay
sjmp fnd1 //DISPLAY THE INCREMENTED VALUE ON FND
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
f1:jb p3.2,f2 //CONTINUOUSLY CHECK FOR A LOW ON SENSOR-1 AND SENSOR-2 ALTERNATELY
lcall delay //
lcall delay // DELAY TO CAPTURE THE EVENT
lcall delay //
lcall delay //
lcall delay //
k1:jb p3.0,k1 //AFTER LOW OCCURRED AT SENSOR-2 THEN CHECK FOR SENSOR-1 WHETHER THE PERSON IS REALLY EXITING THE ROOM.
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
dec r0
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
ljmp fnd2 //DISPLAY THE DECREMENTED COUNT
c2:
cjne r0,#00h,j1
clr p0.0
ljmp up
j1:ljmp up
fnd1:
cjne r0,#01h,a1
mov p2,#0f9h
ljmp up
a1:cjne r0,#02h,a2
mov p2,#0a4h
ljmp up
a2:cjne r0,#03h,a3
mov p2,#0b0h
ljmp up
a3:cjne r0,#04h,a4
mov p2,#19h
ljmp up
a4:cjne r0,#05h,a5
mov p2,#92h
ljmp up
a5:cjne r0,#06h,a6
mov p2,#82h
ljmp up
a6:cjne r0,#07h,a7
mov p2,#0f8h
ljmp up
a7:cjne r0,#08h,a8
mov p2,#00h
ljmp up
a8:cjne r0,#09h,a9
mov p2,#10h
a9:ljmp up
fnd2:
cjne r0,#00h,ac1
mov p2,#0ffh
ljmp c2
ac1:cjne r0,#01h,b1
mov p2,#0f9h
ljmp c2
b1:cjne r0,#02h,b2
mov p2,#0a4h
ljmp c2
b2:cjne r0,#03h,b3
mov p2,#0b0h
ljmp c2
b3:cjne r0,#04h,b4
mov p2,#19h
ljmp c2
b4:cjne r0,#05h,b5
mov p2,#92h
ljmp c2
b5:cjne r0,#06h,b6
mov p2,#82h
ljmp c2
b6:cjne r0,#07h,b7
mov p2,#0f8h
ljmp c2
b7:cjne r0,#08h,b8
mov p2,#00h
ljmp c2
b8:cjne r0,#09h,b9
mov p2,#10h
ljmp c2
b9:ljmp c2
delay:mov r2,#128
up1:mov r1,#0ffh
here:djnz r1,here
djnz r2,up1
ret
end
No comments:
Post a Comment