You are welcome! You weren't the only one interested in a stair lighting system but didn't have (or want) Home Assistant or any other automation platform. I developed this version specifically for those folks. And as I mentioned in my other reply, I did eventually add some basic effects after I recorded this video... including the chase effect seen in my original stair video, but nothing like the hundred+ different effects you get with WLED.
This would be perfect for someone like me. This is exactly what I have been searching for, but for outside steps! I have still been searching and trying to come up with a solution and this would be absolutely perfect for those who are not tech savy and can't find in this day and age, something as simple as that for outdoors. Don't get me wrong, your creation for your steps is amazing and I had no idea something like that could be created, but for me at my age, the stand alone motion is perfect! Thank you for sharing this video! Great Job!
You are most welcome. After all, it was your comments on my original stair video that inspired me to try to create a standalone version! Obviously what I built here (and the related control and stair videos) are not rated for outdoor use. You'd need to substitute the LED strips for ones rated for outdoor use, weatherproof the controller and power supply, etc. But it was a fun project for me, so I'm glad you suggested it. In addition, I'm continuing to improve the firmware/software. I've already released a new version that allows you to temporarily change the colors, brightness, etc. from a web browser and should have another update in the next few days that allows you save those settings... and upload new versions of the software right from the browser. So, be sure to always check that you are getting the latest version if you do build the controller.
@@ResinChemTech Your mini website is very good. Thank you. What are IP and Macro settings with the latest WLED ? Is it required to modify the WLED code for binary flash or web settings can do it?
This standalone version does not use WLED (unlike my other stair LED video). Instead this uses custom firmware that I developed for this project: github.com/Resinchem/standalone-led-controller However, if you are interested in WLED, all information on WLED can be found on its official site: kno.wled.ge/
Great video. I have managed to follow it and flashed my chip. You said in the video (9mis 10 secs) you were going to explain how to change the settings on the phone . Any info on that please.
No, it shouldn't damage the chip... assuming it isn't already bad to begin with. Try it again, but if it continues to happen, you might need to try a different ESP. With all the different manufactures and clones out there, it is entirely possible that you just have a faulty board. I've received certain batches of chips that just wouldn't flash no matter what I did... including 3 out of 5 in a single order. You can also try holding down the BOOT/EN/RST button (button(s) might vary depending on which board you have). Hold the button down, connect it to USB and while still holding down the button, start the flash process. When you see 'Connecting....', release the button. Occasionally this is necessary on some boards to put them into flash mode. Otherwise, they just sit there until the flashing software times out. Let me know if any of that helps. Also assure you have selected the proper COM port and the one that the ESP is connected to.
Well, my original video/version uses WLED for the LED control. But it also requires Home Assistant for the automation and has independent sensors. WLED, by itself, really doesn't have an automation engine. There are some WLED user mods for things like stair lights, but it requires you compile and flash your own binary and I really haven't tested them to see how well they work. So the short answer is that as designed, this current system cannot use WLED. If you want to use WLED, then you need some sort of external automation engine like Home Assistant or NodeRED.
Yep... I mention Quindor's boards (and often show them as well) in a number of my other videos for those that don't want to create their own. They are great boards... when you can find them in stock!
You are most welcome. I know that a lot of people like the idea, but aren't necessarily Home Assistant users and don't want all the complicated code that is involved in my other version. Just as an FYI, I have updated the code and added a few basic effects, like the "chase" effect you see in the original video. There is also now a web interface for updating the settings, so it is no longer necessary to "reset" the controller each time you want to make a change. Let me know if you do decide to give it a shot or if you run into any questions.
Thank you so much for your content and awesome designs! Your videos have inspired at least 3 years worth of project ideas for me!! I am curious if there is a way to leverage this solution with a ToF sensor(s) instead of the traditional motion sensors. I have watched all of your videos around your staircase build and I am guessing the answer is no, but I figured I would ask anyway. My living room has open arched doorways to enter from either side, and my stereo / floorstanding speakers are on that same wall. I am concerned that it will be very easy to walk into the dark room and run into a speaker on either side, so I would like to install a small strip of lights under each speaker and have sensors to trigger them when someone enters from either doorway. Ideally, I would prefer that erroneous motion in the dining room, or hallway to either side of the living room would not trigger the lights, and would prefer that the lights are not triggered by motion while we are in the living room watching movies, etc. ToF sensors mounted midway down the archway on either end of the room seemed like the ideal way to achieve the goal, but I don't want to invest hours of programming into a solution that will consist of 18" of total LEDs.
It has been requested by others that I update this project to use the ToF sensors that I upgraded for the other Home Assistant-based version. It is still on my list of things to get to 'at some point'. But to be completely honest, with my other projects and requests, I'm not sure when I might get around to it. But I agree with you that the ToF version is much better than the original PIR version and prevents those false triggers when not necessarily crossing the path where you want the lights to activate. If I do get around to updating the Arduino firmware to use the ToF sensors, I'll try to remember to follow up on this comment. Or alternatively, you could put a watch on the Github repo and be notified if I make any updates to that code. Sorry I don't have an immediate solution for you if you don't want to tackle modifying the code yourself. I do hope to get to it one of these days.
I built this for my living room using the PIR sensors and it is working amazingly. I also built another full blown WLED controller using your controller tutorial for some bar lighting I have planned and everything is working great! I am going to rewatch your TOF video to understand the changes you made to the programming in that video to see how hard it would be to do something similar with this build as the motion sensors do still pickup erroneous motion of someone walking past the room and not into it from time to time.
@@ResinChemTech Is it possible to use the 5v input on the built in usb port as a sensor/trigger? I would like to disable the entire system when we are watching TV or a movie. I can connect the USB from my TV to the D1 and modify the if statements you built to do nothing when 5v is detected there. Or is there another way you would recommend accomplishing this? I am using an external 5v power supply to power the boards, lights and sensors so the goal would be to just detect the USB voltage as a trigger.
I don't believe that is possible. First, the USB port is connected to the serial pins... so any data would have be UART and/or serial (not just a voltage change). Next, if you are also powering the board independently, applying power via the USB port at the same time is a big no-no and will likely destroy the board.... only one power source (either via USB or the 5V pin) can be used. I'm assuming you are not a Home Assistant user? Do you have another automation platform? The easiest way is to detect the state of the TV turning on (this could even be done with a power monitoring smart plug, like a Sonoff S31... and you can detect when the power increased from turning on the TV) and then use that state change to disable stair lights. But again, you really need a 'middle man' automation system to make this work. I'd be happy to chat about other options, but that is what makes the automation systems so great... the ability to have disparate devices work together.
First of all, Thanks for your content! What about if we want to use the Node MCU controller (the large) combined with 2 TOF sensors; with the Mini1, we should use D1 and D2 on the TOF, but what about if we decide to use 2 TOF sensors replacing the regular motion sensors?? Thank you!
So unlike my other version of the stair lights that uses Home Assistant, this version has the sensors wired directly to the same controller as the lights. So, there is only one ESP8266 board involved in this version. A D1 Mini or a full size NodeMCU should work with the current library. However, if you want to swap out the PIR sensors for ToF, that would require modifications to the Arduino/C++ code to read from those sensors. It would also require updates to the web interface so that a 'trip' distance could be entered by the user. I've had requests to update the code for a version with ToF sensors. I may get to that someday, but with my current other projects and responsibilities, I can't make any guarantees as to if/when I might be able to create a new version. But if you have familiarity with Arduino code, you can clone or fork my repo and make those changes to use the ToF sensors yourself.
Correct. You simply take the data line from the ESP8266, split that signal and run it to the LED strips on each side of the stairs (or hallway or wherever you are installing the two strips). This means that both strips receive the exact same signal and will always be in sync with each other.
@ResinChemTech thanks that made sense. What on my mind is how.. dunno about you, thought I try ask. As your stairs are only one straight up and same length of Ws2812b strips on both side. Easy. My stairs are "U" shape - 6 steps then land then 3 steps to top of stairs... which mean left side will be longer strips than right side so how make both size lids up same line with steps? Coding involves I assuming?
I cover this exact scenario in my blog article on motion-activated stair lights: resinchemtech.blogspot.com/2021/07/simple-motion-activated-led-stair.html While this is the Home Assistant, and not the standalone version, the concept and potential options are the same. The offered solution is to use the longer side as the total number of LEDs. The lights will be partially in sync and partially out-of-sync depending upon the effect chosen. You can see the description of this in the above article. But you are correct that to get an exact sync for something like the chase effect on stairs with a different number of LEDs on each side would require code modifications.
Hi I love the end result, but have no clue about what you said, gave a like for the result you created,I plan to have garden pot lights installed in my stairs but would need an electrician to do it for me but at least I’ve seen an alternative option which I think looks better, thanks
Great stuff in next week I will try to do it I'm curious about how many attempts it might take me. By the way, I had a question regarding your another video: Is it possible to integrate the Time-of-Flight Sensor you mentioned into this project?
It is certainly possible, but does require changes to the firmware code that gets loaded onto the ESP to support the ToF sensors instead of the PIR sensors. This has been requested by others as well. I'm certainly willing to make those changes to my code to support the ToF sensors, but to be completely honest I'm unsure if/when I will have an opportunity to do so with my current other projects and responsibilities. However, if you are familiar with Arduino/C++ code, my code is freely available via Github ( github.com/Resinchem/standalone-led-controller ) so you could clone or fork the repo and make the changes yourself if you'd prefer not to wait until I get an opportunity to work on it myself. It is on my list... but just not sure when I might get an opportunity to make a version that supports the ToF sensors. But thanks for watching... and submitting the request!
Thanks! To address your question, as the code and interface are currently written, no. But it is a pretty easy modification to the code if you want to replace the "off" color with another color. In effect, what this would do is substitute your custom color or effect in the "turn off" routine for the lights. But this would have be altered in the code each time you wanted to change it to something different. Adding an option like this to the current web interface it a bit more of an undertaking, as not only would the web app need significant update, it would affect a pretty big chunk of the underlying code. So, is it possible? Yes. But it would take at least some code modification for a 'hard-coded' option, and a fair amount of code modification to make it an option from the front end web app. If you are comfortable and willing to take a shot at modifying the code, let me know and I can provide you with a few more details.
Hi, I greatly appreciate this and hope to do it in the new house we are having built because thankfully my wife thinks it's cool too so it's a win, win! What is a logic level shifter and why is it necessary? If I install one of these on each side of the steps, I would just set up the motion sensor / controller / and power at the top on one end and at the bottom on the other, right? Since this home is new construction, my intention is to install a wall plate with an integrated baffle to hide the controller, power adapter (?) and wires at each end next to the outlet set I will have installed. Make sense and any suggestions? Lastly, is it possible to build this without soldering? I was hoping to use ELEGOO 120pcs Multicolored Dupont Wire 40pin Male to Female, 40pin Male to Male, 40pin Female to Female Breadboard Jumper Wires Ribbon Cables Kit to connect everything.
Hi... I'll try to answer your questions as best I can here in the comments. First, the logic level shifter is used because the controller only puts out a 3.3V signal and the LED strips expect a 5V signal. If the wire run between the two is very short, you can sometimes get away without it. But I always recommend using one and use one on all my LED projects... especially ones where it might not be easy to get back to the controller and replace it if the signal voltage does become a problem. Next, you will only need the controller and power supply at one end (doesn't matter which.. whichever works best for you to have access to AC power for the power supply). You do need a motion controller on both ends however. If you haven't seen it, I have a related blog article with the wiring diagrams, parts list and more: resinchemtech.blogspot.com/2021/12/standalone-led-controller.html As far as the controller itself is concerned, I have another video that walks through the step-by-step process of building the controller: ruclips.net/video/ifv6wV3Rm6A/видео.html You won't install WLED when it gets to that part, but install the standalone firmware and you'll wire the motion detectors to the controller as shown in the linked blog above. To be honest, my other version that uses WLED and Home Assistant is much more robust and has many, many more lighting effects: ruclips.net/video/Y29Y0iTLggg/видео.html But it does require Home Assistant for the automations. I only built this standalone version upon a request from a viewer that didn't want to get into the whole home automation scene. If you are having any thoughts about potentially using Home Assistant or other automation systems, you might consider holding off and building this second version. Let me know how it goes, or if you run into any additional questions.
@@ResinChemTech Thanks for your input! I understand a little more about the need for the logic level shifter. I have seen a bunch of other projects where the person did not use this. I am guessing it's necessity depends on the distance AND density or just the distance? Those projects were no longer than about 6 feet each. The LEDs would just be wonky for longer use without the logic level shifter? Also, the data wire doesn't have to make a round trip back to the controller does it, just one way right?
Yes... it's true that a lot of people don't use a logic level shifter. It's really about distance and potential voltage drop via the wire. Once the signal reaches the first LED pixel, it is automatically boosted to 5V for the next pixel (which is also why you can also cut off a single pixel, install it at the controller and use it as a shifter... known as the 'sacrificial pixel' method)... so it's just about getting a reliable data signal to that first pixel of the LED strip. But the signal coming out of the ESP is already at 3.3V and just barely enough voltage. For the $1 that the logic level shifter costs (and just a little bit more soldering), I recommend using one to assure no problem with the data signal... and I also don't have to be concerned about how far away I put the controller (well, within reasonable limits... but you can definitely put the controller a couple of meters away from the strip when using a shifter). Note that most of the experts (those more knowledgeable than me), including the developer of WLED, recommend use of the logic level shifter in most cases. But like all DIY projects, the choice is up to you. Can you get away without one? Probably... in most cases... when the distance between the controller and LED strip is kept short. But I don't want to go through all the effort of building and installing something and have to worry about where I hide the controller, or finding I have signal issues after the install is complete because I didn't want to spend the $1 and an extra 10 minutes of soldering.
@@ResinChemTech Thanks sir, I much appreciate you taking the time to teach me! I have 2 last questions - for now...LOL! For 12v strips, is the data line still 5v or 12v and does that require a different logic level shifter? I am guessing it is not possible to connect PIR motion sensors to/through WLED hence the reason for the code you came up with?
Well, I always check the spec sheets for the particular 12V pixels you are planning on using, but for WS2811 (and most 12V strip LEDs), yes you can still send the signal as 5V and use the same logic level shifter with your ESPx board. But also note that most 12V strips can only be cut at every 3 sets of pixels and not between every pixel. Also note that you will need to step down the 12V to the 5V needed by your ESP board using a buck converter or similar. The ESP dev boards has a voltage regulator on board... and these sometimes vary based on manufacturer, but feeding 12V directly to the ESP board is either going to blow the board... or it will get very hot. You could use two different power supplies (12V for lights and 5V for controller), but you need a common ground between the controller and LED strip or weird things are going to happen! I'm just curious as to why you'd want to use 12V strips in this particular case? Unless you have a VERY long staircase, you probably won't need power injection even for 5V strips... so using 12V strips just complicates things a bit here. And also note that the code that I wrote for the controller is using a library for WS2812b 5V strips. I haven't tested, nor do I know if it will even work properly with WS2811 or 12V strips. As to your next question, the most recent release of WLED (0.13) actually does support the use of a PIR motion detector (it didn't when I first developed mine). I haven't tested it, but using two motion detectors in the manner to control lights on the stairs would be tricky, if not impossible using just WLED. While a motion detector can be set to turn the lights on (or off).. it currently cannot do both in just WLED alone. So, the lights would come on with the top motion and turn off with the bottom (for example), but they would ALWAYS work that way. In other words, the bottom motion detector could not turn the lights on as WLED would be defined to always turn them off with that motion detector. It might be possible to use some sort of toggle macro.. and this *might* work. WLED has come a long way and has added a lot of features, but I think it would take some pretty fancy macro/preset/playlist settings to recreate the stair lighting system. Maybe I'll try playing with it one of these days and see if can find a way to recreate the automations.
This is amazing work and have been wanting the same for my stairs but I’m not an iT person. Wondering if I you sell the same ? Would be very much appreciated.
I've been asked this many times, but unfortunately I don't have the time or resources to build, package, ship, invoice and deal with all the logistics involved with making and selling any of my projects to others. And since each stair case is different, it would be nearly impossible to build a system that worked for every install. The goal of my channel is to show others how to build these projects for themselves. You don't have to be an "IT person" to build this. In fact, for this project you don't have to write a single line of code. You just need to be able to do some basic soldering (and this project is a good one to learn soldering) and follow some written instructions. If you really like the project, I'd encourage you to give it a try. Even though I can't build it for you, I'm always happy to answer any questions and offer any help that I can if you do decide to build you own.
I've been searching for months now, but I can't find the solution. I want to use WLED (with the Home Assistant system, but I would also like to use it completely independently) with 2 motion sensors, but I can't find an instructional video on how to set it up anywhere. I want to use it under the bed. If possible, make it work so that if the left side motion sensor detects it, then from left to right, but if the right side motion sensor detects it, then the red light strip moves from right to left. If there is no movement for 60 seconds, the light will fade. If the left-side motion sensor detected first, and then the right-side motion sensor, the right-side motion sensor should not overwrite the running of the light. It would be perfect if a lux sensor could also be installed, and it would turn it on depending on the brightness of the room. Maybe you can make a video like this? You would help me a lot! I'm sorry, I only know minimal English. :(
That's pretty much exactly what I do in my other stair video: ruclips.net/video/Y29Y0iTLggg/видео.html It uses Home Assistant, WLED and two sensors to control the direction of the LEDs. You'd just have to adapt the project slightly for your bed installation and adjust a few things in the Home Assistant automation code (for example, my lights go off after 15 seconds instead of 60)... but otherwise, it is nearly the same.
Hi, I have some questions about this project 1. Is require that the motion sensor to be powered by controller board or can be power from an usb external ? 2. What need to be done to be powered external ? 3. If will be powered form the bored will not be a problem running long wires like 16 ft. for powering the sensors ? Thank you for your time ! Your video is so awesome and I learn a lot, I'm a beginner in this any recommendations on soldering iron and wires that I can use for this kind of project ?
Even if you powered the motion sensors by another source, you still have to run the signal wire from the motion detector back to the controller. So the detector must be wired to the controller in this version, at least for the signal. There should also be a common ground... so that's now two wires that are needed between the sensor and the controller, so you might as well get the 3rd wire for power from the controller as well. The only way to have a sensor that isn't wired to the controller is to use something like Home Assistant to provide the automation between the sensor and controller... and that's what I did in my other stair video ( ruclips.net/video/Y29Y0iTLggg/видео.html ), but it does require that you are running Home Assistant to use that version. As far as distance between the controller and PIR sensors, 16ft should be no problem. The connection to the controller is 5V and the PIR sensors will operate all the way down to 2.7V. So as long as you aren't using extremely thin wire (I'd say use at least 24 gauge, lower gauge if you can), 16-20 ft. should be no problem. Welcome to the world of DIY electronics! There are a lot of good videos on RUclips regarding soldering tips. Don't be discouraged at first. I was horrible as soldering when I first started. But hang in there and you'll get better. A project like this is a good place to start. If I have any recommendations, it is a good soldering iron with the right tip, using the right solder... and flux is your friend! We all started out as beginners at one point. Let me know if you have other questions.
@@ResinChemTech Thank you so much for the answering my questions, I will start on this project. After is done I will get back to you with the results, I'm really exited to get started
In all honesty: using a(ny) microcontroller for a simple on/off function (be it IR based or a manual switch or whatever) is completely nuts. The IR sensors already provide a timer; a simple circuit with a handful components at most should do to drive a LED strip. You *MAY* not be able to set the color (depends on which LED strip you choose) but that would be the only difference. Don't get me wrong here - My house is littered with these little buggers (Wemos D1 mini's). I'm just saying that it's nuts that, in 2021, stuffing a microcontroller into every simple project has actually become so cheap and simple that it's easier to do than wire something up of from a few basic components. And those microcontrollers are several orders of magnitude more powerful than the computers I grew up with (most notably the C64). Crazy.
I hear ya! (I had the TI-99/4A myself). I think the low cost and ease-of-use of the microcontrollers (just flash somebody else's code and hook up a couple of sensors or outputs) have brought a lot of people into the DIY "smart device" arena that might not have gone there otherwise... myself included. Personally, I enjoy the code development/automation scripting more than the actual electronics side of it... and the microcontrollers allow me to do that. This particular project came from a couple of subscriber requests to duplicate my original stair light video that used WLED, Home Assistant automations, ESPHome, etc. down to a basic version that would run standalone. So I started with the same controller and just wrote my own code (my wheelhouse) to allow it function without all the external services. But I appreciate the feedback. I'd like to continue to improve my own knowledge and skill with basic electronic components.
@@ResinChemTech Again; not blaming you for going the μC route - I'd probably have done the same. Actually, I have for similar projects. Just crazy that we can. And do :-)
Thanks... it's on my long list of projects to get back to. I have a list of requested changes, including a version for ESP32 (although I'm not sure why... ESP32 is really overkill for this project). While I'm somewhat limited in my ability to create certain effects with the current code base, are there particular types of effects that would be more appealing than others? Again, not sure when I'll have time to get back to this... but it is on the list!
While I have done a lot of projects that involve LEDs, I have a Hues Sync box and lights that currently provide audio and video synchronization for the home theater. If I had it to do over again, I might consider Hyperion. Other than that, I've done some videos on the sound-reactive version of WLED... but obviously that's just audio and not video.
I want to add leds to my stairs soon aswell, but im quite new to microcontrollers. I saw that wled supports pir aswell but i dont know if i could add two pir sensors like you to make it run. I would like to create an effect where the leds slides up (if i triggered it downstairs) and if they reached the top they stair on that would look awesome i think. Thanks for the video it will help me
While I have not tried adding a PIR (or two) to WLED, I think part of the issue would be dealing with the logic... for example, if the bottom sensor is triggered and the lights are already on (because of the top sensor), then turn the lights off.. otherwise, turn them on. Then there is the issue of once the lights are on, turning them back off after a set time has expired if a sensor isn't triggered again (otherwise the lights would just remain on). So, while I think that WLED could possibly use a PIR sensor to trigger the lights, I don't think it could handle the logic to treat the stair lights as I show in this and my related stair light videos. There might possibly be some sort of user mod out there for WLED that would make this possible, but I haven't looked for one. But if you do find a way to get something like this working with just WLED and a PIR sensor (or two), please be sure to share how you did it!
Hi Spencer, You'd likely have to modify and recompile the code. The code is specifically written for the 5V WS2812b (ex: FastLED.addLeds). Using a different type of LED may or may not work properly. It could be an issue as simple as having the colors wrong (you select blue but get green, etc.), or depending on the LED type, it may not work at all. In addition, the controller is 5V only. So if using a 12V power supply, the voltage would need to be stepped down to 5V via buck converter or other means to power the controller. You could use 12V for the LED and a separate 5V power supply for the controller, but then you'd need to create a common ground between the controller and LED strip. All this is to say that it is possible to use 12V LEDs... but not "as-is" by just swapping out the 5V WS2812b. It would likely require code changes and some different wiring depending upon how you opt to power the LEDs vs. the controller.
I just followed this video and my esp 8266 will light up then goes off. But i can still connect to it from the browser. Its not controlling the lights. I wired on breadboard 5v dc to esp8266 and level logic with 2 pirs. 12v to 16' ws2811 rgbic. The led lights just lights up to white. No control
The lights turning on briefly at boot, then going off is normal behavior and let's you know the boot process has completed. By default, the code is written and specified for WS2812b (FastLED.addLeds(LEDs, NUM_LEDS_MAX);). In theory, it should work with 12V WS2811 LEDs, but I have not tested it and you may need to modify the original code in the line above. To verify that the current code works with WS2811, if you open the web app and change the LED color for Motion 1 (without checking the box to save as new defaults). The lights should turn on for about 2 seconds with your newly selected color when you click the Update button. If this happens, then the ESP8266 is talking properly to the WS2811 LEDs. If you make this change and the lights do not briefly light up with the new color, try again and this time check the box to save as new default. The board will reboot and the lights should light up briefly in the new color upon boot. If the board is talking and controlling the LEDs in the above, but not responding otherwise, then the problem is likely the PIR motion detectors. The lights will not turn on until the PIR sends the motion signal. Let me know the results of the above testing and we can troubleshoot further if needed.
Hi, its good but can not we use two motion sensors with esp32 having wled installed on it? This will not require home assitant dependency and all effects of wled will be available. Everyone will be ok to use wled either from browser or app ( off course w/o HA), I have been looking for wled+2 motion sensor option led light with turns on step by step but no luck so far
The challenge is how do you get the motion sensors to turn WLED on or off (and set the right effects) without using some automation system like Home Assistant. Now that WLED supports two buttons (it didn't when I did this video), you might be able to connect the motion detectors as buttons to the controller and use WLED macros/presets to have the motion detectors turn the lights on or off. I really don't know if this is feasible or not... and I have not tried it. I think the problem will be having one motion detector turn them on, while the other one turns them off... but the opposite when someone is going the other direction on the stairs. I just don't think this level of automation can be done with just WLED alone. But you have to have "something" that takes the signal from the motion detectors and then uses logic to determine whether the lights need to be turned off or on (and set the proper effect accordingly). If you don't have Home Assistant (or similar), then you need a controller to do that instead. But if you do figure out how to do with just LED, then by all means, create a video and share it with the rest of us!
Thanks! I did this one as a follow up (and simplified version) of my original staircase video. A lot of folks wanted to try something like this, but aren't Home Assistant users and didn't want to install and manage Home Assistant just for this project (the original version required Home Assistant). So, I set out to create a version that would work standalone. It doesn't have all the various effects and features of WLED, but it does offer some basic effects and colors... without needing any external systems to run. Thanks for the comment... and the sub! I greatly appreciate it.
As listed in the video description, the complete parts list and wiring diagrams can be found in the written version of this project: resinchemtech.blogspot.com/2021/12/standalone-led-controller.html
Awesome, can I achieve a slide animation in one direction with the first (i.e. walking down) PIR and in the other direction with the other PIR (i.e. walking up)? That would make it look "smarter" :P
Yes. The web interface allows you to specify both an LED color and an effect for each motion detector. So, you can have the lights slide up from the bottom detector and slide down from the top. The features and effects can be found in the wiki of the Github repo, which is linked in the video description. A few additional effects were added after this video was made, so those are listed in the GIthub repo as well.
@@ResinChemTech That was literally the only thing I thought was missing from the setup in this video... looks like a project for the upcoming bad weather! Just need to find a way to hide the power feed, since I'll be working in the main room, not the basement! Thank you!
Love this idea im new to all this but can this be done with just standard led strip ie warm white and is the process the same or is that scenario a completely different set up. I just want normal single colour leds with motion detection at top and bottom and a timed delay for time on
Hi Paul. I understand what you want to do, and my simple answer is "maybe". It will depend upon the 'standard' LED strip that you buy. The controller code is specifically written for WS2812b RGB LED strips. It might, or might not, work with other types of LED strips. It will NOT work with LED strips that require 4-wires, but only 3-wire 'clockless' strips for sure. I simply haven't tested my code with all the various flavors of other LED strips so unfortunately I just can't say for sure. Just note that if you can use WS2812b strips, you don't have to use any of the effects or fancy colors with the code. The application allows you to select both effects and colors, so you could set it to just turn on with a solid color (even white) based on motion, and just turn off again after a predefined time. Please let me know if I can help out any further.
@@ResinChemTech Hi i have now got all parts needed to build the stand alone version and went with WS2812b leds, Will the code allow me to have the strips turn on with say bottom pir then turn off with top pir and vice versa. Also how to i wire a LDR into the circuit and which type should i use so that the lights are not on during day light hours only when light levels drop to a certain level.....thank you for all the advice
First question is yes.. the code is written so that if motion is detected by one sensor and the lights are off, turn the lights on. If motion is detected and the lights are on, turn them off. In effect this means that if you start up (or down) the stairs, the first motion detector will turn on the lights. Then the motion detector at the opposite end will turn the lights back off.... if the second motion event is never detected, the lights will then automatically turn off after a time you set in the web application. As to the second question, an LDR is normally connected to the A0 pin on the ESP board along with a 10K resistor. However, the code is not written to make use of an LDR and it would have no impact. The code would have to be updated to ignore the motion (e.g. don't turn on the lights) if the light level was above a certain value. This would also require updating to the web interface app to allow the user to set that light level value, etc. That would be something that you could do yourself (since all the code is available via Github), but isn't something I'm prepared to tackle at the moment. As an option, you could add some other sort of device that would cut the power to the power supply using an LDR. Something similar to this might work: amzn.to/3Ma7iwy When the light level is high, it would simply cut the power to the stair system so it wouldn't come on. There may be other solutions, but this is the one that came to mind. In all honesty, this is where a home automation system (like Home Assistant) shines. It bridges the gap between disparate devices. In that case, it would be very easy to add a separate light sensor (not even connected to the stair system) and Home Assistant would tell the stairs to only turn on or off based on that light level. I know that doesn't help you here, but it is just a thought for the future. Regardless of how you opt to proceed, I would recommend that you connect and test everything temporarily before you actually install on your stairs. It is much easier to troubleshoot and resolve issues on the "bench" then after everything is installed. Let me know if you have any other questions. Good luck with your project!
@@ResinChemTech Thanks for the info it has given me food for thought as to how to proceed. I will of course test everything on the bench before fitting to stairs 😁😁
Really love this video. I'm searching for something like this, for a led strip under the bed. Can you also connect a LDR with it so I will only turn on if a certain level is reached. Next wish is the following. 1 motion and ldr for the left side only turning the left strip. And one for the right :) Hope you can give me some tips. Really love it. A++++++
You could certainly connect a photoresistor and modify the code to include that. The second part is a bit trickier. The code could be updated to only light up a portion of the LEDs depending upon which motion detector fired... that wouldn't be too hard. But the ESP8266 has only on ADC pin (A0) for a single LDR, so you'd either have to move up to the ESP32 or find a different way. If it were me, I'd just use a single LDR. If this was going in a bedroom and I only wanted to light one side or the other based on motion, I'd rely on the light level in the room from the single LDR to either enable or disable both sides, then use the two motion detectors to light the appropriate side only if it was dark enough overall in the room. By the way, if you are thinking about trying this and starting with my code, you might give it a day or so. I will be releasing an update today that allows the settings to be changed from a web browser and to also upload new .bin files from the browser over-the-air. The code is done, I just need to get it documented and uploaded to Github. I hope to have that done tonight or tomorrow.
@@ResinChemTech Tnx for the mega quick reply. Your totally right about adding only one LDR, 2 pirs and do 2 ledstrips. Hopefully in the menu, you can choose to turn on left, right or both :) per pir and also make it working with a led strip with also white. I will look everyday for your update. Many many tnx
Awesome video and info! I have duplicated this system and I love it! I am having one issue. At night the leds are randomly turning on as if something is tripping one of the motion sensors but there is nothing around to create movement. I am using the same PIR sensors you have. Have you had this issue or have any tips for me?
Thanks... congrats on building the system and I'm glad you like it. Actually, I did have that issue at one point in time. The lights would randomly fire on their own from time to time. I was able to track it down to one of the motion sensors. Once I replaced that (even with the same type), I've not had any 'mis-fires' for over six months. Fortunately for me, I was using my other "full" version with Home Assistant so I was able to see which motion detector was acting up. For this standalone version, you may just have to try replacing one at a time (I guess you have a 50% chance of getting the right one the first time!). The motion detectors, I believe, are somewhat susceptible to electrical interference. So, if possible, try to keep your other power lines away from the detectors. I don't know if it might help or not, but you might try lining the motion detector enclosure with some aluminum foil or other type of shielding? Again, I think with some of these low cost motion detectors, there are probably some variances in quality. For me, with the same exact problem, just replacing one of the motion detectors with a different one (from the same brand), solved the issue. If all else fails, you might try ordering a different batch/lot of motion detectors... maybe even from a different seller. Just as long as they are AM312 PIR detectors, they should work and still have the quick 5 second cooldown period. Let me know if that works for you or if you have any additional questions.
@@ResinChemTech thank you for the quick reply!! Great information you've given me. I will buy more if that type and go from there. Thanks again and I'm looking forward to more projects!
You need to connect it to your wifi to access it via your web browser to do things like change colors, the default "on" time before the lights shut off, and other options. And I've added additional features since I originally recorded the video, so you need it connected to wifi to update the firmware as well. It does only connect to your local wifi (and not the Internet - so it will continue to work even if your Internet goes out) and theoretically, once it is setup and configured the way you want, it should be possible to disconnect from the wifi. I haven't tested this, but know of no reason why it shouldn't work (well, at least until the power goes out and the controller restarts).
Hi Joe! I can certainly consider that as my time permits. I don't think it would take a huge amount of time to create an ESP32 version in the code, but I'd need build prototypes, thoroughly test it, etc. which I'd have to find time to complete. I'll follow up with a reply to this comment when I release an ESP32 version. Of course, if you have any experience with writing Arduino/C++ code, the original source code is available in my Github repo as well, so you could modify/compile this for the ESP32 yourself (I think it primarily just needs ESP32 versions of the libraries). If you do accomplish this, please feel free to submit on my Github and I would be happy to share with everyone!
I don't have a PCB, but I do have a separate video on building the controller, mounted on a solderable prototype board: ruclips.net/video/ifv6wV3Rm6A/видео.html There is also a related blog article with diagrams at: resinchemtech.blogspot.com/2021/12/standalone-led-controller.html You can find other related links in the video description.
It's theoretically possible, but not with the current code as it is written. The ToF sensor uses I2C which would require different libraries in the Arduino code and updates to how the code works. While it is possible for multiple devices to share the same I2C pins on the D1 Mini, it also requires that the address of one of the ToF devices be changed. I can consider a separate version of the code at some point that would support the ToF sensor, but I can't promise when I might have time to get to it. Of course if you are familiar with Arduino code, you can always fork my code and make the necessary updates. I just don't know if or when I'll have time to revisit this project with other current priorities.
The wiring of the controller, including diagrams, are in my related blog article ( resinchemtech.blogspot.com/2021/12/standalone-led-controller.html ). Then swapping out the PIR sensors for the ToF sensors, and how those are wired is covered in the original stair blog article ( resinchemtech.blogspot.com/2021/07/simple-motion-activated-led-stair.html ). In this last article, if you scroll down, you will see how the ToF sensor is wired to the controller in place of the PIR sensor. Since you need two ToF sensors, but there is only one set of I2C pins, the two sensors are wired together then attached to the controller. You'll have to change the default address on one of the sensors, but info on that can be found online if you search for VL53L0X I2C address. I hope that helps... I really can't provide any sort of diagrams or drawings here in the comments.
Hi, how to make each staircase separate. I wish that when the motion sensor is detected then each step lights up one after the other at 0.5 intervals. Since I don't know about electricity, I was looking for a kit where I could connect 18 separate stairs, but I can't find anything like that on the internet.
There are other stair lighting videos on RUclips that do pretty much what you are describing... but they are much more complicated from both a wiring and programming standpoint than the system I am showing here. They generally also run the LED lights horizontally across each stair tread... which requires substantially more wiring (and better ways to hide that wiring). You could potentially modify my code so that just a section of lights come on at a time, with a delay in between, but that would be a set time and wouldn't synchronize with someone that might walk up or down the stairs at either a faster or slower pace. I also am unaware of any commercial/retail system that does what you are asking. It would almost certainly be something that you'd have to design, build and program yourself. But let me know if you have any other questions.
@@ResinChemTech The stairs are already done with grooves and holes in hollow wall, so all the wiring will be hidden. LED will be only white, every strip will be separate with separate cables, so basically 18 strips each 3-4 feet long with 18 cables (not one long LED strip ). I can make it that when the motion sensor activates all LED glows, but i would like it that they turn on in 0.5s (0.4s or 0.6s we will se what will be the optimum) intervals.
OK... I think I understand your install. But how are you running the data line from the controller to the different LED strips? If you are running a separate line to each strip, they will always be treated the same. If you send out a signal to turn on a strip, all strips receive that same signal and will do the exact same thing (at the same exact time). If your signal line continue from the end of one strip to the beginning of the next, then it would be theoretically possible to have the program turn on the first section (for example, pixels 1-20), then delay for 0.5 seconds, turn on pixels 21-40, delay, etc. The controller sees the LED strip as a single entity with a set number of pixels... and each is addressable. For example... if you have a total of 300 pixels, the controller can turn on pixel 148 and turn off pixel 149. But if this signal is split between multiple strips, it is going to send that same signal to turn on pixel 148 to every strip (whether pixel 148 exists or not). While you can run your power lines (+5V/GND) to each strip, to be able to control the segments of each step individually from a single controller, the data line will need to 'serpentine' between the treads... data flows out of end of one strip and then into the next... so that the controller sees it as one big LED strip. This would at least make it possible. My application is not designed for that effect, but it could probably be modified to do so. WLED has the ability to define segments (each stair could be it's own segment), but I don't know of any effect or option that would turn on each segment, in order, with a delay between each. It might be possible using playlists or something like that. Let me know if I am misunderstanding (again)... or if you are planning something different in terms of running the data line/signal from step to step.
This is probably because you are downloading an executable (.exe) file from the Internet, which most virus or other anti-malware software sees as risky. Normally, I'd agree if these files weren't coming from a reputable Github repository. You can also try ESPHome Flasher (github.com/esphome/esphome-flasher/releases/tag/1.4.0), but it is also an .exe file and you are likely to get the same warning. I can only tell you that I've used both of these programs successfully without issue. It is up to you to determine if you want to assume the risk of running an application you've downloaded from the Internet. The other options would be to download the source files and compile an executable files yourself, use the Arduino IDE or other utility that can connect to the ESP board via serial connection to upload the file.
Yep... assuming you want to use two motion controllers, like at the top and bottom of the stairs. If you have a situation where you only need or want one motion controller, the second one is optional. Just specify 1 PIR when prompted during the software setup for the controller. When using one motion detector, it is connected to pin D5. The second one is connected to pin D6. If you want to see the actual wiring diagrams, you can take a look at my related blog article for this project at: resinchemtech.blogspot.com/2021/12/standalone-led-controller.html
I don't believe so... at least not in the 'basic' standalone version, without some sort of "middleware" like Home Assistant. The full version that I did with WLED does have Alexa integration and both Google and Alexa are possible with Home Assistant. I could add something like MQTT to my code, but it would still require an MQTT broker that would have to act as the 'bridge' to Alexa.
Looking at your web screen showing all wiring etc., for this standalone system, you show connection to 1 LED strip. May be a silly question but, if I am connecting to 2 strips as in your video with a strip each side of the stairs, do I just connect the second strip in parallel to the first? Cheers in advance.
Yes... that's correct. You take the LED data line coming out of the controller and simply split it and run to the LED strip on each side of the stairs.... along with 5V and GND of course. This is actually shown a bit better in both the blog and video on my other stair lights build that uses Home Assistant. This physical build is nearly identical, except for the connection of the motion sensors... and the firmware used on the controller. Let me know if you have any additional questions!
@@ResinChemTech There are 5 leads on my 5v LED strips. I ordered - DC5V WS2812B WS2812 Smart 5050 RGB LED Strip Individuaily Addressable Light Tape/60 x 144Pixels/m Black/White PCB IP65. Have I ordered the wrong type of LED strip? If not, how do I connect them or indeed test them before I connect them up please?
If they truly are WS2812b, then look at the LED strip itself. You should see only 3 copper "pads" between the LED pixels. What you are likely seeing are two extra wires (red and black or red and white) on the provided starting and ending connectors that are used for extra 5V power injection if you need it. Are three of the wires connected to a JST connector and the remaining two wires connected to nothing? If so, it is the three wires connected to the JST connector that you need to use. In fact, I usually cut off the first pixel and built-in connectors and solder wire directly to the 3 pads on the LED strip. If you want to use the 3 pin JST connector, then you can cut off or cap the extra two wires. Note however, if you are using more than about 300 total LED pixels, you may actually need to do power injection. In fact, you'll find another connector at the end of the strip which also has those two extra wires. If you need to do power injection (you'll know because the lights will start to fade and change colors towards the end of the strip... white will start to turn pink... or the lights will flicker). If so, you can inject 5V of power on these extra two wires. You may want to review my video on using WS2818b LED strips, where I also talk about power injection and how to do it if needed, along with other tips on using LED strips: ruclips.net/video/GZjS51yBV4s/видео.html The important thing here is that the LED strips only have 3 copper pads, or connections on the strip itself. It the strip has 4 (or even 5) copper pads between the LEDs, then they are not really WS2812b LED strips... and they will not work with this controller or project.
@@ResinChemTech Thanks again for the quick response. There are only 3 pads on the strip. If I simply connect the +5v and - ground supply to the LED strip, as a test, should the strip light up?
Hello, will you please offer an ESP32 version? Also can you show us the version with the chase effect? How does the chase work with the motion detectors on each end?
I can certainly consider an ESP32 version if I get the time to build it. Naturally, you can also take my code and update the libraries to ESP32 and compile a new .bin file as well using the Arduino IDE. But I'm curious as to why you want an ESP32 version. The ESP8266 is plenty powerful to run the firmware. The ESP32 is really overkill, adds nothing, and costs about 3x as much as the ESP8266. As far as the chase effect, that is simply selected in the web interface for the controller . You select 'chase' for one motion detector and 'reverse chase' for the other. I actually show this setup in my Github repo wiki for this project: github.com/Resinchem/standalone-led-controller/wiki/04-Using-the-Web-Interface
@@ResinChemTech Thank you so much for replying! The honest answer to your question is embarrassingly simple - I have a bunch of ESP32 lying around but no ESP8266s lol! But after looking the project again I've decided to go with ESP32 after all. Thanks for your work and insight!
I get it! Use what you've got! I've had a couple of requests for an ESP32 version... and I'd like to go back at some point and create one. But beyond just updating the code, I'd have to build the controller and a bench rig and then do all the testing to assure that the ESP32 build works as expected. Then I'd also have to maintain two different versions moving forward. It just takes a fair amount of time and I have to juggle that with my "day job" and other projects that I'm working on. If you do build an ESP32 version, please consider adding it as a pull request in my Github repo! I'm sure others that would like an ESP32 version would appreciate it (as would I).
hello brother, while the chase effect leds are shutting down, they are all shutting down at the same time. What should I change in the code so that the LEDs turn off sequentially? please help
The command to turn the lights off can be found under the toggleLights function. You'd need to modify this so that instead of turning all the lights off at once ( fill_solid() ) , it would more or less run the chase effect in reverse, turning each pixel off one at a time until they are all off, instead of turning them all off together. Hope that helps to point you in the right direction!
is there anyway we can have different effects colors? thank you for your work btw how do I change to number of leds, i tried to log in mine 192.168.1.74 but it goes straight to WLED setting
Do you have the latest firmware (0.40)? The newest version allows you to change all the settings from the main web page, including the number of LEDs (pixels), number of motion sensors, color, light on time, etc. If your version is prior to 0.30, the only way to change the settings is to issue a reset command and change the settings as part of the onboarding. Please see the Github wiki for more information: github.com/Resinchem/standalone-led-controller/wiki/04-Using-the-Web-Interface
Great video. I have managed to follow it and flashed my chip. You said in the video (9mis 10 secs) you were going to explain how to change the settings on the phone . Any info on that please.
All that info on using the application and changing the settings can be found in the Github wiki: github.com/Resinchem/standalone-led-controller/wiki Specifically, look at the section for Using the Web Interface for information on how to change settings. The phone is really only used for the initial onboarding to wifi. After that, all the settings are accessed via a web browser, as described in the wiki. Glad you got it flashed successfully.
This is what I was lookin for considering that my daughter does not have the fancy apps.
Thanks ever so much!
You are welcome! You weren't the only one interested in a stair lighting system but didn't have (or want) Home Assistant or any other automation platform. I developed this version specifically for those folks. And as I mentioned in my other reply, I did eventually add some basic effects after I recorded this video... including the chase effect seen in my original stair video, but nothing like the hundred+ different effects you get with WLED.
This would be perfect for someone like me. This is exactly what I have been searching for, but for outside steps! I have still been searching and trying to come up with a solution and this would be absolutely perfect for those who are not tech savy and can't find in this day and age, something as simple as that for outdoors. Don't get me wrong, your creation for your steps is amazing and I had no idea something like that could be created, but for me at my age, the stand alone motion is perfect! Thank you for sharing this video! Great Job!
You are most welcome. After all, it was your comments on my original stair video that inspired me to try to create a standalone version! Obviously what I built here (and the related control and stair videos) are not rated for outdoor use. You'd need to substitute the LED strips for ones rated for outdoor use, weatherproof the controller and power supply, etc. But it was a fun project for me, so I'm glad you suggested it.
In addition, I'm continuing to improve the firmware/software. I've already released a new version that allows you to temporarily change the colors, brightness, etc. from a web browser and should have another update in the next few days that allows you save those settings... and upload new versions of the software right from the browser. So, be sure to always check that you are getting the latest version if you do build the controller.
@@ResinChemTech Your mini website is very good. Thank you. What are IP and Macro settings with the latest WLED ? Is it required to modify the WLED code for binary flash or web settings can do it?
This standalone version does not use WLED (unlike my other stair LED video). Instead this uses custom firmware that I developed for this project: github.com/Resinchem/standalone-led-controller
However, if you are interested in WLED, all information on WLED can be found on its official site: kno.wled.ge/
Great video. I have managed to follow it and flashed my chip. You said in the video (9mis 10 secs) you were going to explain how to change the settings on the phone . Any info on that please.
No, it shouldn't damage the chip... assuming it isn't already bad to begin with. Try it again, but if it continues to happen, you might need to try a different ESP. With all the different manufactures and clones out there, it is entirely possible that you just have a faulty board. I've received certain batches of chips that just wouldn't flash no matter what I did... including 3 out of 5 in a single order.
You can also try holding down the BOOT/EN/RST button (button(s) might vary depending on which board you have). Hold the button down, connect it to USB and while still holding down the button, start the flash process. When you see 'Connecting....', release the button. Occasionally this is necessary on some boards to put them into flash mode. Otherwise, they just sit there until the flashing software times out.
Let me know if any of that helps. Also assure you have selected the proper COM port and the one that the ESP is connected to.
Hi..
I have installed this setup on my staircase... It works great.... I'm just checking if this set up can be upgraded with wled?
Regards
Spencer
Well, my original video/version uses WLED for the LED control. But it also requires Home Assistant for the automation and has independent sensors. WLED, by itself, really doesn't have an automation engine. There are some WLED user mods for things like stair lights, but it requires you compile and flash your own binary and I really haven't tested them to see how well they work.
So the short answer is that as designed, this current system cannot use WLED. If you want to use WLED, then you need some sort of external automation engine like Home Assistant or NodeRED.
Thank you for the update & the reply!..... Amazing work as always!
Quin LED - Dig-Quad. Great boards, no soldering.
Yep... I mention Quindor's boards (and often show them as well) in a number of my other videos for those that don't want to create their own. They are great boards... when you can find them in stock!
Thanks for the simpler version! I'll give this a try in my new house.
You are most welcome. I know that a lot of people like the idea, but aren't necessarily Home Assistant users and don't want all the complicated code that is involved in my other version. Just as an FYI, I have updated the code and added a few basic effects, like the "chase" effect you see in the original video. There is also now a web interface for updating the settings, so it is no longer necessary to "reset" the controller each time you want to make a change. Let me know if you do decide to give it a shot or if you run into any questions.
Thank you so much for your content and awesome designs! Your videos have inspired at least 3 years worth of project ideas for me!!
I am curious if there is a way to leverage this solution with a ToF sensor(s) instead of the traditional motion sensors. I have watched all of your videos around your staircase build and I am guessing the answer is no, but I figured I would ask anyway.
My living room has open arched doorways to enter from either side, and my stereo / floorstanding speakers are on that same wall. I am concerned that it will be very easy to walk into the dark room and run into a speaker on either side, so I would like to install a small strip of lights under each speaker and have sensors to trigger them when someone enters from either doorway.
Ideally, I would prefer that erroneous motion in the dining room, or hallway to either side of the living room would not trigger the lights, and would prefer that the lights are not triggered by motion while we are in the living room watching movies, etc. ToF sensors mounted midway down the archway on either end of the room seemed like the ideal way to achieve the goal, but I don't want to invest hours of programming into a solution that will consist of 18" of total LEDs.
It has been requested by others that I update this project to use the ToF sensors that I upgraded for the other Home Assistant-based version. It is still on my list of things to get to 'at some point'. But to be completely honest, with my other projects and requests, I'm not sure when I might get around to it.
But I agree with you that the ToF version is much better than the original PIR version and prevents those false triggers when not necessarily crossing the path where you want the lights to activate.
If I do get around to updating the Arduino firmware to use the ToF sensors, I'll try to remember to follow up on this comment. Or alternatively, you could put a watch on the Github repo and be notified if I make any updates to that code.
Sorry I don't have an immediate solution for you if you don't want to tackle modifying the code yourself. I do hope to get to it one of these days.
@@ResinChemTech Thanks for your reply and all of the continued awesome videos and instruction!
I built this for my living room using the PIR sensors and it is working amazingly. I also built another full blown WLED controller using your controller tutorial for some bar lighting I have planned and everything is working great! I am going to rewatch your TOF video to understand the changes you made to the programming in that video to see how hard it would be to do something similar with this build as the motion sensors do still pickup erroneous motion of someone walking past the room and not into it from time to time.
@@ResinChemTech Is it possible to use the 5v input on the built in usb port as a sensor/trigger? I would like to disable the entire system when we are watching TV or a movie. I can connect the USB from my TV to the D1 and modify the if statements you built to do nothing when 5v is detected there. Or is there another way you would recommend accomplishing this?
I am using an external 5v power supply to power the boards, lights and sensors so the goal would be to just detect the USB voltage as a trigger.
I don't believe that is possible. First, the USB port is connected to the serial pins... so any data would have be UART and/or serial (not just a voltage change). Next, if you are also powering the board independently, applying power via the USB port at the same time is a big no-no and will likely destroy the board.... only one power source (either via USB or the 5V pin) can be used.
I'm assuming you are not a Home Assistant user? Do you have another automation platform? The easiest way is to detect the state of the TV turning on (this could even be done with a power monitoring smart plug, like a Sonoff S31... and you can detect when the power increased from turning on the TV) and then use that state change to disable stair lights. But again, you really need a 'middle man' automation system to make this work. I'd be happy to chat about other options, but that is what makes the automation systems so great... the ability to have disparate devices work together.
First of all, Thanks for your content!
What about if we want to use the Node MCU controller (the large) combined with 2 TOF sensors; with the Mini1, we should use D1 and D2 on the TOF, but what about if we decide to use 2 TOF sensors replacing the regular motion sensors??
Thank you!
So unlike my other version of the stair lights that uses Home Assistant, this version has the sensors wired directly to the same controller as the lights. So, there is only one ESP8266 board involved in this version. A D1 Mini or a full size NodeMCU should work with the current library. However, if you want to swap out the PIR sensors for ToF, that would require modifications to the Arduino/C++ code to read from those sensors. It would also require updates to the web interface so that a 'trip' distance could be entered by the user.
I've had requests to update the code for a version with ToF sensors. I may get to that someday, but with my current other projects and responsibilities, I can't make any guarantees as to if/when I might be able to create a new version. But if you have familiarity with Arduino code, you can clone or fork my repo and make those changes to use the ToF sensors yourself.
Hello again, again wicked clip of your stairs running leds... for both ws2812b strips running same time... both data signals to same ESP D6 out right?
Correct. You simply take the data line from the ESP8266, split that signal and run it to the LED strips on each side of the stairs (or hallway or wherever you are installing the two strips). This means that both strips receive the exact same signal and will always be in sync with each other.
@ResinChemTech thanks that made sense. What on my mind is how.. dunno about you, thought I try ask.
As your stairs are only one straight up and same length of Ws2812b strips on both side. Easy.
My stairs are "U" shape - 6 steps then land then 3 steps to top of stairs... which mean left side will be longer strips than right side so how make both size lids up same line with steps?
Coding involves I assuming?
I cover this exact scenario in my blog article on motion-activated stair lights: resinchemtech.blogspot.com/2021/07/simple-motion-activated-led-stair.html
While this is the Home Assistant, and not the standalone version, the concept and potential options are the same. The offered solution is to use the longer side as the total number of LEDs. The lights will be partially in sync and partially out-of-sync depending upon the effect chosen. You can see the description of this in the above article. But you are correct that to get an exact sync for something like the chase effect on stairs with a different number of LEDs on each side would require code modifications.
Hi I love the end result, but have no clue about what you said, gave a like for the result you created,I plan to have garden pot lights installed in my stairs but would need an electrician to do it for me but at least I’ve seen an alternative option which I think looks better, thanks
Great stuff in next week I will try to do it I'm curious about how many attempts it might take me. By the way, I had a question regarding your another video: Is it possible to integrate the Time-of-Flight Sensor you mentioned into this project?
It is certainly possible, but does require changes to the firmware code that gets loaded onto the ESP to support the ToF sensors instead of the PIR sensors. This has been requested by others as well. I'm certainly willing to make those changes to my code to support the ToF sensors, but to be completely honest I'm unsure if/when I will have an opportunity to do so with my current other projects and responsibilities.
However, if you are familiar with Arduino/C++ code, my code is freely available via Github ( github.com/Resinchem/standalone-led-controller ) so you could clone or fork the repo and make the changes yourself if you'd prefer not to wait until I get an opportunity to work on it myself. It is on my list... but just not sure when I might get an opportunity to make a version that supports the ToF sensors.
But thanks for watching... and submitting the request!
Hi! Great video as always! Is there a way to choose a white color when the pair is activated and another color effects when not activated?
Thanks! To address your question, as the code and interface are currently written, no. But it is a pretty easy modification to the code if you want to replace the "off" color with another color. In effect, what this would do is substitute your custom color or effect in the "turn off" routine for the lights. But this would have be altered in the code each time you wanted to change it to something different.
Adding an option like this to the current web interface it a bit more of an undertaking, as not only would the web app need significant update, it would affect a pretty big chunk of the underlying code.
So, is it possible? Yes. But it would take at least some code modification for a 'hard-coded' option, and a fair amount of code modification to make it an option from the front end web app. If you are comfortable and willing to take a shot at modifying the code, let me know and I can provide you with a few more details.
Hi, I greatly appreciate this and hope to do it in the new house we are having built because thankfully my wife thinks it's cool too so it's a win, win!
What is a logic level shifter and why is it necessary?
If I install one of these on each side of the steps, I would just set up the motion sensor / controller / and power at the top on one end and at the bottom on the other, right? Since this home is new construction, my intention is to install a wall plate with an integrated baffle to hide the controller, power adapter (?) and wires at each end next to the outlet set I will have installed. Make sense and any suggestions?
Lastly, is it possible to build this without soldering? I was hoping to use ELEGOO 120pcs Multicolored Dupont Wire 40pin Male to Female, 40pin Male to Male, 40pin Female to Female Breadboard Jumper Wires Ribbon Cables Kit to connect everything.
Hi... I'll try to answer your questions as best I can here in the comments.
First, the logic level shifter is used because the controller only puts out a 3.3V signal and the LED strips expect a 5V signal. If the wire run between the two is very short, you can sometimes get away without it. But I always recommend using one and use one on all my LED projects... especially ones where it might not be easy to get back to the controller and replace it if the signal voltage does become a problem.
Next, you will only need the controller and power supply at one end (doesn't matter which.. whichever works best for you to have access to AC power for the power supply). You do need a motion controller on both ends however. If you haven't seen it, I have a related blog article with the wiring diagrams, parts list and more: resinchemtech.blogspot.com/2021/12/standalone-led-controller.html
As far as the controller itself is concerned, I have another video that walks through the step-by-step process of building the controller: ruclips.net/video/ifv6wV3Rm6A/видео.html You won't install WLED when it gets to that part, but install the standalone firmware and you'll wire the motion detectors to the controller as shown in the linked blog above.
To be honest, my other version that uses WLED and Home Assistant is much more robust and has many, many more lighting effects: ruclips.net/video/Y29Y0iTLggg/видео.html But it does require Home Assistant for the automations. I only built this standalone version upon a request from a viewer that didn't want to get into the whole home automation scene. If you are having any thoughts about potentially using Home Assistant or other automation systems, you might consider holding off and building this second version. Let me know how it goes, or if you run into any additional questions.
@@ResinChemTech Thanks for your input! I understand a little more about the need for the logic level shifter. I have seen a bunch of other projects where the person did not use this. I am guessing it's necessity depends on the distance AND density or just the distance? Those projects were no longer than about 6 feet each. The LEDs would just be wonky for longer use without the logic level shifter? Also, the data wire doesn't have to make a round trip back to the controller does it, just one way right?
Yes... it's true that a lot of people don't use a logic level shifter. It's really about distance and potential voltage drop via the wire. Once the signal reaches the first LED pixel, it is automatically boosted to 5V for the next pixel (which is also why you can also cut off a single pixel, install it at the controller and use it as a shifter... known as the 'sacrificial pixel' method)... so it's just about getting a reliable data signal to that first pixel of the LED strip. But the signal coming out of the ESP is already at 3.3V and just barely enough voltage. For the $1 that the logic level shifter costs (and just a little bit more soldering), I recommend using one to assure no problem with the data signal... and I also don't have to be concerned about how far away I put the controller (well, within reasonable limits... but you can definitely put the controller a couple of meters away from the strip when using a shifter). Note that most of the experts (those more knowledgeable than me), including the developer of WLED, recommend use of the logic level shifter in most cases.
But like all DIY projects, the choice is up to you. Can you get away without one? Probably... in most cases... when the distance between the controller and LED strip is kept short. But I don't want to go through all the effort of building and installing something and have to worry about where I hide the controller, or finding I have signal issues after the install is complete because I didn't want to spend the $1 and an extra 10 minutes of soldering.
@@ResinChemTech Thanks sir, I much appreciate you taking the time to teach me! I have 2 last questions - for now...LOL! For 12v strips, is the data line still 5v or 12v and does that require a different logic level shifter?
I am guessing it is not possible to connect PIR motion sensors to/through WLED hence the reason for the code you came up with?
Well, I always check the spec sheets for the particular 12V pixels you are planning on using, but for WS2811 (and most 12V strip LEDs), yes you can still send the signal as 5V and use the same logic level shifter with your ESPx board. But also note that most 12V strips can only be cut at every 3 sets of pixels and not between every pixel. Also note that you will need to step down the 12V to the 5V needed by your ESP board using a buck converter or similar. The ESP dev boards has a voltage regulator on board... and these sometimes vary based on manufacturer, but feeding 12V directly to the ESP board is either going to blow the board... or it will get very hot. You could use two different power supplies (12V for lights and 5V for controller), but you need a common ground between the controller and LED strip or weird things are going to happen! I'm just curious as to why you'd want to use 12V strips in this particular case? Unless you have a VERY long staircase, you probably won't need power injection even for 5V strips... so using 12V strips just complicates things a bit here. And also note that the code that I wrote for the controller is using a library for WS2812b 5V strips. I haven't tested, nor do I know if it will even work properly with WS2811 or 12V strips.
As to your next question, the most recent release of WLED (0.13) actually does support the use of a PIR motion detector (it didn't when I first developed mine). I haven't tested it, but using two motion detectors in the manner to control lights on the stairs would be tricky, if not impossible using just WLED. While a motion detector can be set to turn the lights on (or off).. it currently cannot do both in just WLED alone. So, the lights would come on with the top motion and turn off with the bottom (for example), but they would ALWAYS work that way. In other words, the bottom motion detector could not turn the lights on as WLED would be defined to always turn them off with that motion detector. It might be possible to use some sort of toggle macro.. and this *might* work. WLED has come a long way and has added a lot of features, but I think it would take some pretty fancy macro/preset/playlist settings to recreate the stair lighting system. Maybe I'll try playing with it one of these days and see if can find a way to recreate the automations.
This is amazing work and have been wanting the same for my stairs but I’m not an iT person.
Wondering if I you sell the same ? Would be very much appreciated.
I've been asked this many times, but unfortunately I don't have the time or resources to build, package, ship, invoice and deal with all the logistics involved with making and selling any of my projects to others. And since each stair case is different, it would be nearly impossible to build a system that worked for every install.
The goal of my channel is to show others how to build these projects for themselves. You don't have to be an "IT person" to build this. In fact, for this project you don't have to write a single line of code. You just need to be able to do some basic soldering (and this project is a good one to learn soldering) and follow some written instructions. If you really like the project, I'd encourage you to give it a try.
Even though I can't build it for you, I'm always happy to answer any questions and offer any help that I can if you do decide to build you own.
Will the motion detector work on Holiday Time (LED) tape lights? They are the kind in a tube.
Exactly what I need
I've been searching for months now, but I can't find the solution. I want to use WLED (with the Home Assistant system, but I would also like to use it completely independently) with 2 motion sensors, but I can't find an instructional video on how to set it up anywhere.
I want to use it under the bed. If possible, make it work so that if the left side motion sensor detects it, then from left to right, but if the right side motion sensor detects it, then the red light strip moves from right to left. If there is no movement for 60 seconds, the light will fade. If the left-side motion sensor detected first, and then the right-side motion sensor, the right-side motion sensor should not overwrite the running of the light. It would be perfect if a lux sensor could also be installed, and it would turn it on depending on the brightness of the room.
Maybe you can make a video like this?
You would help me a lot!
I'm sorry, I only know minimal English. :(
That's pretty much exactly what I do in my other stair video: ruclips.net/video/Y29Y0iTLggg/видео.html
It uses Home Assistant, WLED and two sensors to control the direction of the LEDs. You'd just have to adapt the project slightly for your bed installation and adjust a few things in the Home Assistant automation code (for example, my lights go off after 15 seconds instead of 60)... but otherwise, it is nearly the same.
@@ResinChemTech Thanks, I watched the video and wrote a message under it.
Hi, I have some questions about this project
1. Is require that the motion sensor to be powered by controller board or can be power from an usb external ?
2. What need to be done to be powered external ?
3. If will be powered form the bored will not be a problem running long wires like 16 ft. for powering the sensors ?
Thank you for your time !
Your video is so awesome and I learn a lot, I'm a beginner in this any recommendations on soldering iron and wires that I can use for this kind of project ?
Even if you powered the motion sensors by another source, you still have to run the signal wire from the motion detector back to the controller. So the detector must be wired to the controller in this version, at least for the signal. There should also be a common ground... so that's now two wires that are needed between the sensor and the controller, so you might as well get the 3rd wire for power from the controller as well. The only way to have a sensor that isn't wired to the controller is to use something like Home Assistant to provide the automation between the sensor and controller... and that's what I did in my other stair video ( ruclips.net/video/Y29Y0iTLggg/видео.html ), but it does require that you are running Home Assistant to use that version.
As far as distance between the controller and PIR sensors, 16ft should be no problem. The connection to the controller is 5V and the PIR sensors will operate all the way down to 2.7V. So as long as you aren't using extremely thin wire (I'd say use at least 24 gauge, lower gauge if you can), 16-20 ft. should be no problem.
Welcome to the world of DIY electronics! There are a lot of good videos on RUclips regarding soldering tips. Don't be discouraged at first. I was horrible as soldering when I first started. But hang in there and you'll get better. A project like this is a good place to start. If I have any recommendations, it is a good soldering iron with the right tip, using the right solder... and flux is your friend! We all started out as beginners at one point. Let me know if you have other questions.
@@ResinChemTech Thank you so much for the answering my questions, I will start on this project. After is done I will get back to you with the results, I'm really exited to get started
In all honesty: using a(ny) microcontroller for a simple on/off function (be it IR based or a manual switch or whatever) is completely nuts. The IR sensors already provide a timer; a simple circuit with a handful components at most should do to drive a LED strip. You *MAY* not be able to set the color (depends on which LED strip you choose) but that would be the only difference.
Don't get me wrong here - My house is littered with these little buggers (Wemos D1 mini's). I'm just saying that it's nuts that, in 2021, stuffing a microcontroller into every simple project has actually become so cheap and simple that it's easier to do than wire something up of from a few basic components. And those microcontrollers are several orders of magnitude more powerful than the computers I grew up with (most notably the C64). Crazy.
I hear ya! (I had the TI-99/4A myself). I think the low cost and ease-of-use of the microcontrollers (just flash somebody else's code and hook up a couple of sensors or outputs) have brought a lot of people into the DIY "smart device" arena that might not have gone there otherwise... myself included. Personally, I enjoy the code development/automation scripting more than the actual electronics side of it... and the microcontrollers allow me to do that.
This particular project came from a couple of subscriber requests to duplicate my original stair light video that used WLED, Home Assistant automations, ESPHome, etc. down to a basic version that would run standalone. So I started with the same controller and just wrote my own code (my wheelhouse) to allow it function without all the external services. But I appreciate the feedback. I'd like to continue to improve my own knowledge and skill with basic electronic components.
@@ResinChemTech Again; not blaming you for going the μC route - I'd probably have done the same. Actually, I have for similar projects. Just crazy that we can. And do :-)
Amazing work as always..... Hopefully you will add some effects in the future.....
Thanks... it's on my long list of projects to get back to. I have a list of requested changes, including a version for ESP32 (although I'm not sure why... ESP32 is really overkill for this project).
While I'm somewhat limited in my ability to create certain effects with the current code base, are there particular types of effects that would be more appealing than others? Again, not sure when I'll have time to get back to this... but it is on the list!
Oh wow thank you for the reply.... I really like your work..
Did you do any projects that involve Hyperion?
While I have done a lot of projects that involve LEDs, I have a Hues Sync box and lights that currently provide audio and video synchronization for the home theater. If I had it to do over again, I might consider Hyperion. Other than that, I've done some videos on the sound-reactive version of WLED... but obviously that's just audio and not video.
I want to add leds to my stairs soon aswell, but im quite new to microcontrollers. I saw that wled supports pir aswell but i dont know if i could add two pir sensors like you to make it run. I would like to create an effect where the leds slides up (if i triggered it downstairs) and if they reached the top they stair on that would look awesome i think. Thanks for the video it will help me
While I have not tried adding a PIR (or two) to WLED, I think part of the issue would be dealing with the logic... for example, if the bottom sensor is triggered and the lights are already on (because of the top sensor), then turn the lights off.. otherwise, turn them on. Then there is the issue of once the lights are on, turning them back off after a set time has expired if a sensor isn't triggered again (otherwise the lights would just remain on). So, while I think that WLED could possibly use a PIR sensor to trigger the lights, I don't think it could handle the logic to treat the stair lights as I show in this and my related stair light videos. There might possibly be some sort of user mod out there for WLED that would make this possible, but I haven't looked for one. But if you do find a way to get something like this working with just WLED and a PIR sensor (or two), please be sure to share how you did it!
Hi...
I have installed this staircase standalone...
Can I swoop out the 5V led with a 12v led strip?
Regards
Spencer
Hi Spencer,
You'd likely have to modify and recompile the code. The code is specifically written for the 5V WS2812b (ex: FastLED.addLeds). Using a different type of LED may or may not work properly. It could be an issue as simple as having the colors wrong (you select blue but get green, etc.), or depending on the LED type, it may not work at all.
In addition, the controller is 5V only. So if using a 12V power supply, the voltage would need to be stepped down to 5V via buck converter or other means to power the controller. You could use 12V for the LED and a separate 5V power supply for the controller, but then you'd need to create a common ground between the controller and LED strip.
All this is to say that it is possible to use 12V LEDs... but not "as-is" by just swapping out the 5V WS2812b. It would likely require code changes and some different wiring depending upon how you opt to power the LEDs vs. the controller.
Thank you for the reply.... Best leave it the was it is, it's working 100%......thank you for for time as always
...
Have you tried the FTP2 by Aqara
I just followed this video and my esp 8266 will light up then goes off. But i can still connect to it from the browser. Its not controlling the lights. I wired on breadboard 5v dc to esp8266 and level logic with 2 pirs. 12v to 16' ws2811 rgbic. The led lights just lights up to white. No control
The lights turning on briefly at boot, then going off is normal behavior and let's you know the boot process has completed. By default, the code is written and specified for WS2812b (FastLED.addLeds(LEDs, NUM_LEDS_MAX);). In theory, it should work with 12V WS2811 LEDs, but I have not tested it and you may need to modify the original code in the line above.
To verify that the current code works with WS2811, if you open the web app and change the LED color for Motion 1 (without checking the box to save as new defaults). The lights should turn on for about 2 seconds with your newly selected color when you click the Update button. If this happens, then the ESP8266 is talking properly to the WS2811 LEDs. If you make this change and the lights do not briefly light up with the new color, try again and this time check the box to save as new default. The board will reboot and the lights should light up briefly in the new color upon boot.
If the board is talking and controlling the LEDs in the above, but not responding otherwise, then the problem is likely the PIR motion detectors. The lights will not turn on until the PIR sends the motion signal. Let me know the results of the above testing and we can troubleshoot further if needed.
Hi, its good but can not we use two motion sensors with esp32 having wled installed on it? This will not require home assitant dependency and all effects of wled will be available. Everyone will be ok to use wled either from browser or app ( off course w/o HA), I have been looking for wled+2 motion sensor option led light with turns on step by step but no luck so far
The challenge is how do you get the motion sensors to turn WLED on or off (and set the right effects) without using some automation system like Home Assistant. Now that WLED supports two buttons (it didn't when I did this video), you might be able to connect the motion detectors as buttons to the controller and use WLED macros/presets to have the motion detectors turn the lights on or off. I really don't know if this is feasible or not... and I have not tried it. I think the problem will be having one motion detector turn them on, while the other one turns them off... but the opposite when someone is going the other direction on the stairs. I just don't think this level of automation can be done with just WLED alone.
But you have to have "something" that takes the signal from the motion detectors and then uses logic to determine whether the lights need to be turned off or on (and set the proper effect accordingly). If you don't have Home Assistant (or similar), then you need a controller to do that instead. But if you do figure out how to do with just LED, then by all means, create a video and share it with the rest of us!
Hello sir the standalone_led bin file says it is unsupported. Not sure why. Im using a MacBook
New Sub -- ❤❤❤ this project!!
Thanks! I did this one as a follow up (and simplified version) of my original staircase video. A lot of folks wanted to try something like this, but aren't Home Assistant users and didn't want to install and manage Home Assistant just for this project (the original version required Home Assistant). So, I set out to create a version that would work standalone. It doesn't have all the various effects and features of WLED, but it does offer some basic effects and colors... without needing any external systems to run.
Thanks for the comment... and the sub! I greatly appreciate it.
Interesting! where can I buy the parts needed to put this kit together?
As listed in the video description, the complete parts list and wiring diagrams can be found in the written version of this project: resinchemtech.blogspot.com/2021/12/standalone-led-controller.html
Awesome,
can I achieve a slide animation in one direction with the first (i.e. walking down) PIR and in the other direction with the other PIR (i.e. walking up)?
That would make it look "smarter" :P
Yes. The web interface allows you to specify both an LED color and an effect for each motion detector. So, you can have the lights slide up from the bottom detector and slide down from the top. The features and effects can be found in the wiki of the Github repo, which is linked in the video description. A few additional effects were added after this video was made, so those are listed in the GIthub repo as well.
@@ResinChemTech That was literally the only thing I thought was missing from the setup in this video... looks like a project for the upcoming bad weather! Just need to find a way to hide the power feed, since I'll be working in the main room, not the basement! Thank you!
Good luck with the project. Let me know if you run into any problems or questions along the way.
Love this idea im new to all this but can this be done with just standard led strip ie warm white and is the process the same or is that scenario a completely different set up. I just want normal single colour leds with motion detection at top and bottom and a timed delay for time on
Hi Paul. I understand what you want to do, and my simple answer is "maybe". It will depend upon the 'standard' LED strip that you buy. The controller code is specifically written for WS2812b RGB LED strips. It might, or might not, work with other types of LED strips. It will NOT work with LED strips that require 4-wires, but only 3-wire 'clockless' strips for sure. I simply haven't tested my code with all the various flavors of other LED strips so unfortunately I just can't say for sure.
Just note that if you can use WS2812b strips, you don't have to use any of the effects or fancy colors with the code. The application allows you to select both effects and colors, so you could set it to just turn on with a solid color (even white) based on motion, and just turn off again after a predefined time.
Please let me know if I can help out any further.
@@ResinChemTech Hi i have now got all parts needed to build the stand alone version and went with WS2812b leds, Will the code allow me to have the strips turn on with say bottom pir then turn off with top pir and vice versa. Also how to i wire a LDR into the circuit and which type should i use so that the lights are not on during day light hours only when light levels drop to a certain level.....thank you for all the advice
First question is yes.. the code is written so that if motion is detected by one sensor and the lights are off, turn the lights on. If motion is detected and the lights are on, turn them off. In effect this means that if you start up (or down) the stairs, the first motion detector will turn on the lights. Then the motion detector at the opposite end will turn the lights back off.... if the second motion event is never detected, the lights will then automatically turn off after a time you set in the web application.
As to the second question, an LDR is normally connected to the A0 pin on the ESP board along with a 10K resistor. However, the code is not written to make use of an LDR and it would have no impact. The code would have to be updated to ignore the motion (e.g. don't turn on the lights) if the light level was above a certain value. This would also require updating to the web interface app to allow the user to set that light level value, etc. That would be something that you could do yourself (since all the code is available via Github), but isn't something I'm prepared to tackle at the moment.
As an option, you could add some other sort of device that would cut the power to the power supply using an LDR. Something similar to this might work: amzn.to/3Ma7iwy When the light level is high, it would simply cut the power to the stair system so it wouldn't come on. There may be other solutions, but this is the one that came to mind. In all honesty, this is where a home automation system (like Home Assistant) shines. It bridges the gap between disparate devices. In that case, it would be very easy to add a separate light sensor (not even connected to the stair system) and Home Assistant would tell the stairs to only turn on or off based on that light level. I know that doesn't help you here, but it is just a thought for the future.
Regardless of how you opt to proceed, I would recommend that you connect and test everything temporarily before you actually install on your stairs. It is much easier to troubleshoot and resolve issues on the "bench" then after everything is installed.
Let me know if you have any other questions. Good luck with your project!
@@ResinChemTech Thanks for the info it has given me food for thought as to how to proceed. I will of course test everything on the bench before fitting to stairs 😁😁
Really love this video. I'm searching for something like this, for a led strip under the bed. Can you also connect a LDR with it so I will only turn on if a certain level is reached. Next wish is the following. 1 motion and ldr for the left side only turning the left strip. And one for the right :) Hope you can give me some tips. Really love it. A++++++
You could certainly connect a photoresistor and modify the code to include that. The second part is a bit trickier. The code could be updated to only light up a portion of the LEDs depending upon which motion detector fired... that wouldn't be too hard. But the ESP8266 has only on ADC pin (A0) for a single LDR, so you'd either have to move up to the ESP32 or find a different way. If it were me, I'd just use a single LDR. If this was going in a bedroom and I only wanted to light one side or the other based on motion, I'd rely on the light level in the room from the single LDR to either enable or disable both sides, then use the two motion detectors to light the appropriate side only if it was dark enough overall in the room.
By the way, if you are thinking about trying this and starting with my code, you might give it a day or so. I will be releasing an update today that allows the settings to be changed from a web browser and to also upload new .bin files from the browser over-the-air. The code is done, I just need to get it documented and uploaded to Github. I hope to have that done tonight or tomorrow.
@@ResinChemTech Tnx for the mega quick reply. Your totally right about adding only one LDR, 2 pirs and do 2 ledstrips. Hopefully in the menu, you can choose to turn on left, right or both :) per pir and also make it working with a led strip with also white. I will look everyday for your update.
Many many tnx
Awesome video and info! I have duplicated this system and I love it! I am having one issue. At night the leds are randomly turning on as if something is tripping one of the motion sensors but there is nothing around to create movement. I am using the same PIR sensors you have. Have you had this issue or have any tips for me?
Thanks... congrats on building the system and I'm glad you like it. Actually, I did have that issue at one point in time. The lights would randomly fire on their own from time to time. I was able to track it down to one of the motion sensors. Once I replaced that (even with the same type), I've not had any 'mis-fires' for over six months. Fortunately for me, I was using my other "full" version with Home Assistant so I was able to see which motion detector was acting up. For this standalone version, you may just have to try replacing one at a time (I guess you have a 50% chance of getting the right one the first time!).
The motion detectors, I believe, are somewhat susceptible to electrical interference. So, if possible, try to keep your other power lines away from the detectors. I don't know if it might help or not, but you might try lining the motion detector enclosure with some aluminum foil or other type of shielding? Again, I think with some of these low cost motion detectors, there are probably some variances in quality. For me, with the same exact problem, just replacing one of the motion detectors with a different one (from the same brand), solved the issue. If all else fails, you might try ordering a different batch/lot of motion detectors... maybe even from a different seller. Just as long as they are AM312 PIR detectors, they should work and still have the quick 5 second cooldown period. Let me know if that works for you or if you have any additional questions.
@@ResinChemTech thank you for the quick reply!! Great information you've given me. I will buy more if that type and go from there. Thanks again and I'm looking forward to more projects!
Great job
Subscribed
Great project. I'm new to this, so please excuse my ignorance, but this seems to be a stand alone system, so why did you connect it to your network?
You need to connect it to your wifi to access it via your web browser to do things like change colors, the default "on" time before the lights shut off, and other options. And I've added additional features since I originally recorded the video, so you need it connected to wifi to update the firmware as well. It does only connect to your local wifi (and not the Internet - so it will continue to work even if your Internet goes out) and theoretically, once it is setup and configured the way you want, it should be possible to disconnect from the wifi. I haven't tested this, but know of no reason why it shouldn't work (well, at least until the power goes out and the controller restarts).
Awesome Video could you please compile a version for ESP 32 I have a few I could repurpose for this project thanks
Hi Joe! I can certainly consider that as my time permits. I don't think it would take a huge amount of time to create an ESP32 version in the code, but I'd need build prototypes, thoroughly test it, etc. which I'd have to find time to complete.
I'll follow up with a reply to this comment when I release an ESP32 version. Of course, if you have any experience with writing Arduino/C++ code, the original source code is available in my Github repo as well, so you could modify/compile this for the ESP32 yourself (I think it primarily just needs ESP32 versions of the libraries). If you do accomplish this, please feel free to submit on my Github and I would be happy to share with everyone!
Hi nice stair light do you have PCB schematic diagram
I don't have a PCB, but I do have a separate video on building the controller, mounted on a solderable prototype board: ruclips.net/video/ifv6wV3Rm6A/видео.html
There is also a related blog article with diagrams at: resinchemtech.blogspot.com/2021/12/standalone-led-controller.html You can find other related links in the video description.
@@ResinChemTech thanks
Can you use tof instead of the pri sensor and what would the wiring be for the tof
It's theoretically possible, but not with the current code as it is written. The ToF sensor uses I2C which would require different libraries in the Arduino code and updates to how the code works. While it is possible for multiple devices to share the same I2C pins on the D1 Mini, it also requires that the address of one of the ToF devices be changed.
I can consider a separate version of the code at some point that would support the ToF sensor, but I can't promise when I might have time to get to it. Of course if you are familiar with Arduino code, you can always fork my code and make the necessary updates. I just don't know if or when I'll have time to revisit this project with other current priorities.
Would it be possible to show how I can wire up the sensor to the board and I can get some help from a friend to help me with the code.
Oh sorry I wanted also to thank you for your reply and your video.
The wiring of the controller, including diagrams, are in my related blog article ( resinchemtech.blogspot.com/2021/12/standalone-led-controller.html ). Then swapping out the PIR sensors for the ToF sensors, and how those are wired is covered in the original stair blog article ( resinchemtech.blogspot.com/2021/07/simple-motion-activated-led-stair.html ). In this last article, if you scroll down, you will see how the ToF sensor is wired to the controller in place of the PIR sensor. Since you need two ToF sensors, but there is only one set of I2C pins, the two sensors are wired together then attached to the controller. You'll have to change the default address on one of the sensors, but info on that can be found online if you search for VL53L0X I2C address. I hope that helps... I really can't provide any sort of diagrams or drawings here in the comments.
Again thank you for great response and help. I’ve subscribed to your channel and excited to see what the future holds
Hi, how to make each staircase separate. I wish that when the motion sensor is detected then each step lights up one after the other at 0.5 intervals.
Since I don't know about electricity, I was looking for a kit where I could connect 18 separate stairs, but I can't find anything like that on the internet.
There are other stair lighting videos on RUclips that do pretty much what you are describing... but they are much more complicated from both a wiring and programming standpoint than the system I am showing here. They generally also run the LED lights horizontally across each stair tread... which requires substantially more wiring (and better ways to hide that wiring).
You could potentially modify my code so that just a section of lights come on at a time, with a delay in between, but that would be a set time and wouldn't synchronize with someone that might walk up or down the stairs at either a faster or slower pace. I also am unaware of any commercial/retail system that does what you are asking. It would almost certainly be something that you'd have to design, build and program yourself.
But let me know if you have any other questions.
@@ResinChemTech The stairs are already done with grooves and holes in hollow wall, so all the wiring will be hidden.
LED will be only white, every strip will be separate with separate cables, so basically 18 strips each 3-4 feet long with 18 cables (not one long LED strip ).
I can make it that when the motion sensor activates all LED glows, but i would like it that they turn on in 0.5s (0.4s or 0.6s we will se what will be the optimum) intervals.
OK... I think I understand your install. But how are you running the data line from the controller to the different LED strips? If you are running a separate line to each strip, they will always be treated the same. If you send out a signal to turn on a strip, all strips receive that same signal and will do the exact same thing (at the same exact time). If your signal line continue from the end of one strip to the beginning of the next, then it would be theoretically possible to have the program turn on the first section (for example, pixels 1-20), then delay for 0.5 seconds, turn on pixels 21-40, delay, etc. The controller sees the LED strip as a single entity with a set number of pixels... and each is addressable. For example... if you have a total of 300 pixels, the controller can turn on pixel 148 and turn off pixel 149. But if this signal is split between multiple strips, it is going to send that same signal to turn on pixel 148 to every strip (whether pixel 148 exists or not).
While you can run your power lines (+5V/GND) to each strip, to be able to control the segments of each step individually from a single controller, the data line will need to 'serpentine' between the treads... data flows out of end of one strip and then into the next... so that the controller sees it as one big LED strip. This would at least make it possible. My application is not designed for that effect, but it could probably be modified to do so. WLED has the ability to define segments (each stair could be it's own segment), but I don't know of any effect or option that would turn on each segment, in order, with a delay between each. It might be possible using playlists or something like that.
Let me know if I am misunderstanding (again)... or if you are planning something different in terms of running the data line/signal from step to step.
@@ResinChemTechI got a friend coming tomorrow , he said will will do it with raspberry pi.
Great! That's the nice thing about DIY... a lot of ways to accomplish the same task. Good luck with the project.
states threat to my pc when i try to download pyflasher can you advise please
This is probably because you are downloading an executable (.exe) file from the Internet, which most virus or other anti-malware software sees as risky. Normally, I'd agree if these files weren't coming from a reputable Github repository. You can also try ESPHome Flasher (github.com/esphome/esphome-flasher/releases/tag/1.4.0), but it is also an .exe file and you are likely to get the same warning. I can only tell you that I've used both of these programs successfully without issue. It is up to you to determine if you want to assume the risk of running an application you've downloaded from the Internet.
The other options would be to download the source files and compile an executable files yourself, use the Arduino IDE or other utility that can connect to the ESP board via serial connection to upload the file.
Would I need to wire both motion sensors to the same controller?
Yep... assuming you want to use two motion controllers, like at the top and bottom of the stairs. If you have a situation where you only need or want one motion controller, the second one is optional. Just specify 1 PIR when prompted during the software setup for the controller.
When using one motion detector, it is connected to pin D5. The second one is connected to pin D6. If you want to see the actual wiring diagrams, you can take a look at my related blog article for this project at: resinchemtech.blogspot.com/2021/12/standalone-led-controller.html
I like your channel 🔥
Is there anyway to get also a connection to Alexa ?
I don't believe so... at least not in the 'basic' standalone version, without some sort of "middleware" like Home Assistant. The full version that I did with WLED does have Alexa integration and both Google and Alexa are possible with Home Assistant.
I could add something like MQTT to my code, but it would still require an MQTT broker that would have to act as the 'bridge' to Alexa.
Looking at your web screen showing all wiring etc., for this standalone system, you show connection to 1 LED strip. May be a silly question but, if I am connecting to 2 strips as in your video with a strip each side of the stairs, do I just connect the second strip in parallel to the first? Cheers in advance.
Yes... that's correct. You take the LED data line coming out of the controller and simply split it and run to the LED strip on each side of the stairs.... along with 5V and GND of course. This is actually shown a bit better in both the blog and video on my other stair lights build that uses Home Assistant. This physical build is nearly identical, except for the connection of the motion sensors... and the firmware used on the controller.
Let me know if you have any additional questions!
@@ResinChemTech There are 5 leads on my 5v LED strips. I ordered - DC5V WS2812B WS2812 Smart 5050 RGB LED Strip Individuaily Addressable Light Tape/60 x 144Pixels/m Black/White PCB IP65. Have I ordered the wrong type of LED strip? If not, how do I connect them or indeed test them before I connect them up please?
If they truly are WS2812b, then look at the LED strip itself. You should see only 3 copper "pads" between the LED pixels. What you are likely seeing are two extra wires (red and black or red and white) on the provided starting and ending connectors that are used for extra 5V power injection if you need it. Are three of the wires connected to a JST connector and the remaining two wires connected to nothing? If so, it is the three wires connected to the JST connector that you need to use. In fact, I usually cut off the first pixel and built-in connectors and solder wire directly to the 3 pads on the LED strip. If you want to use the 3 pin JST connector, then you can cut off or cap the extra two wires.
Note however, if you are using more than about 300 total LED pixels, you may actually need to do power injection. In fact, you'll find another connector at the end of the strip which also has those two extra wires. If you need to do power injection (you'll know because the lights will start to fade and change colors towards the end of the strip... white will start to turn pink... or the lights will flicker). If so, you can inject 5V of power on these extra two wires.
You may want to review my video on using WS2818b LED strips, where I also talk about power injection and how to do it if needed, along with other tips on using LED strips: ruclips.net/video/GZjS51yBV4s/видео.html
The important thing here is that the LED strips only have 3 copper pads, or connections on the strip itself. It the strip has 4 (or even 5) copper pads between the LEDs, then they are not really WS2812b LED strips... and they will not work with this controller or project.
@@ResinChemTech Thanks again for the quick response. There are only 3 pads on the strip. If I simply connect the +5v and - ground supply to the LED strip, as a test, should the strip light up?
No... the LEDs will not light up without a data signal from the controller.
Hello, will you please offer an ESP32 version? Also can you show us the version with the chase effect? How does the chase work with the motion detectors on each end?
I can certainly consider an ESP32 version if I get the time to build it. Naturally, you can also take my code and update the libraries to ESP32 and compile a new .bin file as well using the Arduino IDE. But I'm curious as to why you want an ESP32 version. The ESP8266 is plenty powerful to run the firmware. The ESP32 is really overkill, adds nothing, and costs about 3x as much as the ESP8266.
As far as the chase effect, that is simply selected in the web interface for the controller . You select 'chase' for one motion detector and 'reverse chase' for the other. I actually show this setup in my Github repo wiki for this project: github.com/Resinchem/standalone-led-controller/wiki/04-Using-the-Web-Interface
@@ResinChemTech Thank you so much for replying! The honest answer to your question is embarrassingly simple - I have a bunch of ESP32 lying around but no ESP8266s lol! But after looking the project again I've decided to go with ESP32 after all. Thanks for your work and insight!
I get it! Use what you've got! I've had a couple of requests for an ESP32 version... and I'd like to go back at some point and create one. But beyond just updating the code, I'd have to build the controller and a bench rig and then do all the testing to assure that the ESP32 build works as expected. Then I'd also have to maintain two different versions moving forward. It just takes a fair amount of time and I have to juggle that with my "day job" and other projects that I'm working on. If you do build an ESP32 version, please consider adding it as a pull request in my Github repo! I'm sure others that would like an ESP32 version would appreciate it (as would I).
👍👍👍👍👍 good
hello brother, while the chase effect leds are shutting down, they are all shutting down at the same time. What should I change in the code so that the LEDs turn off sequentially? please help
The command to turn the lights off can be found under the toggleLights function. You'd need to modify this so that instead of turning all the lights off at once ( fill_solid() ) , it would more or less run the chase effect in reverse, turning each pixel off one at a time until they are all off, instead of turning them all off together.
Hope that helps to point you in the right direction!
@@ResinChemTech thank you very much but i can't do it i keep getting error😔. Can you edit the code for me please mate🙏. help me
is there anyway we can have different effects colors? thank you for your work btw how do I change to number of leds, i tried to log in mine 192.168.1.74 but it goes straight to WLED setting
Do you have the latest firmware (0.40)? The newest version allows you to change all the settings from the main web page, including the number of LEDs (pixels), number of motion sensors, color, light on time, etc. If your version is prior to 0.30, the only way to change the settings is to issue a reset command and change the settings as part of the onboarding. Please see the Github wiki for more information: github.com/Resinchem/standalone-led-controller/wiki/04-Using-the-Web-Interface
Great video. I have managed to follow it and flashed my chip. You said in the video (9mis 10 secs) you were going to explain how to change the settings on the phone . Any info on that please.
All that info on using the application and changing the settings can be found in the Github wiki: github.com/Resinchem/standalone-led-controller/wiki
Specifically, look at the section for Using the Web Interface for information on how to change settings. The phone is really only used for the initial onboarding to wifi. After that, all the settings are accessed via a web browser, as described in the wiki.
Glad you got it flashed successfully.