Lighting is one of the most important aspects of your home or business. But turning the lights on and off all the time is a hassle, not to mention the energy wasted when you, inevitably, forget to turn them off for the night. That's why motion activated lighting is the most efficient, convenient, and safe option for your building. Build your own exterior lighting system, and code it with Arduino to turn on or off when appropriate.
Experience Level: Intermediate Time Required: 2 Hours
This project requires understanding of how to read a circuit schematic. The Ardweeny has its own included instructions and will need to be assembled first before it is installed onto the protoboard. The circuit board and relay will be housed in an ABS plastic enclosure, so the presentation on the protoboard is not important. 10 feet of stranded hook-up wire is included for making short connections from the relay to the board or supply to relay, etc. The color of the wire is not indicative of the polarity or signal transmitted or supplied.
Find all the parts for the kit and more at Jameco Electronics
Credit to Ryan Winters, Product Marketing Manager at Jameco
Step 1: Materials and Tools
- Wire strippers
- Angle cutters
- Silicone (optional)
- Solder and soldering iron
1 x Photocell, 100mW, 3k-200k Ω
1 x LED cable interconnect
1 x Power Supply, dual output, 12V/5V
1 x Header, vertical, 1 row, 10 position
1 x Case, ABS plastic, 3.125" x 2" x 0.875"
1 x Prototype board
1 x PIR motion sensor
1 x Ardweeny MCU kit
1 x Relay module, Arduino-compatible
10 x 1/4 watt resistors, 10k Ω
1 x 10 watt LED Floodlight, 12VDC
1 x Stranded 20AWG hook-up wire, 10'
1 x Servo extension cable, 3-wire, 12"
Step 2: Ardweeny
Assemble the Ardweeny by following the included instructions.
Step 3: Breadboarding
Mount the Ardweeny on the protoboard near one side of the board. Be sure none of the pins are in the common bussed strips of the protoboard if there are any. For the sensor headers, you will need to break the single row header into the appropriate pin count. You will need two 3-position headers (one for the relay and the other for the PIR sensor) and one 2-position header, for connecting the photocell cable. See the schematic for the Ardweeny and barebones Arduino circuit at the end of this document. Note: The schematic shows a power good LED that is not included and it is not critical to the circuit. It is just included in the schematic for reference and testing if you need to troubleshoot.
You will need to make wire or solder jumper connections from the Ardweeny to the pin headers for the sensors. You will also need a location on the board for the incoming 5V power and ground connections.
Step 4: Electronics Enclosure
The supplied enclosure is to house the circuit board and the relay module. A 3'8" hole should be sufficient to pass the four stranded wire connections, the two sensor cables, and the main power cable for the floodlight. However you install the components, make sure you have easy access to the programming header in case you want to modify the code. Permanently fixing the protoboard inside isn't really necessary, and not doing so leaves the mounting hole of the protoboard free to be used as a strain relief for the incoming power and ground wires.
Step 5: Relay and Photocell
The photocell is a board level component which is why the LED connector cable is supplied. Trim the leads of the photocell so when installed in the LED holder cable, it sits flush. The other end of the connector cable will connect to the 2-position header in the circuit board. Below is the wiring diagram for hooking up a light to the relay. The wires of the floodlight should already be stripped and tinned. You may shorten the main cable if desired. Please be extremely careful when working with 120 VAC. Make sure appliances and power supplies are disconnected when tinkering with power lines. The DFRobot tutorial is helpful for making relay connections.
Step 6: Final Installation
The floodlight is already in a waterproof, metal-bracketed enclosure and can be installed as is. You may opt for a more custom solution by retrofitting an existing light housing or by making your own. The cover allows the light to sit nearly flush and also secures the sensors and allows them to "see". The dimensions on the template are approximate and should be verified before making cuts or holes. The floodlight should be test fitted so you can mark the position of the screw holes and have proper alignment. Some chiseling may be necessary to allow the PIR sensor to sit more securely and allow the dome of the sensor to protrude from the plywood surface.
Step 7: The Coding
Your will need a USB to Serial TTL programmer to upload code to the Ardweeny/Arduino. There is a zip archive containing the Arduino code. One bit is for testing and verifying the sensors. The other is finished code for a functioning light. Using the test code is necessary for determining what level of darkness to react to. The default in the final code is "100", but yours may need some tweaking depending on your environment. The code is commented to assist with making changes to variables such as delay time and how long the light stays on when triggered.