Motion Activated Light Switch With Light Sensor

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.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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.

Be the First to Share


    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest
    • Fix It Contest

      Fix It Contest

    2 Discussions


    1 year ago on Step 5

    A wiring diagram would definitely help.

    I think the normal movement sensors can be set up to retrigger or not . You have not touched on that?


    Reply 1 year ago

    I will upload the wiring diagram in a few days. The movement sensor may be of various types depending on how it senses. I used a Passive Infrared Sensor (PIR) is its default mode i.e. in retriggered mode. You can use other types like Ultrasonic Sensor , but that would be a compeletly different project.