How to Build a Simple Motion-Activated LED Night Light with an Arduino for Under $15

I decided to build a simple motion-activated LED night light using an Arduino board to turn the lights on automatically when I walk into a room. This project was inexpensive to put together and works great for lighting up hallways or other spaces as needed. Here is a step-by-step guide on how I built it for under $15.

Shopping List

Here are the components I used:

Circuit Assembly

Connect the PIR Motion Sensor

The PIR motion sensor has three pins - ground, signal, and power. I connected the ground pin to the Arduino's GND pin, the signal pin to Arduino pin 2, and the power pin to 5V. This supplies power to the sensor while allowing it to communicate motion detection to the Arduino on pin 2.

Connect the LED Strip

The LED strip has four pins - ground, data in, clock, and power. I connected ground to GND, data in to Arduino pin 6, clock to Arduino pin 7, and the power pins directly to the positive and negative terminals on the DC barrel jack. This allows the Arduino to control the LEDs.

Supply Power

I connected a 9V DC power adapter to the DC barrel jack adapter and plugged that into the Arduino's power pins to supply power to the whole circuit. Make sure the power adapter can provide enough current for all your LEDs.

Upload the Arduino Sketch

With all the hardware connected, I uploaded a simple Arduino sketch to make the magic happen. The sketch monitors the PIR sensor pin and turns the LED strip on when motion is detected. The LEDs fade out after 30 seconds.

Mounting Options

I mounted all the components inside a cardboard box, but you can also mount the Arduino, breadboard, and DC jack to a back panel or inside an enclosure. For the PIR sensor and LEDs, I used double-sided tape to adhere them in place. Make sure no wires will get pinched or crimped when closing the box.

Installation Tips

Position the PIR sensor so it has a good view of the area you want to detect motion in. Try to aim it away from windows and objects that might blow around and set it off.

For the LED strip, you can carefully peel off the adhesive backing and stick it under cabinets, shelves, or anywhere you want illumination. I installed mine behind a cabinet to shine down on the counter.

Use cable clips and staples to neatly route any visible wires. Make sure wires going into the box through holes or cracks are protected from snagging.

Usage and Customization

The LEDs will now automatically turn on when the PIR sensor detects movement! I have mine set up to turn on when I walk into the kitchen at night.

Some ways you can customize this project include:

Let me know if you build your own motion-activated night light! I'm happy to help if you need any guidance with the DIY electronics and programming. Have fun and stay safe.