LED stairs: the chips are talking

Posted by Erica on Sep 27, 2010 in Electronics, Making |

In my last post on the LED stairs, I discussed using the Arduino and an M5451 driver chip to control the lighting sequence. Today, I completed my first breadboard version:

Arduino and M5451 LED driver

Arduino and M5451 LED driver

The Arduino Mini Pro is on the left and the M5451 is on the right, positions I will reverse in the final design. I used LEDs that I happened to have on hand so it looks a little odd. The large one with the white shield, towering over the others, is the type I plan to use on the stairs. It is a NorthStar NS 20 CW 20° LED Fixture.

I used the Lightuino source code to make the Arduino talk to the M5451. My needs are fairly simple, I just want the lights to go on one by one, then turn off after a delay. For the most part I was able to get what I needed from the begin_here3 sketch included in the Lightuino. However, the Lightuino is designed to control 70 individual LEDs (it has two M5451 chips, each chip can handle 35 LEDs). The code uses a byte array of length 9, where each element has 8 bits, each bit turning an LED on and off. This is pretty simple, but the addressing is very odd. I would have expected the first element of the array to control the first 8 output pins of the M5451. It does not — instead, given pin 0 in the upper left, it starts from the output pins in the lower left and goes backwards. Once I figured this out, the code became very straightforward. (I will be posting my code once the project is complete.)

The only real difficulty I experienced today was in getting the chips to sit squarely on the breadboard and make a solid electrical connection. I soldered in header pins for the Arduino Mini Pro and I think they were not perfectly straight (though extremely close) and that was enough to cause a problem. The needlenose pliers came in handy. For the M5451 I had a socket, and that too had problems fitting in, not caused by my soldering! Pliers and pressure came to the rescue in that case. For programming the Mini Pro I just put some male headers on the FTDI cable and held it in the right place, no soldering — and to my surprise, that worked quite well.

I have spent quite a lot of time ensuring that the design will be as fireproof as possible. I rarely see this issue discussed in the designs I’ve seen, but a house fire is the most dangerous side effect that can happen from an electrical project. Of course we are talking fairly low voltages and currents, and maybe that is why people don’t worry as much. I spent a long time on this step and talked to a lot of people at HacDC, and maybe I overthought it. At any rate, here is what I came up with, and maybe it will help someone else:

For in-wall wiring, I chose this bell wire. It is UL class 2 rated for up to 300V, and the description says it all: “Low voltage cable with insulated solid conductors resistant to spread of fire.” This is a safe and economical option. Other options I came across were speaker wire (overpriced for my needs — I don’t need a clean signal protected from interference) and ethernet cable (didn’t like the idea, and the wire gauge is smaller, not an improvement).

For wire-to-wire connections, I will use wire nuts. Because of the low voltage involved, I do not need to make the connections in an electrical box.

The room where the controller will sit does not have a power socket — it is an unfinished part of our basement. This is very convenient for running wires, but I will need power. I looked into installing an electrical socket myself, and it is certainly common for homeowners to do most of this followed by a certified inspection afterwards. But, for now I will just run an extension cord from the other room.

Tags: , ,

8 Comments

  • Andrew Stone says:

    Hi Erica,

    I’m glad my code was useful to you! Why I use that odd enumeration. Looking at the spec it seems that I am doing it “backwards” — that is, not in READING order. But in fact it is forwards in written numerical order because numbers are written with the least significant digit last. Welcome to the endless debate and schism called endianness.

    WRT pin alignment… on the pro, next time breadboard the headers in FIRST, then the board on top. THEN solder (at least a few connections). That way you get the alignment correct. On the MM5451 (and other DIP chips)… that’s a feature not a bug! The purpose is in case some pins are bent a little in shipping. So the pins are shipped bent a little wider and you need to bend them all in a little just before socketing. Using pliers was probably painful :-). Next time place the chip on a flat table on its side (so all the pins on one side of the chip are flat on the table) and then carefully press on the chip with your fingers to bend all pins in a little bit. Repeat on the other side!

    WRT fires. You can use ethernet for these voltages/currents. You are significantly lower than the amounts required by thepower over ethernet spec. I can’t see the copper thickness (AWG) for your chosen wire on that website. It is almost certainly fine, but check it against a wire load calculator or chart. Also DO NOT put > 12v across the MM5451 or you could smoke the LEDs. And its a good idea to size your DC wall wart transformer to about 1 volt over the required LED voltage (verify the transformer’s output with a meter, what is printed is often the minimum not the actual). This will reduce the heat generated within the M5451 chip.

    You’ll also need a very long drill bit to drill thru the 2x4s in your walls. Wall snakes are great for going up and down but not so good horizontally :-). You can get that at home depot. Be patient and beg your husband to help — threading wires can be frustrating. When you get it through attach a string and your wires to the snake with a nice smooth wrapping of electrical tape and GREASE it (with hand lotion, for example) if your pull is long. Leave the string in the wall so you don’t have to snake again!

    Please keep posting! I’ve always wanted to do a stairwell but haven’t found the time. I’m particularly interested in what you use for sensors. And please join us at http://groups.google.com/group/toasted-circuits-lightuino . We welcome anyone fooling with the M5451 and LEDs not just people who bought my board!

  • Nathan says:

    Hi Erica,

    I see you haven’t posted in some time. I’m very keen to replicate this project and was wondering if you intend to continue with it?

    Thanks,

    Nathan

  • Erica says:

    Nathan, yes, I am. I have been distracted with a few other things, but there has been progress; mainly I am hesitant about drilling the holes in the wall!

  • Erica says:

    Thanks, Andrew. Your code has been very helpful. I am aware of the ethernet option but didn’t want to do it for various reasons; I’m going with bell wire instead. The LEDs I have are packaged, not bare, and meant to run at 12V. However I will likely go at a lower voltage anyway for convenience. I have a wall snake (there is a post on it somewhere on the blog) and I don’t think I’ll have to go through any 2x4s; truth to tell this is the easiest possible snaking job, because I can literally drop the wire straight down from the stairs into the unfinished basement!

  • Larry says:

    Hi, Erica!

    Funny, I am working on almost exactly the same thing – including the NorthStar lights (I actually found your site via a search for the arduino and 5451 chip) except that I am using a 5450 chip and an ambient light sensor to control the brightness of the lights. I was considering either IR beams or proximity sensors, but the former is easier to conceal in my installation. Unfortunately, I am stuck on the LED driver at present using the lightuino code. I was hoping for a series of fundamental examples like “turn on an LED on O25” but I must resort to wading through the code to figure that out. I’ll probably end up writing my own by the time I boil it down to what I need because it should be pretty simple.

    Best of luck!

  • Erica says:

    Thanks, Larry! I am using the Lightuino code, because writing the hardware driver is not something I wanted to get into. Once you figure out the bit shifting, the code is pretty easy to use. Look at lightuino.h, sinks.set is the function I’ve used almost exclusively. I believe there is a “beginHere” section somewhere in the code that gives some examples.

    I will ultimately post my Arduino sketch up here. I am making progress on the stairs — wrapped up the cutouts for the PING sensors this week — just distracted with other things too.

  • Yuli says:

    Hello Erica,

    Very nice project. I’m trying to make the same. but stucked with individual LED turning on and off. Can you, please, share your code?

  • Erica says:

    Yuli, all of my code is available at the automated LED stair lights project page. Good luck!

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.