Introduction: Motion Sensor Activated LED Strip With Timer
Hi everyone! I'm really happy to be writing another instructable right now. This project came to be when I was contacted by a fellow instructable-er(?!) (David @dducic) several months ago asking for some design help.
So here was the original spec: "I could really use some help with an under-bed lighting I'm making for my elderly parents. In a nutshell, I want to use two PIR sensors and two LED strip lights--one set for each side of the bed--that turn on when the respective PIR sensor is tripped. I'd prefer to have one power source that powers both." And from our follow up conversations: "My needs are pretty simple with the project - in a nutshell: - When either my mom or dad put their feet on the ground from the bed, it would activate a motion sensor from their respective side of the bed, turning on the lights. I envision a system that would have one sensor on each side of the bed and one LED strip underneath each side of the bed that's connected to its respective sensor. - I would like to have the lights stay on for at least 5 minutes so they have time get up, do their thing, and return to the bed with the lights still on. - Regarding the LEDs, I purchased some simple warm white lights (3000K) and don't anticipate the need to have the LEDs change color." From this, I designed and prototyped a circuit that could achieve the above specifications and David has worked on replicating the circuit on his side of the world and doing the final installation at his parents' place! Hope you all enjoy this one! Check out the attached video for my final test circuit with a timer of 12 seconds and David's final installation being activated at his parents' place.
Step 1: Gather Your Materials
1 * 555 timer https://www.digikey.com/product-detail/en/texas-in...
1 * TIP 102 transistor https://www.digikey.com/product-detail/en/stmicroe...
1 * Capacitor 5600 uF https://www.digikey.com/product-detail/en/united-c...
1 * Capacitor 10 nF https://www.digikey.com/product-detail/en/kemet/R8...
1 * Resistor 10 kohm https://www.digikey.com/product-detail/en/stackpol...
1 * Resistor 5.1 kohm https://www.digikey.com/product-detail/en/stackpol...
1 * Resistor 47 kohm https://www.digikey.com/product-detail/en/stackpol...
1 * PIR Sensor https://www.digikey.com/products/en?keywords=1568-...
1 * 3 pin JST connector for sensor to board https://www.digikey.com/product-detail/en/jst-sale...
2 * 2 pin JST connector for power to board and LED strip to board https://www.digikey.com/product-detail/en/jst-sale...
2 * 2 pin JST connector for LED strip wiring and power wiring https://www.digikey.com/product-detail/en/jst-sale...
7 * pre crimped JST wires (choose a length - two wires for power, two for LED strip, 3 for the PIR sensor) https://www.digikey.com/products/en/cable-assembli... - or if you're handy with making your own cables and have the available connectors and crimps, make your own!
1 * Veroboard https://www.digikey.com/product-detail/en/vector-e...
1 * 12V single colour LED strip of your choice (e.g. https://www.ebay.com.au/itm/5M-3528-SMD-Cool-Warm...
1 * 12V power supply with MALE barrel jack connector, power rating will vary depending on what LED strip and length you are using (e.g. https://www.ebay.com.au/itm/5M-3528-SMD-Cool-Warm...
Wire for soldering
1* barrel jack screw terminal MALE https://www.digikey.com/product-detail/en/sparkfun...
2 * barrel jack screw terminal FEMALE https://www.digikey.com/product-detail/en/sparkfun... (only need one if LED strip or power supply come with one too)
Step 2: Test the LED Strip
It's good practice to test that all of your electronics work before putting everything together. So take the led strip and connect it to your power adaptor by using the provided barrel connector (if you got one with the LED strip) and hopefully the LEDs will light up. It goes without saying, but make sure that you connect positive to positive and negative to negative...
Step 3: Test the PIR Sensor
Again, testing your components before you use them in their final application is a good idea. In this step, you'll need to prepare the sensor so you can easily connect to it using the parts I listed in a previous step. The 3 pin connector that the PIR sensor comes with is different to what I normally like to use, so I would suggest replacing this by desoldering the provided wires and resoldering on the 3 pre-crimped JST ones. Then use the 3 pin JST header to locate the JST crimp side of the wires. The total assembly should look like the attached images. Note that here, BLACK is SIGNAL, BROWN is GROUND, RED is +12V.
To test the sensor, simply hook up the power and ground and use a multimeter to probe the signal pin. When triggered it should be pulled to ground. When not triggered, you should see a voltage i.e. not grounded. When you power up these types of sensors, you will need to wait a couple of seconds to allow the sensor to get a baseline reading of the still room. If anything moves after the "calibration" period, then the sensor will be triggered and the output signal pin will be low logic (grounded).
Step 4: Set Up the Circuit on a Breadboard First
Before you go ahead and solder up your prototype board, you should test everything on the breadboard. This is particularly useful so that you can choose your values of R3 and C2 which define the timer "timeout" and thus how long the LED strip will remain on for.
Some background information on how the complete circuit actually works is mostly related to the 555 timer acting as a monostable vibrator. If you are unfamiliar with the 555 timer and would like to learn more, a helpful page can be found here: http://www.electronics-tutorials.ws/waveforms/555... which explains the different modes the 555 can work in. As I mentioned, for this circuit I have configured it in Monostable mode, which means that when a low pulse (i.e. GND) is applied to the trigger input, the output will be set to high (i.e. 12V) for the period of time specified by R3 and C2 using the equation:
time (seconds) = 1.1*R3*C2
For testing purposes, it's a good idea to select values of R3 and C2 that allow the LED strip to be on for a short period of time so you don't have to wait around forever to find out if your circuit is working correctly. In the attached video, I have configured the timer for roughly 12 seconds. In the attached circuit diagram, the timer is configured for roughly 5 minutes (time = 1.1*47 000* 0.0056 = 289 seconds).
Luckily, the PIR sensor I selected outputs a low signal (i.e. GND) when the sensor has been activated. As a result, the trigger input of the 555 timer is connected directly to the PIR sensor. At the output however, a transistor is required to switch the power on to the LED strip, since the 555 timer can only source a limited amount of current, which wouldn't be enough to drive a long length of LED strip.
Step 5: Solder Up the Circuit on a Veroboard
Take your final circuit design from the previous step and solder up the board. The only thing you really need to remember here is to cut the tracks on the back of the board where the 555 timer sits, otherwise opposite pins will be shorted, which is definitely not what you want!
Plug everything in and give the circuit a test! If all went well, your circuit should be functioning exactly the same as it did in the breadboard configuration. Check out the attached video of my final test circuit. The timer is only on for 12 seconds still which is handy for demonstrating the circuit functionality.
Step 6: Mount the LED Strip and Sensor
The original spec for this project was to have the LED strip and sensor mounted for under-bed lighting, but obviously, this can be placed wherever you think it might be handy to have timed LED lighting!
Check out David's video and a photo of the final installation under the bed at his parent's place; both he and his parents are very happy with the outcome! Final words from David about the project:
“The design for this project is very elegant, and the build is rock-solid. It has already paid dividends. A few nights ago, my Mom—who’s had some balance issues over the past few years—got out of bed and the lights went on, and she told me that if she didn’t have those lights she would have most assuredly fallen down. I hope you find this build as fun as I did, and if you have similar success stories I’d love to hear them!”
We have a be nice policy.
Please be positive and constructive.
I would love to build this project but I have no experience and I am trying to learn and I think this would be a great project to start with. But I also have no experience in coding either so how would I go about building this? I have around 4 different ideas to use this for and it would be the perfect tool for them. Any suggestions because I really do want to build these myself?
Thanks for your interest in the project! The great thing about this one is that you don't need to have any skills in coding, since the logic is handled by the circuitry alone. I'd suggest you start by getting your hands on the right equipment and parts needed, then try setting it up on a breadboard (there are lots of tutorials on breadboard layouts and how to use one on Instructables). Let me know if you have any issues, I'd be happy to assist :)