DIY: Outdoor Motion Light

By Ryan Winters

Assembly Time: 2 hours
Skill Level: Intermediate

When my managers asked me to replace the security light outside Jameco headquarters, I saw an opportunity beyond the confines of the building courtyard – this would be a great project to share with customers! My objectives for the outdoor light project posed a few technical challenges. It had to withstand extreme weather variations, only come on at night, and only be triggered by motion. This sounded like a job for Arduino.

Motion LightOutdoor Motion Light

I discovered a 10 watt LED floodlight that put out a tremendous amount of light for its power! It comes in two flavors: 12VDC and 120VAC. The supply voltage for the existing light was 120VAC, but since I needed 5VDC for the brains, I opted for a dual output (12V & 5V) AC/DC power supply. The floodlight would use the 12VDC and the Arduino would use the 5V supply. I could have used a single output 12VDC supply, but then I'd need a regulator to supply the circuit with 5V. I worried there may not be enough airflow to cool the regulator if this light circuit was going to be energized 24 hours a day, so I chose the dual-output supply. I put in a request for some parts and began my prototype on a breadboard.

Required Components and Tools:

Part Description Mfr. Part No.
LED Floodlight, 10 watt, 900 lum, IP68 LLB-355C-01-10
Ardweeny, MCU, Arduino-compatible KARDW
Relay module, Arduino-compatible, 150VAC/24VDC max DFR0017
PIR sensor, passive infrared UT5HW3-4D-URC3-4861-R
Photocell, 100mW, 3kΩ light, 200kΩ dark CDS001-8001
LED cable interconnect, 12" wires CNXCE2112
Sensor/servo cable, 3-wire, F/F, 12", Black/Red/White 800-00120
Resistor, 10kΩ, 1/4 watt, 5% CF1/4W103JRC
Prototype builder circuit board, 1.6" x 2.7" G/S(PCB228)-R
ABS plastic enclosure, 3.125" x 2" x 0.875" H2855-R
Dual output power supply, 32W, [email protected], [email protected] RD-35A
Pin header, 10-position, vertical (to be cut for sensor header) 7000-1X10SG-R
20AWG stranded hook-up wire, 10' 820-2-10FT

Soldering iron and solder
Wire strippers
Angle cutters

The breadboard prototype was ready for action in less than 10 minutes. As a proof of concept and to keep from having to hook up the power supply and floodlight just yet, I used an LED I had lying around to stand in for the floodlight.

Coding the Arduino was a snap too. Since I only had two conditions to test and both had to be true for the light to turn on, the code used just one IF statement. I used the serial monitor to read the values of the photocell so I could determine the approximate darkness where the light would turn on. In bright conditions, the photocell returned values in the 900 range, but when it was completely covered, it returned values around 100 or less. 100 would be my threshold for ambient light. The PIR sensor only returned high and low, or 1 and 0. Using the serial monitor was useful for seeing how the sensors reacted to conditions and for recording values to set as trigger points in the code.

I actually built the Arduino circuit using the barebones kit, and after showing it to a couple people, one of them asked me why I didn't use the Ardweeny, as it would take up less space. It would also be a lot easier to incorporate into the project rather than soldering a bunch of jumper wires. Since it was already built, I included the schematic using the Ardweeny as well. The same code could be used for both since they both use the ATmega328P with the UNO bootloader. See the breadboard prototype and relay connected below.

Breadboard PrototypeBreadboard Prototype
Connected RelayConnected Relay

When the Arduino/Ardweeny circuit was complete and the headers were installed, I made a single hole in the plastic enclosure to feed wires through. A 3/8" drill made a perfect-sized hole. The plastic enclosure housed the PCB, the relay, a few wires that connected the light to the relay and a couple wires for the power connection.

I installed the floodlight as is because it already had a mounting bracket attached. I considered retrofitting the existing light enclosure, but the box was ugly and the plastic lens was discolored from years of UV exposure. I decided to make a custom cover out of wood to cover the existing hole in the exterior soffit. I set the power supply and circuit box in the attic space; the wood cover held the light relatively flush and allowed for holes so the sensors could "see".

There is plenty of room to add additional sensor headers if upgrades to the light are desired. One of my co-workers, playing devil's advocate, suggested that someone could fool the light by shining a flashlight at it. To counter, I suggested using a RTC (real time clock) module so the Arduino would know exactly what time it is and when it should go on.

With the exception of soldering the custom Arduino circuit, the project was simple. Using the Ardweeny made for a simpler design and installation. Given the lifetime of the LED floodlight (50,000 hrs), if it is on 24/7, it should last over five years. Thanks to the use of sensors and logic, the light will probably outlast all the other components. The light outside my building might even last until I walk past it for the last time when I finally retire from Jameco!

Ryan Winters is a Bay Area, California native. He is mostly self-taught and his hobbies include working on cars and computers, fiddling with electronic gadgets and experimenting with robotics.