Introduction: Motion Activated Light Switch With Light Sensor
Motion activated light switch have many application both in home and in office. This , however , have added advantage of incorporating a light sensor , so that , this light can only triggered at Night time.
Step 1: Components Required
This project is based on PIR sensor activation . We used very basic , readily available, electronic components .
1. Arduino Nano ( You can use Uno or other version)
2. PIR Sensor
3. LDR Sensor ( with built in D/O )
4. 5V Relay ( I use dual channel , however Single Channel is sufficient)
5. Components for Power Supply : (a) 230V/ 6V Transformer
(b) Bridge Rectifier
(c) Capacitor : 1000 Mfd , 100 Mfd and 0.1 Mfd
(d) Power IC : 7805
6. Misc : Vero Board , Wires , Connector .
Step 2: Connection
Power supply is a standard design using Bridge Rectifier / Capacitor and 7805 IC , which gives a stable 5V DC supply for the project . It is constructed on a Vero Board. A 20x2 Pin female header is soldered to accept Arduino Nano , on the vero board. This plug-in will help in easy removal of Arduino.
Two nos of 230V AC grade sockets are fixed on the Board and Mains wiring is done as follows :
(a) Both Phase and neutral ( In picture Red & Black) are connected from Input socket to HV side of step down transformer .
(b) Also neutral wire is directly connected from input socket to output socket and phase wire is connected via NO and Common terminal of Relay panel.
(c) Input socket will be connected to 230V AC Mains supply and output will be connected to AC Load .
#Caution : Great care to be taken in wiring Mains supply . Once connected with Mains , box must be closed before use.
Connecting Arduino and Sensors :
PIR Sensor Output : Arduino Pin 7
LDR Sensor Output : Arduino Pin 4
Relay Input : Arduino Pin 6
A common power rail of 5V DC is created in Vero Board , which supply to all senors , Arduino and Relay board. One point to be remember that Relay input is Active Low and programme is modified accordingly.
Step 3: Programme and Software
The programme is very standard and straightforward one .
1. Initialize PIR Sensor .
2. Declaring I/O and variables .
3. Accept PIR Input and if any motion is detected and its dark outside ( Light sensor D/O will supply data) , Relay will be activated .
4. It will wait for 1 Min and if motion is continued detected , Relay will remain ON , else it will be de-activated , thus Switch OFF the load . You can change this time in " Pause" variable.
5. If its Sunny outside , relay will not be activated even if a motion is detected.
Step 4: Fixing the Project in a Box
This project is housed in a standard 8 Inch x 6 Inch PVC Electrical Switch Board . All the components are fixed inside box . As said earlier , two nos of AC 230V Mains sockets are connected as shown . PIR sensor is recessed outside through a 25mm circular cutout. Also , the LDR of light sensor similarly recessed outside.
You can mount the entire Box as per your requirement .
Step 5: Your Comments
I hope that you are enjoying my project and hope that you will give your valuable feedback . I will be happy to help you if your faces any difficulties during making of the project.