Automated LED stairs
After seeing the lovely LED stairs at interactivefurniture.de, I decided to make my own, open-source version. Here is a video of them in action. I am not an expert videographer and cannot do the stairs full justice, but they came out exactly as I wanted.
In this clip I use a very simple lighting sequence without any dimming. However it is easy to program the stairs to do any light sequence desired, with up to 34 LEDs per controller.
My build was featured in Make: Online.
This is the schematic. I wired it up with perfboard and used screw terminals to connect to the external LEDs and PING sensor. The Eagle schematic file is here and should have the correct footprint for the chips; if you plan to make a PCB version it would need to be edited and checked, as I did not use it for that.
My code for the Arduino Processing environment can be found here. You can edit this to add more lights, or to use a different lighting sequence. This code uses the Lightuino source code to drive the M5451 and I am very grateful to have it, as it saved me writing hardware-level code.
Materials:
- Arduino Mini Pro. Any Arduino should work; this was the right size and price for me.
- M5451 (available at multiple suppliers; use Octopart.)
- NorthStar 12V LED lights
- Bell wire rated for indoor use. Get more than you think you need.
- PING ultrasonic sensors (2). The circuit will work with other sensors as well, just change the code accordingly. PINGs are not the cheapest option but I had them handy.
- Perfboard
- Screw terminals
I also used a ground bar for the 5V needed by the LEDs and sensors. To keep things simple, I powered the M5451 with 5V like everything else; even though the LEDs are specified for 12V, this worked just fine. However, you can feed up to 15V into the M5451 at VDD if you want more powerful lights.
For a deeper understanding of how the circuit works, please see Expanding the Arduino: cheap ways to add output pins and power. For details on the build process, here is the complete list of LED stair posts.
Important safety note: In any project that goes into the walls of your home, an electrical fire is the greatest risk. Please be sure to use a fuse on the power input to your circuit (I used 1A on mine), and ideally your power supply will be self-limiting as well. This is more than just theory. I had a connector go bad after installation, creating a short. The fuse blew, as it should, preventing a more dangerous situation.
If you find this information useful, please let me know. Comment here (with a link to your project if you have one), or e-mail me: erica AT thekanes.org.

Awesome implementation!
Red LEDs would save your night-vision.
Those are awesome! Adding it to my list of projects now…
Thanks! Elephant, any color or style of LED should work, as long as it can be driven by the M5451 (which can take a power supply voltage up to 15V).
Nice project and implementation! I really want to make one of these myself and have been sitting on doing this project for a while now. Maybe seeing another implementation will get me off my backside and get going on it.
Keep up the hacking!
This is wonderful.. !
Erica – you missed elephant’s point… red light would illuminate your stairs while keeping your night vision… see this wikipedia article for more info.
Thanks, everyone! Zak, I did get it
my point was that one can customize for whatever works best. Night vision is not an important issue for me as it happens, but it’s a cool idea.
[...] Kane has developed an Open Source DIY Automated LED Stair Lighting system. It uses an Arduino Pro Mini as the brain and a M5451 LED Display Driver to power the LEDs. She [...]
This is like so awesome!
Starting off on Arduino for the first time, moving on from 8051, and this damn inspiring.
[...] Kane has developed an Open Source DIY Automated LED Stair Lighting system. It uses an Arduino Pro Mini as the brain and a M5451 LED Display Driver to power the LEDs. She [...]
I want to do a project like yours. just as I look at the schedule, do not know how to connect wire 5V, GND. and where.
Please help me! Thank you in advance
Hi Florin,
The 5V and GND represent connections to your power supply, whatever that is. I used an adapter with the plug cut off and its wires connected to the screw terminals instead. You may be interested in this blog post:
How to add a power strip to perfboard
Please be sure to include a fuse in the circuit, for safety.
Congratulations on completing this challenging task!
Do you think we can replace the ultrasonic sensor by a weight sensor that we can install under the stair first and last step? The issue I have with the PING ultrasonic sensor is that I want to be able to hide discretely the sensors is some way that is not visible to the people using the stairway.
Any ideas or comments are welcome.
EE, any sensor that you can control with the Arduino should work just fine. I was told that weight sensors wear out over time, so you may want to install them in a way that allows for replacement later.
Bear in mind that the lights themselves will be visible to people. I found the PINGs pretty discreet, especially since very few folks are looking in that corner as they go up.
Hiya
This is a fantastic project very well done
I have a quick question though (my uslessness with electronics stops me figuring this out but an electrician friend helps me install what i need)
Can the contoler Support 3w LED Bulbs?
As i have 16 colour changing LED’s to change the stair light colour
The not so good controler i have on my other stairs cant support 3w bulbs and docent do the great fade effect
Dylan
Dylan, I believe the answer to your question is yes. But I recommend that you have your electronics friend look at the specs for the M5451 (I’ve provided a link in my post). You may also need to edit the Arduino code to control the special effects.
Thank you ! il look into it
Hello Erica, for over a month I have trying out your Stair LED project with great success due to your clear explanation. Coming from a background of zero electonics knowledge it been a good learning curve. I even managed to swap the ping sensors for PIR sensors, changed the code after a few days trial and error. Also extended from 10 pair of LED to 15 pairs, again with change in code. Next was a photocell and again change in code. Great success thanks to your blog.
My final challange has been to fade the LED’s “off” – I have struggled at the code for past 6 days to no avail! Have tried the “analogWrite” with a count loop from 255 down to 0 with no success. Googled extensivly but only understand those links that refere to “analogWrite” anything else if over my head. Is there any chance you can give a little direction based on your Climb and Descent sub routines?
Vipool, that’s wonderful! I’m glad to hear you’ve had success with the project; please post a link when it’s finished.
As far as the fading, that is something I did not play with, but the M5451 certainly supports it. If you are looking to fade all the LEDs at once, the simplest way might be to control the Brightness input on pin 19; in my schematic I connected it to 5V but you could connect it to an output pin on the Arduino instead. If you want to fade the LEDs individually, which I guess is more likely, you will need to dig into the Lightuino source code (see link above) rather than mine. The sinks.set() function in my code may need to be called with extra parameters, or replaced with a different function. Lightuino is open source with decent comments, and they even have a Google group where I think you can post questions. I am almost certain it supports LED fades, because that is so common a need. Generally for LEDs and fading you’d be looking at pulse-width modulation (PWM) rather than analogWrite. Hope this helps. I wouldn’t mind knowing how to do it myself, so if you find an answer please post it.
Erica,
Which Northstar LED did you finally use?
LED Output: 20-25° – 5800-6500K, 18,000mcd Cool white @ 20mA – 2.8 watts/60 lumen – Spotlight
LED Output: 40-50° – 5800-6500K, 6500mcd Cool white@ 20mA – 2 watts/40 lumen – Floodlight
LED Output: 30-40° – 3200-3800K, 6000mcd Warm white @ 20mA – 1.7 watts/30 lumen – Soft Incandescent White
Thanks,
Stan
Stan, any of those should work, as they all run off of 12V (and have the same physical dimensions). I believe I chose the 20-25 degree spotlight option.
Thanks for building this project! We just had a customer purchase one of our systems because they loved your lights but didn’t have the ability to build their own. Keep up the great project building.
Good to hear, Alan. THank you.
We also did a similar controller for sale. But you have a very good idea and implementation)
IPF, I like your video. It isn’t clear from your site how you install the LEDs in the stairway or attach them to the contoller. I found those the most challenging aspects of this project.
[...] Инструкции и схемы данного решения можно найти на сайте автора. [...]
[...] [...]
Hi Did you get the PWM dimming working to fade the LED’s on and off. Also is it possible to have a photocell to check if daylight (and not light in that case)
You could certainly add a photocell, the Arduino has plenty of unused pins. I was not that interested in the PWM so I haven’t tried it, but I believe the LED IC chip has that — it’s pretty standard.
@Erica,
Very cool project. I built the circuit on breadboard, loaded the code. but I get the following error:
‘Ping’ does not name a type
As of Auduino 1.0, the ‘BYTE’ keyword is no longer supported.
Please use Serial.write() instead.
Can you or someone help?
Also, where do I download ping.h?
Thanks! The PING library is on the Arduino Playground, I believe. If not a Google search will find it easily. It is very popular.
Interesting about the 1.0 change. I put that on my Linux box, and some well-known libraries wouldn’t compile. I had to make some fairly straightforward changes to them by hand for things to work. My LED code may be out of date, then; if you upgrade it, please let me know!
I cleaned up the ton of errors due to the BYTE change. Now I’m down to one error and I can’t figure it out. The error is:
In file included from m5451Mega.cpp:31:
/Users/stuartriggs/Documents/Arduino/libraries/Ping/Ping.h:22:22: error: WProgram.h: No such file or directory
Can anyone help please. I have everything connected on the breadboard and ready to go (lol).
Replace WProgram.h with Arduino.h in the Ping library (and anywhere else WProgram.h appears). That should do it. I’ve had to do that to any number of third-party libraries since upgrading to Arduino release 1.0.
For the record, the code here was originally compiled against Arduino release 0.17.
Hey Erica
I love your Automated LED stairs and I’m trying to put it together myself but I’m having a little trouble with modifying the code, I can’t figure out how to make your own pattern. I’ve cut away all the ping sensor code (because I plan to use photosensitive resistors and some little laser diodes instead) and am left with just the pattern on a loop. The pattern begins at pin 11 and travels up to pin 2 in sequence, how would I go about making the pattern start from pin 15 and travel to pin 2 instead? Also how would I make a similar but independent pattern on the other side of the chip? I have two sets of stairs in my house and want to have lights on both but independently triggered. Any help or tips on how to make your own pattern would be greatly appreciated!
Thanks
Thanks, Chris! In the code there are ledState arrays of bytes, with bits corresponding to a light, 1 is on and 0 off. There are comments in the code as to which bit of each array element corresponds to each light. You need to understand bit operations. I only used 2 through 11 so you would need to figure out where 12-15 are yourself — just hook things up to a breadboard and start playing. There was some discussion on LED addressing in this post as well: LED stairs: the chips are talking including a relevant comment by the author of the Lightuino code.
Thank you Erica! I did it! I changed your code to other sensors. Increased the number of steps of the staircase.
http://www.youtube.com/watch?v=tSw2xWd9zGQ&context=C491817bADvjVQa1PpcFMRoZb61Np2bWMfqP4Qv6MG6-cS7HgE8Nw=
http://lukjanow.ru/2012/04/automatic-illumination-stairs-arduino/
Fantastic! I love your video — the stairs look great!
[...] запросами, нашел для себя очень простое решение в этом блоге, как раз на основе моего любимого микроконтроллера [...]
Erica . I have post on instructables http://www.instructables.com/id/Automatic-Led-Stairs-Controller/ . Maybe i’s answer to some you questions . Best regard