Introduction: Arduino Motion Detection Light

PLEASE VOTE! ME IF YOU LIKE IT

Hi, this is my new Arduino motion detection light. It is powered by a 9v supply for the Arduino and 5v for the light. A PIR works by detecting the heat energy in the surrounding environment. If a man or an animal passes across the sensor, the Arduino will trigger the relay(as the light turns on). If there is no detection, then the relay stops (as the light turns off). You can also attach it to walls with the hanging tie. This project saves your time as well as your electricity bill. You can either attach it to your bathroom (obviously not bare open like this) or in your bedroom.

Step 1: MATERIALS YOU NEED:

1. A wooden sheet

2. A bulb (0.5watts or 7watts)

3. A bulb holder

4. Arduino board

5. A 5v relay

6. A 9V adapter

7. A motion sensor (PIR)

8. Jumper cables and 2-meter double wire(twisted)

9. Some screws(which will go through the Arduino and relay holes)

Step 2: Connect the PIR Sensor to the Arduino

1. Connect the VCC pin to the 3.3v.

2. Connect the GND pin to the ground.

3. Connect the OUT pin to the digital pin 4.

Step 3: Connect the 5v Relay to the Arduino

1. Connect the GND pin to the ground.

2. Connect the IN1 pin to the digital pin 8.

3. Connect the VCC pin to the 5v.

Step 4: Connect the Bulb

Connect the -ve end of the current to the NC slot.
Connect the -ve end of the bulb to the NO slot.
Now connect the positive of the bulb to the positive of the current.

Step 5: Code:

copy and paste to the IDE.

int irmotionPin = 4; // Pin of IR Motion Sensor

int relayPin = 8; // Pin of Relay Module

void setup(){ Serial.begin(9600);

pinMode(relayPin, OUTPUT);

// Set Pin connected to Relay as an OUTPUT

digitalWrite(relayPin, LOW);

// Set Pin to LOW to turn Relay OFF }

void loop(){

while (digitalRead(irmotionPin) == HIGH)

{ // If Motion detected

digitalWrite(relayPin, HIGH);

// Turn Relay ON

Serial.println("Relay is ON");

delay(15000);}

digitalWrite(relayPin, LOW);

// Turn Relay OFF Serial.println("Relay is OFF");

delay(500); }

Step 6: WARNING!!!

Please take safety measures while making this project because you're going to handle HIGH VOLTAGE and you might get shocked or fried. Always double-check that everything is connected properly and correctly. Make sure there is no loose connection before turning it ON. After following these, you can now turn it on.

If It doesn't work, please let me know in the comment section so that I can solve it.

Step 7: Attach Everything to the Wooden Sheet With the Screws.

Step 8: You Are Done.

Arduino Contest 2016

Participated in the
Arduino Contest 2016