Introduction

Having a motion-activated night light can be extremely convenient and helpful around the house. Not only does it provide illumination when needed, but it also helps conserve energy by only turning on when motion is detected. The best part is that with just a few simple components, you can build your own DIY motion-activated night light for under $15!

In this comprehensive guide, I'll walk you through everything you need to know to build your own motion-activated night light on a budget.

What You'll Need

The great thing about this project is that it requires just a few inexpensive components that are readily available. Here's what you'll need:

Hardware

Tools

Circuit Design

Here is a simple diagram showing how to connect all the components:

The Arduino acts as the brains, taking input from the PIR sensor and controlling the LED light strip accordingly.

The PIR sensor has 3 pins:

The LED strip light also has 3 pins:

That's all there is to the wiring!

Code

Of course, for this project you'll need to upload a sketch to the Arduino to allow it to detect motion and control the light.

Here is the full code:

```cpp
int pirPin = 2; //PIR Out pin connected to pin 2
int ledPin = 9; //LED Strip pin connected to pin 9

void setup() {

pinMode(pirPin, INPUT); //Set pirPin as an input
pinMode(ledPin, OUTPUT); //Set ledPin as an output

}

void loop(){

if(digitalRead(pirPin) == HIGH){ //If motion is detected

 digitalWrite(ledPin, HIGH); //Turn on the LED Strip

}
else{

 digitalWrite(ledPin, LOW); //Turn off the LED Strip

}

}
```

This code continuously checks for motion on the PIR sensor. When motion is detected, it sends HIGH to the LED strip to turn on. When no motion is detected, it sends LOW to turn the LED strip off.

Construction

For the physical construction:

  1. Mount the Arduino, PIR sensor, and breadboard inside an enclosure, like a small project box. Hot glue works well for securing them in place.

  2. Drill a hole in the enclosure for routing the PIR sensor wires through. This allows the sensor to detect outside motion while protected inside the box.

  3. Cut and solder connections between the Arduino, PIR sensor, and LED light strip according to the circuit diagram. Use jumper wires to make these connections.

  4. Hot glue the LED strip light along the bottom of the enclosure and route the wire through a small hole.

  5. Close up the enclosure and power it up! Make sure everything is working by waving your hand in front of the PIR sensor.

And that's it - you now have a motion-activated LED night light for under $15! You can customize it by using different colored LED strips, placing it in different locations, and adjusting the sensitivity and timing in the code.

Usage Tips

Here are some tips for getting the most out of your DIY motion-activated night light:

Conclusion

Building your own motion-activated night light is an easy Arduino project that anyone can tackle in an afternoon. With just a few common components, you can create a fully customized and functional night light for under $15.

Not only is this project affordable, but it's also an excellent way to learn Arduino programming and practice your soldering skills. So grab your parts and tools, follow the instructions, and enjoy your new DIY motion-activated night light! Let me know in the comments if you build one.