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.

LED stairs schematic. Click on the image for a larger view.

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. NOTE: The Ping library here is outdated and uses the BYTE keyword that is no longer supported by recent Arduino releases. I recommend using the NewPing library instead.

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.

82 Comments

  • Vito says:

    Erica, realy very nice. I`m new in arduino and I try to use you code but whit SR04 (4 pin sensor), can you help me how to change the code. Thanks in advance.

  • Erica says:

    Dear Vito, the SR04 is the ultrasonic sensor,, you can certainly use something else. You simply need to find or create code to interface your chosen sensor to the Arduino. Be aware that my code is no longer compatible with the latest Arduino software release, it requires minor changes (see the previous comments on this thread).

  • Phil says:

    I was able to get it working a while ago, but I am curious if there is a way to have the distance detected by the sensor reset after it runs or after a certain period of time. Basically if you leave something close to the sensor it goes continuously until the object is removed. Any ideas?

    Vito, I also used the sr04 and had no issue just needed a bit of recoding and a different library. Though if Arduino has been updated I’m not sure if it’ll work either.

  • Erica says:

    You could put some code after the distance check to get and set some global flags, and millis() can be used to get a time value. Only trigger the liights if there is a state transition. Should be fairly straightforward.

  • David says:

    Hi there

    Very good job with the LED stairs!

    I’m trying to do the same sort of thing, however I am having trouble with the code (I’m still fairly new to this).

    On your schematic, you are using fewer leds than i need, and im having trouble understanding how the ledstate[] and the for loops determine which leds the M5451 turns on. Please could you help me with understanding how to only turn on pins 2 to 13 or a set number of pins (I either want 12 or 14 pins to light depending if i have the top and bottom stairs always lit)?

    Im also interested in having the steps fade in and out but after hours of trying im still no further. Would you have any pointers to get the fade working please?

    Thanks

  • Darren says:

    Due to your inspiration, I’ve successfully built my first Arduino project; an LED rope-light backlit headboard for our bed that’s enabled through PIR sensors on either side. Maybe someday I’ll get around to putting it on the web.

    I saw this today on Sparkfun, https://www.sparkfun.com/products/11723 and wondered if it would provide sufficient pins, etc in a similar fashion to what you built to obtain more pins and power.

  • Erica says:

    Darren, that’s wonderful! I hope you post a link.

    The MUX shield covers the extra output pins (and input) but not the power issue. It uses the exact same shift registers I describe in my post, but costs $25 instead of $0.25, and is much larger. I don’t desscribe input in my post, but you can get cheap input MUX chips as well. So it’s a matter of whether the convenience of just using a shield is worth the money and size.

  • Erica says:

    David, sorry I didn’t see this earlier. One of the posts I wrote goes into detail about the Lightuino source code — look there for more information. I agree ledState is not obvious.

    I didn’t use fading but for LEDs one usually uses PWM. The question again is how to do this in the context of using the Lightuino code. Lightuino has its own Google code page so I would check there.

  • James says:

    Hi Erica,

    Really like this project, so much so that after i can get my iddy biddy head around all the states, shifts and other tech head mumbo jumbo i would love to hook up a light sensor to only activate during certain levels of light and have larger arrays of lights and sensors around the whole house to activate as emergency lighting…..sneaking into the house without waking people up is considered an emergency 😛

    MY problem at the moment is i have soldered it all up and it appears the code has uploaded correctly and the PING’s little LED’s periodically go ballistic but i can’t seem to get main LED’s to turn on.

    Besides including the Lightuino and Ping Library and changing the reoccurring syntax errors on one or two things, would any other code need to be changed? I come from 0 electrical background so the learning curve on this is huge for me but hope to make sense of it all.

    Also i was a little confused with the LED driver. I notice you feed a 5V into the bottom pin and then again into the brightness pin across a 1kw resistor. What’s the purpose of this?

    Thank you in advance with any light you could shed on this problem but understand if you are too busy to get back to me. Regardless, love the project and hope to see more wonderful creations in the future.

    Kind Regards
    James

  • Erica says:

    As far as debugging goes, I am a big fan of using lots of Serial.print statements. Are you actually getting to the part of the code where the lights are turned on, etc. Once you’ve confirmed that, you can start checking connections and voltages.

    You mention soldering — I’d start with a breadboard first, easier to fix if there are problems 🙂

    A link to the datasheet for the LED driver (M5451) is included on the project page, I would start there to get a deeper understanding of that. Basically though the bottom pin is the power supply for the chip, brightness is used to control the overall appearance of the LEDs. If that’s handled wrong that could prevent them lighting up.

  • James says:

    Hi Erica,

    Thanks for your speedy reply!

    I would love to tell you i have even the slightest idea as to what im doing but that would be a lie im afraid so your question regarding where in the code i am up to is impossible to answer as i simply do not know haha.

    I have been going through your code and my good friend google has been giving his fair share of help too but progress is slow.

    I suspect i may not have corrected the BYTE issue of the 1.0 release so am starting again to look through and better understand what is going on. On this note though, to solve the BYTE issue, would one simply just do a find and replace type of command or would something more drastic need to be implemented?

  • James says:

    YAY!!!! Lights are flickering away!!!!

    I think i understand the gist of it all now. My only concern is that it appears if nothing triggers the sensors they seem to switch off and i have to manually flick the reset on the board.

  • […] http://www.thekanes.org/projects/automated-led-stairs-howto Share this:TwitterFacebookLike this:Like Loading… Filed under Uncategorized ← HR Giger […]

  • Prabu says:

    Hi erica, i am looking forward in building your project and i was wondering if i could add 2 Push Button Switches (one on top and one at bottom or more like a 2 way stairs lighting switch) to bypass the Ultrasonic sensors to keep the lights permanently ON as i would like to keep the stair lights ON during parties (looks cool) and then switch back to the sensors once the party is over.

    How do i do it and which part of your code that i need to edit to enable such function and i am fairly new to arduino.
    looking forward for your reply.

    This is seriously a good project! Cheers!!

  • Erica says:

    Hi Prabu, thank you. Your idea should work. The loop() function is where you should start looking first as it determines when to fire the light sequences.

  • Anthony Fedele says:

    Dear Erica,

    Thank you so much for this webpage. You have inspired me to try my first Arduino project. I have some experience in Coding, Soldering, and fairly talented in construction. I am excited to try this and wanted to see if you have any changes that you would make in regards to updating this page.

    Thanks again!

    Anthony

  • Erica says:

    No changes, but I’d encouragee you to read through the several pages of ccomments on this project too ee what otheers have done. Thanks and good luck!

  • Evan says:

    Hi Erica, i really like your project and I really want to do it . I was trying to buy some 3 pin PING but very hard. Can I use 4 pin PING. And what I need to do for it . Please help me I’m really new for the arduino. But I’m little bit good for electronics. I like your project , that’s why I bought Arduino UNO. I need your help to get done this project. Thank you .

  • Erica says:

    Evan, a 4 pin unit should work fine. There are many librariies that should work with them, I believe Ping will, but I generally use NewPing theese days. Google and you will find it.

  • suliman says:

    Hi Erika
    Can you please help me with detailed instructions about how to program the M5450.

  • Lukas says:

    Hi i am very very interested in your project but i have a little problem. i am planning to use PiR sensor for my version of the device and i do not now how to change programming in order to replace PING to Normally/Open PIR sensor or just a simple light switch. Would you be able to help me with programming please ?

    Thanks Luckas

  • Alan van Wyk says:

    Hi – great work.

    Quick question, did you run all of this off the same power supply?
    I’ll be using an arduino uno (I have one lying about) – so guessing that the 5v from here should suffice (assuming it can deliver the amps required for all the lights)

    Thanks

  • Bryan Greifinger says:

    Hi Erica;
    Nice job on your stairway project!! Always a great feeling when they go as you want them to. Unfortunately it’s not happening for me and I’ve spent two days trying to figure out why. I’ve been looking to work with the M5451 recently and have been scouring for all kinds of information that might help me do it. I’m trying to light up individual (60) LEDs directly (only have 5 hooked up) but cannot for the life of me see what’s wrong. I have looked at a bunch of hookups for the chip which is exactly as i have it. I have tried Lightduino5 and i get no lights lit. I have tried one other bit of programming as well and nothing. I’m wondering if you might be able to offer me some guidance as to what possible problem(s) might be causing this. i’m not really a programmer but with basic code I can manage. Andrews code is way to complex and I’m sure I don’t need all of it. Not looking to dim leds or anything. just looking to turn them on and off in sequence.

    Any help would be greatly appreciated.

    Regards,

    Bryan Greifinger

  • Erica says:

    Hi Bryan, sorry I took so long to see this message (it seems e-mail notifications are not working). You may have solved it or given up by now. I’d suggest looking at my code as a way to get started.

  • Erica says:

    Alan, I did not want to have to bother with changing batteries so I am using an adapter to feed power into the Arduino, and also the voltage for the lights.

  • Erica says:

    I’m sorry but I don’t know anything about the PIR. I would hunt on Google for an appropriate Arduino library.

  • Erica says:

    Sorry you will have to look at the online documentation for that.

  • […] For more detail: Automated LED stairs […]

  • Vadim says:

    Hi! Thank you. Best tutorial I have ever seen. Any plans to make the same for LED Step lights with displays? I can’t find instruction for that 🙁

  • Erica says:

    Thank you! I didn’t create that other project, so can’t help you there.

Leave a Reply

XHTML: You can use these tags:' <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Copyright © 2024 NovoKane All rights reserved.
Desk Mess Mirrored v1.4.5 theme from BuyNowShop.com.