Block Diagram:
Fig. 1: Overview of Automatic Light System for Home
Circuit Component Description
Fig. 2: Typical Image of Light Dependant Resistor
Block Diagram Explanation of each LDR working
Fig. 3: Block Diagram representing working principle of LDR with Microcontroller
Fig. 4: Block Diagram representing Microcontroller response to signals from LDR circuit
Sensor Working
As properties are already stated
Case 1
Case 2
Like this one:
Fig. 5: Typical Image of IR Transmitter and Receiver
8051 Microcontroller Features
Fig. 6: Block Diagram of 8051 Microcontroller
Fnd: There are two types in it:
Final Image with all the Circuit Components
Fig. 7: Image showing circuit for detecting entrance or exit of a visitor in action
Detection of Whether Person is Entering the Room or Person is Leaving the Room
Case 1:
When person enters the room- as the person enters the room first sensor1 is interrupted and then the sensor 2
The decoding of these two signals take place as follows: if a first low is sensed due to sensor-1 then, the second low sensed by microcontroller due to sensor-2 will indicate that person is coming inside the room and hence counter will increment by one and the bulb will be switched on.
Case 2:
When person exits the room – he will interrupt the sensor2 and then will interrupt the sensor-1.
Software and Project Overview
Software Overview
Fig. 8: Flowchart of C Code used for Visitor Detection and Automatic Switching of lights
Other Features that can be Included
Project Overview
Fig. 9: Overview of working algorithm of Automatic Light System
You may also like:
Project Source Code
###
CODE:IT IS WRITTEN IN ASM LANGUAGE:org 0000hljmp mainorg 0100hmain:mov p0,#00h //make p0 as o/p port BULB IS CONNECTED HEREmov p3,#0ffh //make p3 as i/p port LDR SENSORS ARE CONNECTED HEREmov p2,#00h //make p2 as o/p port FND IS CONNECTED HEREmov r0,#00hmov p2,#0ffhup:lcall delaylcall delaylcall delaylcall delaylcall delaylcall delayf2:jb p3.0,f1 // CONTINUOUSLY CHECK FOR A LOW ON SENSOR-1 AND SENSOR-2 ALTERNATELYlcall delay //lcall delay // DELAY TO CAPTURE THAT EVENT PROPERLYlcall 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 ROOMlcall delaylcall delaylcall delaylcall delaylcall delayinc r0setb p0.0lcall delaylcall delaylcall delaysjmp fnd1 //DISPLAY THE INCREMENTED VALUE ON FNDlcall delaylcall delaylcall delaylcall delaylcall delaylcall delayf1:jb p3.2,f2 //CONTINUOUSLY CHECK FOR A LOW ON SENSOR-1 AND SENSOR-2 ALTERNATELYlcall delay //lcall delay // DELAY TO CAPTURE THE EVENTlcall 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 delaylcall delaylcall delaylcall delaylcall delaydec r0lcall delaylcall delaylcall delaylcall delaylcall delaylcall delayljmp fnd2 //DISPLAY THE DECREMENTED COUNTc2:cjne r0,#00h,j1clr p0.0ljmp upj1:ljmp upfnd1:cjne r0,#01h,a1mov p2,#0f9hljmp upa1:cjne r0,#02h,a2mov p2,#0a4hljmp upa2:cjne r0,#03h,a3mov p2,#0b0hljmp upa3:cjne r0,#04h,a4mov p2,#19hljmp upa4:cjne r0,#05h,a5mov p2,#92hljmp upa5:cjne r0,#06h,a6mov p2,#82hljmp upa6:cjne r0,#07h,a7mov p2,#0f8hljmp upa7:cjne r0,#08h,a8mov p2,#00hljmp upa8:cjne r0,#09h,a9mov p2,#10ha9:ljmp upfnd2:cjne r0,#00h,ac1mov p2,#0ffhljmp c2ac1:cjne r0,#01h,b1mov p2,#0f9hljmp c2b1:cjne r0,#02h,b2mov p2,#0a4hljmp c2b2:cjne r0,#03h,b3mov p2,#0b0hljmp c2b3:cjne r0,#04h,b4mov p2,#19hljmp c2b4:cjne r0,#05h,b5mov p2,#92hljmp c2b5:cjne r0,#06h,b6mov p2,#82hljmp c2b6:cjne r0,#07h,b7mov p2,#0f8hljmp c2b7:cjne r0,#08h,b8mov p2,#00hljmp c2b8:cjne r0,#09h,b9mov p2,#10hljmp c2b9:ljmp c2delay:mov r2,#128up1:mov r1,#0ffhhere:djnz r1,heredjnz r2,up1retend
###
Circuit Diagrams
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.