Automated LED stairs

After seeing the lovely LED stairs at, 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.


  • 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


  • elephantninja says:

    Awesome implementation!

    Red LEDs would save your night-vision.

  • Jeff B says:

    Those are awesome! Adding it to my list of projects now…

  • Erica says:

    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).

  • Robert says:

    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!

  • Terry says:

    This is wonderful.. !

  • Zak says:

    Erica – you missed elephant’s point… red light would illuminate your stairs while keeping your night vision… see this wikipedia article for more info.

  • Erica says:

    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 […]

  • Ravish says:

    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 […]

  • florin says:

    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

  • Erica says:

    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.

  • Joe Schulman says:

    Congratulations on completing this challenging task!

  • EE says:

    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.

  • Erica says:

    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.

  • Dylan Caffell says:


    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


  • Erica says:

    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.

  • Dylan Caffell says:

    Thank you ! il look into it 🙂

  • Vipool Patel says:

    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?

  • Erica says:

    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.

  • Stan says:


    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



  • Erica says:

    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.

  • Alan says:

    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.

  • Erica says:

    Good to hear, Alan. THank you.

  • IPF Group says:

    We also did a similar controller for sale. But you have a very good idea and implementation)

  • Erica says:

    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.

  • […] Инструкции и схемы данного решения можно найти на сайте автора. […]

  • Jim Mckay says:

    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)

  • Erica says:

    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.

  • stuart says:

    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?

  • Erica says:

    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!

  • stuart says:

    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).

  • Erica says:

    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.

  • Chris says:

    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!


  • Erica says:

    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.

  • Erica says:

    Fantastic! I love your video — the stairs look great!

  • […] запросами, нашел для себя очень простое решение в этом блоге, как раз на основе моего любимого микроконтроллера […]

  • IPF Group says:

    Erica . I have post on instructables . Maybe i’s answer to some you questions . Best regard

  • Placidus says:

    Hi team,

    Can you please help me with detailed instructions about how to program the Arduino promini.

  • Erica says:

    There are many sites that have great details on programming the rduino, starting with their own Playground. I would start there.

  • Wally says:

    Hi Erika,
    I have a very very little knodledge in electronics. Do you think that i could pull this project off by helping from this site? Asking this so i dont go and waste my time or money on it. Thanx again.

  • Erica says:

    Not sure that I can answer that question for you! See what I have here, maybe Google around about Arduino etc. and see what you think. There is never a guarantee that any project will be successful. Obviously one out of a book is likely to be more polished, you may want to start there first.

  • sergey says:

    Hello Erica, thank you for interesting article!
    Could you please explain the purpose of m5451? does it provide any kind of protection
    from high current? Why didn’t you wired LEDs directly to analog output of arduino?

    Thank you in advance!

  • Erica says:

    It does the same job as any LED controller. It frees up other outputs, and allows for the proper current and use of pulse-width modulation.

  • Ken says:

    Hello Erica,

    Thank you for sharing this wonderful project with everyone. The system I am interested in uses approximately 2 to 3 watts for each step for 14 stair steps. This totals to about a maximum power usage of 40 watts. I don’t think your LED driver or the Arduino can handle this much current. Do you have any suggestions on how I can implement this?

    Thank you.

  • Erica says:

    Ken, I am curious abbout your project!

    You may want to double check the specs for the LED driver, but if that doesn’t work, you should be able to use it as part of a hiigh-side switch, where it or the Arduino controls a circuit with a separate power supply. One of my firefighting robot posts has more details on something similar (I am away right now so can’t find the exact link easily).

    OR: just use a ULN2803 with the separate power supply, see my post on “Exxpanding the Arduino”

  • Darren says:

    I’ve always torn apart gadgets but never built any…until now. I’ve just ordered a bunch of parts to make a motion sensing light switch to use for my new custom built(by me) headboard…I hope it works. 😉

    I came across this site and would LUV to build this as well…let’s see how the first project goes.

    I’ve read through ALL your posts and have a few questions, I hope you don’t mind.

    1. Could I use the Arduino Due board that has 54 in/out pins and pushes 800ma power instead of the shift-register and thereby eliminate the M5451 altogether?

    2. Are diodes ‘sized’ I didn’t find any reference to a specific size.

    3. Do you have a picture of the finished product, soldered, mounted, etc?

    Fantastic work! I’m inspired and challenged to begin my Arduino adventure.

    Thank you!

  • Erica says:

    Darren, I am blushing 🙂 thank you. I will answer your question as best I can:

    1. I have never tried a Due, but here are a few things I would check before buying
    – does each output pin have sufficient current and voltage to power each LED (800 ma is current, not power, both may matter)
    – is there a TOTAL current limitation on the Due that you have to worry about
    – will you need PWM (pulse-width modulation) on your LEDs, and if so, does the Due have sufficient pins that support it
    2. I don’t think I use any diodes in this circuit? The things that look like them are LEDs. I believe for diodes you need to worry about breakdown voltages, above a certain point they will fail
    3. Ah well, no, just the video and photos on the blog. Most of the installation is inside the walls of my house. The circuit itself is on perfboard and mounted in an ABS project enclosure from Radio Shack, nothing fancy. One useful tidbit is that I used a grounding strip for the +5V on the LED wires.

    Thank you for asking this, it made me go back and look at my old post on adding power and pins to the Arduino. I realize that I can just use all these ULN2803As I have lying around to switch the fan on a robot, rather than using my hand-built high-side switch. That will simplify things.

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 © 2022 NovoKane All rights reserved.
Desk Mess Mirrored v1.4.5 theme from