DIY Motion Activated Lights - Galileo

by emccuen in Circuits > Sensors

4008 Views, 13 Favorites, 0 Comments

DIY Motion Activated Lights - Galileo

IMG_6973.JPG

This project uses a passive infrared sensor as a motion sensor to turn on a light bulb.

Collect Supplies

02760347_grande.jpeg
20160414_162050.jpg

Collect a passive infrared (PIR) sensor like shown in the picture. You will also need a Galileo, a screwdriver, a relay, bulb socket and a light bulb. Wires are needed to connect the sensors. The final product is pictured here with all the tools you will need.

BE CAREFUL WORKING WITH HIGH VOLTAGES!

Connect PIR Sensor to Galileo

IMG_6975.JPG
20160414_153943.jpg

Connect the Ground cable from the PIR sensor to ground on the Galileo, VCC to 3.3 pin on the Galileo, and connect output to digital pin 0 on the Galileo.

Connect the Relay to the Galileo

20160414_154035.jpg
20160414_154240.jpg

Connect three wires to the relay VCC, ground and In. The VCC wire connects to the 5V pin on the Galileo, the ground wire connects to ground on the Galileo and the IN wire connects to digital Pin 7 on the Galileo.

Connect Bulb Socket to Power Cord

20160414_154656.jpg
20160414_154749.jpg

We used a power cord with open end. One of these ends is connected to the middle wire from the bulb socket (black wire for us). The two remaining free wires (white one from the bulb socket and one from the power cord) will be connected to the relay.

Connect Remaining Wires to the Relay

20160414_155142.jpg

The open wire from the power cord gets connected to the relay COM pin on the Relay. The wire from the bulb socket is placed in the NO (for normally open) pin on the relay. Tighten the screws on the relay to keep wires in place.

Screw in Lightbulb

20160414_155211.jpg

Place the bulb in the socket. Now the whole system is assembled! Plug in all the necessary wires, power to the Galileo, USB connection from the Galileo to the computer. Once you are totally ready and sure your circuit is correct: connect the power cord to the wall. BE CAREFUL WITH HIGH VOLTAGES!

Upload the Code

You are now ready to upload the code! Attached here.

Downloads