# Shift register daisy chain for Light installation

Hello there,

I’ve been knee deep in tutorials and forums for a week or two now trying to develop an electronic design for a light sequence of 81 LED rings… I haven’t found the answer to all of the questions just yet.

I’ve measured the current drawn by each individual circuit of LEDs and done the math, I’ve checked up on the data sheets of the components I’m using, and I’ve implemented everything I’ve learnt from all of the video tutorials and threads I’ve followed on forums like this one, but I’m still a little nervous that my inexperience will bite back at some point.

My three main concerns are as follows, though I feel that I may have them covered:

Problem 1: there are lots of lights!
Solution: 11 shift registers (can I even get away with that many SRs)

Problem 2: they’re 12v
Solution: a separate power supply and MOSFET STP16NF52 to step up the voltage

Problem 3: Overall current draw is 13.33Amps!!

If anyone wouldn’t mind glancing over the fritzing I’ve put together and give me some feedback I’d be very grateful. Recommendation or reprimand, anything to improve the piece and prevent a fire! There might be something daft that I’ve missed.

The fritzing diagram conceals some of the severed strips on the board under components - you might be wondering.

Thanks all very much.

Problem 1: there are lots of lights! Solution: 11 shift registers (can I even get away with that many SRs)

Yes you can, you will need decoupling capacitors on each shift register chip

Problem 2: they're 12v Solution: a separate power supply and MOSFET STP16NF52 to step up the voltage

What are 12V? Until that is known solution can't be evaluated but a MOSFET will not step up a voltage.

Problem 3: Overall current draw is 13.33Amps!! Solution: spread the power supply across the board to prevent overloading any one terminal.

So you have two 7A capable power supplies?

The fritzing diagram ......

Is totally useless for evaluating a circuit you need to post a schematic.

Remove that capacitor from pin 8, it will damage your arduino.

…Ok, so…

They are strips of LEDs that happen to be in rings, rather than tape. They all run on 12V and draw 200mA, 170mA, 130mA, and 100mA respectively. I am trying to control them using PWM via shift registers.

The total Amperage is 13.33A, and I have prepared two power supplies for this, yes. I will distribute the power across the board to prevent it from frying one terminus. The rings will never be all on at the same time, I have programmed them partially in a random sequence, but should the FREAK chances of them alighting all together play out, the circuitry should be prepared. I may also decide later to have them light together.

I will include a schematic I have drawn up in response to your post. Its shows only a small part of the eventual project), although I have not removed the capacitor yet, and I have also been inaccurate regarding the LED rings - indicating them only with a single LED.

I will also include a picture of the rings, because I think they are beautiful.

Thanks.

Grumpy_Mike:

Remove that capacitor from pin 8, it will damage your arduino.

removed and replaced as per De-coupling.

The basic idea is fine. If I were doing this then I would also do the following:-

I would put another 0.1uF on the other shift register. I would also add some large bulk caps to the board. Something in excess of 220uF.
If you are going to be switching that amount of current I would suspect up in the 1,000uF plus region in total.
Again just to keep things in spec I would put a 100R resistor in series with each FET gate to limit the peak current when switching, and perhaps a 10K pull down resistor from the shift register output to ground to make sure the FETs are off in that period when the circuit has powered up but you have not set any logic signals yet.
In fact you could connect the output enable from the shift registers to an output pin so you can control exactly when they come on after power up.

great, that's all good stuff.

I'll implement as much of that and get on with a few other parts of the project and I'll post an update so you can see what it becomes. It should become something quite pretty!

Thanks again Grumpy Mike.

Grumpy_Mike: Remove that capacitor from pin 8, it will damage your arduino.

Being always on the lookout for things that can damage the arduino after frying my first one i'm interested to know more about this.

Thanks.

m12lrpv:

Grumpy_Mike: Remove that capacitor from pin 8, it will damage your arduino.

Being always on the lookout for things that can damage the arduino after frying my first one i'm interested to know more about this.

Thanks.

Since making it myself, I have found this to be a very common mistake that probably originated here http://www.arduino.cc/en/Tutorial/ShiftOut

It seems that it is a fundamental misuse of the capacitor, which in this case, should in fact be placed in parallel with the vcc and ground of the SR.

Grumpy Mike's page http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html gives a clear explanation of this and is a far more credible source than myself.

My updated, full schematic. Labels top left.

have you looked into shiftOutX library http://arduino.cc/playground/Main/ShiftOutX it might make things easier. i am currently working on making it use SPI so it will be faster, and to be able to shiftout to more then 8 registers in a chain, im going for 16. but I don't think I can have it done until maybe next week.

I would control them via SPI.transfers also, will make PWM a lot faster.
Connect SCK to alll the shift-in clock pins, connect SS to all output register clock pins, and connect MOSI to the first chips serial in.

Then your data can be in an array of 11 byte, and refreshing the display is quick:

``````digitalWrite (SS,LOW);
for (x=0; x<11; x=x+1){
SPI.transfer (displayArray[x]);  // load data into input register
}
digitalWrite (SS,HIGH); // all outputs updated together
``````

you run that in a loop every 10 mS or whatever rate you want, while waiting for the 10mS to pass you update the array with 0/1s for the fade control.

juanh0238: have you looked into shiftOutX library

...No I hadn't, but a brief look makes me wonder of its suitability in contrast to one I had already chosen.

Actually, this one might be good for you too. From what I can tell it is a very well-put-together library, developed by Elco Jacobs. Check out his site and 'ShiftPWM' library here http://www.elcojacobs.com/shiftpwm/

Get back to me on this, let me know what you think. For me it seems great.

CrossRoads: I would control them via SPI.transfers also, will make PWM a lot faster.

Crossroads! Thanks, you've confirmed a suspicion I had put aside for the moment.

I've had a few long days of building and wiring on this now and hope have it running tomorrow. It's an easy modification so I'll look to getting it implemented during the week and post back on progress. With pics!

Thanks again

Sachem: ...No I hadn't, but a brief look makes me wonder of its suitability in contrast to one I had already chosen.

Actually, this one might be good for you too. From what I can tell it is a very well-put-together library, developed by Elco Jacobs. Check out his site and 'ShiftPWM' library here http://www.elcojacobs.com/shiftpwm/

Get back to me on this, let me know what you think. For me it seems great.

it is great thanks. the code is kind of complex I am new to C and C++ but still I am sure I will implement some of the code from it.

hello,

small update with progress and a video.

http://vimeo.com/35632736

For this scale of shift register cascade, I have found this layout (and design) to be quite unworkable. Also, for my application, I need something neater and more serviceable, so have chosen at great expense to redesign the circuitry using transistor arrays (ULN2308A).
I will arrange each shift register and transistor array alongside each other on one board so that I have easier, clutter-free access and sight lines to all components at any one time.

After I had the piece working briefly, it suffered a short that disabled much of the hardware and took me over a day to diagnose. Even then it was left quite uncertain. With the situation as it was, I decided quite quickly that the best course of action would be to start afresh with a new layout plan and would advise anyone working at this scale to think VERY strongly about simplifying their stripboard layout before embarking on soldering.

The transistor arrays will cut my need to branch out of copper strips and reduce the physical size of my boards by half at least, and placing them parallel to each other will place all of the LED cables at the back of the board so nothing need be obscured.

Stripboard prototypes

Ah, having read this http://www.thebox.myzen.co.uk/Tutorial/Power_Examples.html I now have doubts whether the ULN2308 can handle the job... I think it will overheat if I try to switch anything more than 95mA total with my 12v supply.

I may have to stick to the MOSFETS.

Has anyone got any input on this??

wow that is nice!