DIY Arduino Motion Sensor Lighting Control

 by sspence
PIR.jpg
From the minds at http://arduinotronics.blogspot.com/

We wanted to save energy, and create convenience, by adding motion sensors to our lighting circuits. When I walk into a room, the lights come on automatically, and when I leave, shut off after a short period of time. You can choose how long that time delay is in the code. No more fumbling for a light switch in the dark with my arms full of groceries!

I also wanted a override switch for times I want the light to stay on, or off.

So, I took an Arduino, added a PIR sensor, a SSR, a SPDT switch,  two 10k ohm resistors and whipped up a small sketch to glue it all together. Enjoy!

Original article, and more at http://arduinotronics.blogspot.com/2013/01/motion-sensors-ssrs.html

Multiple motion sensors, and multiple SSR's can be serviced by a single Arduino. A embedded Atmel chip can be built into the project instead of dedicating a complete Arduino board.
 
Remove these adsRemove these ads by Signing Up

Step 1: The PIR Sensor

PIR.jpg
The first step was connecting a PIR sensor. A PIR detects "motion" by recognizing an increase in Infra Red emission in the focus area, put out by the human body.

For background info on PIR, see http://en.wikipedia.org/wiki/Passive_infrared_sensor

We obtained our PIR Sensor from Amazon.

Connect the 3 pins of the PIR to +5vdc, Arduino Pin 2 (data out), and Ground.
angpal59 says: Feb 27, 2013. 10:47 PM
(removed by author or community request)
sspence (author) in reply to angpal59Feb 28, 2013. 3:58 AM
I'd have to see your code.
angpal59 in reply to angpal59Feb 27, 2013. 11:17 PM
never mind, I just did it a different way
sspence (author) in reply to angpal59Feb 28, 2013. 3:59 AM
want to share?
angpal59 in reply to sspenceFeb 28, 2013. 3:20 PM
How do you do that? I am new to this even thoufg I've been a member I've never shared
sspence (author) in reply to angpal59Feb 28, 2013. 5:27 PM
Just paste your sketch, or email me at solar@essnmag.com
angpal59 in reply to angpal59Feb 27, 2013. 11:06 PM
I keep getting " a function-definition is not allowed here before '{'token
sketch_feb28b.ino; In function 'void loop()':
sspence (author) in reply to angpal59Feb 28, 2013. 3:58 AM
Please post code.
vectorges says: Jan 21, 2013. 3:59 AM
I think the section of Step 5 dealing with the "AC from wall" needs some clarification. AC has load and ground I think you are running load to pin 1 and ground to the lamp, but it isn't clear from the schematic. Otherwise it is great. I love the idea of the override switches.
sspence (author) in reply to vectorgesJan 21, 2013. 6:21 AM
AC has Hot, Neutral, and Ground. We are breaking the HOT Line and inserting the SSR into the Hot Line (Series). Neutral continues to the appliance unbroken. We are not breaking the ground line (if it exists).
sspence (author) in reply to sspenceJan 22, 2013. 11:01 AM
I updated the schematic, labeling the Hot and Neutral lines.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!