Staircase project, part 6: finished!

And it looks great too!

This post should have been made 6 weeks ago or so, but I just couldn’t find the time with all the other things I wanted (and some which I just had) to do. But this week  I realized that delaying this post any longer would probably mean it would never be made, so I sat down, read my last post about this project to see where I had ended.

The Arduino Ethernet has been replaced by an Arduino Duemilanove, because when I found out how easy it is to flash an Arduino from a Raspberry Pi, the Arduino Ethernet wasn’t the best tool for the job anymore – an Arduino Duemilanove was a better choice actually – powered by a USB cable between the Arduino and a RPi meant that I didn’t need a power supply and flashing became a breeze. Another great plus was that I could now use Serial() on the Arduino instead of Ethernet.

So how does this contraption work? The Raspberry Pi that’s near the Arduino runs a Node.JS script. This script basically controls the ‘state’ in which the Arduino is.  With the serialport module this Node script can send commands to the Arduino like ‘reset’, ‘on’, ‘off’, ‘day’, ‘night’, ‘demo’, ‘stop’.

The reset command triggers a ‘reboot’ of the Arduino by jumping to address 0. The on/off commands are used to tell the Arduino whether it should act on the light barriers being broken or not, day and night tell the Arduino whether it’s day or night in our world (which has it’s effect on the brightness of the LED strips), and the demo command… well, you can do amazing stuff with 13 individual LED strips! 😉

And of course the Arduino is Serial.print()-ing everything it does: it reports when a light barrier triggers, changes in brightness levels of the LED strips and so on.

The Node.JS script on the Raspberry is partly controlled by the rules engine I use (for day- and night-mode obviously, and for ‘off’ when nobody’s at home.

But not everything went as smooth as I thought it would. After installing everything near the stairs (RPi, Arduino, 16-channel LED driver) something continuously triggered the IR light barriers! What the …? I checked every wire, and again, and again… but I couldn’t find anything wrong, so the only thing I could do was go back in time and reconstruct everything to how it was when it did work. From there I moved forward again until the problem came back. Conclusion, after a really long Sunday: interference. I used UTP cable (a single pair) to connect the IR light barrier LEDS to the Velleman MK120 PCB – this worked well during testing in the lab, but not in the cupboard under the stairs! Too many cables over there that influenced the signal on the unshielded wires I used. Stupid, I should have known this, I guess. I just have to face the fact that I’m not good at this kind of things… after replacing the wire with a piece of shielded microphone wire everything worked again.

Some last minor adjustments in the code here and there like the interval between each LED strip switching on and the project was finished – everything worked just the way I wanted it to, the visual result is impressive and worth all the time & energy that were needed to complete it all.

And here’s the long awaited video and some pictures I made of the end result; enjoy!


Tagged . Bookmark the permalink.

15 Responses to Staircase project, part 6: finished!

  1. Mark says:

    Really Nice!

  2. Rostyk says:

    Very cool
    So you use only 2 IR barriers or on every step (14)?

    • Hi Rostyk,

      Just 2, one at the bottom of the stairs and the other one at the top. In the video it may look like every step has its own IR barrier, but that’s because the actress (my daughter) has the habit of adjusting her pace to the ‘speed’ of the lighting sequence 😉

  3. Esther Hekkers says:

    That’s me in the video 😀

  4. Freddy Martens says:

    Ziet er goed uit Robert.

  5. Vincent says:

    Very nice project as well everything on your blog.
    Wish i had programming skills like you !
    Great keep it coming , very inspirational.


  6. jeff says:

    Love the idea I wish I could do this my self. you should sell kits or detailed instructions along with the code on how to build your own kit. If you do or are willing to do so let me know.

    • Thanks Jeff,
      That’s the nicest part of having a weblog: inspiring others and comments like yours 😉 But I’m not gonna follow up on your suggestions, sorry. I get a lot of questions, all in the same category as yours. All those questions could easily keep me busy all day, but this is not my day job (unfortunately). I’m sure there’s a lot more information on the web if you search for it.


  7. Dennis van Velzen says:

    After seeing the movie I was wondering why you didn’t use a smoother PWM (fade in, fade out), the light intensity seems to jump from like 20% to 100%…. But the result looks really cool!

    Got this idea also laying around but using 16 1W LED WW spots in border on each step, a 16 channel PWM IC, 16 logic FETS and use two distance sensors (bottom and top).

    This is one of the things that are somewhere at the bottom of the list. Regarding the (un)shielded cable issue, sometimes it helps to use pull-down resistors. But using shielded cable is always a good idea.

    Still find it strange the the power supply cables of LED strips aren’t shielded by default… because of the high freq. PWM signals.

    Groeten, Dennis

  8. Pingback: LED Stair Lighting Hack with Raspberry Pi | Homautomation

  9. Wally says:

    Ik heb deze gemaakt met een pic 16f628… werkt perfekt

Leave a Reply

Your email address will not be published. Required fields are marked *