RGB SMT LED Cube, resistors, drivers, and shift registers.

I made a new cube using some SMT RGB LEDs, Im using these 5050 SMT LEDs I found on ebay.
This is the specs i have on the LEDs, I've written the ebayer, but they wont be back for a couple weeks.

RGB PLCC -6 5050 3-CHIPS SMT SMD LED Light
VF Forward Voltage
Min2.9 Max 3.6
Luminous Intensity
Min 4000 Max 5000 mcd
Power Dissipation 200 mW
DC Forward Current 60 mA
Reverse Voltage 5V

I've built the cube using common cathode, assuming thats how most of other rgb cubes are setup.
The LEDs have 6 leads, so I could build it either way, or even use them in series.

I had planned on making a matrix, but it turned out to be too difficult to solder up, and i found that I can just buy a nice SMT RGB LED matrix for under $10 so I abandoned that idea, but I made up a 32 bit shift register out of 4 74hc595s.

I figured i'd use it with this cube, but then I realized that I will need to control one plane (48 LEDs) with it, and 32 bits wont work unless I cut the planes in half, which would be difficult. Had I made 2 1/2 cubes, and set them next to each other, it would work... but I have 1 cube.

So, I built a big 56 bit shift register tower (7 chips tall) I figure I will use 48 bits for the LED anodes, and 4 bits for the planes (cathodes), and have 4 dummy bits (but they could be used for additional features).

If I use shift registers, i will need resisters, and im not exactly sure what the forward voltage is on these leds since the only info I have lists one voltage. I tested the leds with 3 volts, and the red ones were really bright, too bright, but the didnt blow from quick testing 3v. Based on looking over specs on several 5050 leds, my guess is the forward voltage is 2.2v Red, 3.2v Blue, 3.2v Green

From 5 volts, 100ohm should get me close on the blue/green ones, and 150 on the red.
Since I dont really know what these LEDs should use, I figure i can experiment with resisters on a spare LED to try to dial in the right resisters for each color, but maybe there is a better way?

I have also been revisiting the idea of running the shift registers at 3.3v instead of 5, reduce the 5vs to 3.3, and resister the data pin so that it gets 3.3v from the arduino. I was thinking maybe having a voltage regulator (like an lm317) drop the voltage from 5 volts to 3.3. Then I would have to resister the red LEDs, and run the other leds on 3.3v

Is that a reasonable solution?

Im also considering just using LED drivers instead, just to be easy... There seem to be many good LED drivers, which would be a good one, and why?

I've read some posts here that mention TLC594?, max232,ws280?

I have an uno for developing it, but I plan on running it off of a nano, and hopefully a small inexpensive power supply (like used for charging cell phones)

I also have a real nice power supply from a DVD player, it puts out 5, 12, and 24v, but i was hoping to save it for something that needs a lot more current (like a burning laser!)

So... im interested in ideas about how to control the cube best, I have shift registers, and can maybe scrounge up resistors (or just order some online...), but I will probably have to order resisters online, and maybe i should just order some inexpensive driver chips instead?

Oh, i just realized that I have some ULN2003 chips (they are in circuits, but I can unsolder them.)

but maybe there is a better way?

Yes you have the LEDs, connect them up with something like a 330R resistor and actually measure the forward voltage then you can do the math correctly to get your current.

I have also been revisiting the idea of running the shift registers at 3.3v instead of 5, reduce the 5vs to 3.3, and resister the data pin so that it gets 3.3v from the arduino. I was thinking maybe having a voltage regulator (like an lm317) drop the voltage from 5 volts to 3.3. Then I would have to resister the red LEDs, and run the other leds on 3.3v

Is that a reasonable solution?

Absolute crap solution.

  1. The shift registers cannot supply the current.
  2. You always need a current limiting device with an LED. LEDs

maybe i should just order some inexpensive driver chips instead?

No as well.

but the didnt blow from quick testing 3v.

Told you so, :slight_smile:

Is that a reasonable solution?

Yes. Essentially the output resistance of those shift registers act as the current limiting mechanism here.

The risk you run, however, if the leds have wildly differing forward voltage drops, you may not be able to turn some of them on.

Here is an interesting design that you may want to think of. It is for singles but notice that a) it is done without the use of shift registers - think very hard about that; b) it is done without resistors either.

http://www.doyoung.net/works/CUBE8/index.html

Youtube has a video. Check it out.

I like the implementation of touch-based power button. I think its light-sensing can be improved.

Thats quite the interesting cube. 128 control lines to control 512 LEDS.

I see the touch button thing, it looks like they use a photo resistor, and maybe capacitive touch on the other button.
Heres a video of a guy that made circuit boards on glass slides, They use capacitive touch, and you can operate it from back of the glass (not the side with the traces).

I thought it was pretty awesome just because the circuit is on a see through board, but its even cooler as a input device!

I have to salvage some resistors to do some testing, and see if I can figure out the appropriate voltage for each LED.

I did read your webpage about LEDs Grumpy Mike, I assumed as long as you had the right voltage to feed your LED, you dont need to worry about current. As a test, I ran a blue LED on 2 D cells, Im not sure what the forward voltage on the LED is, but my guess is close to 3v. The circuit was simple, 2 batteries and an LED, no current limiting resistor, or any other fancy bits. Based on your webpage, it sounds like I have stressed the LED, but it did not seem weaken the LED any. Im confused, or conflicted, im not sure...

The Shift register way seem a bit more clunky, but thats also kind of appealing. The components will be on display with the cube, so a stack of shift registers, and resisters might be extra cool looking, but not as nice of a way to control the LEDs. I think its kind of interesting how I got 2 totally different responses. Mike, why is the shift register way crap? Im not criticizing, im curious about what is good and what is bad about things. Im also unclear on what you mean by "no as well"

I just converted my old 4x4x4 cube to run on a nano, while I was at it, i decided to hook the Shift registers to the 3.3v pin on the nano, it seems to be running, but is it doing bad things...

Told you so,

Be aware that dhenry is well known on this site for having a very odd attitude to reliability and safety of components. His attitude is that if it dosn't melt then it is fine.
LEDs are a particular blind spot of his.
He delights in being clever clever and showing off how smart he is. Which is odd because he isn't. Look at his past posts and see the larg number of things he is totally wrong about.

I see the touch button thing, it looks like they use a photo resistor, and maybe capacitive touch on the other button.

The photoresistor was there for ambient detection. The power button itself is touch sensing.

Heres a video of a guy that made circuit boards on glass slides,

That (iching copper on glass) is actually very impressive.

so a stack of shift registers,

Staking the shift registers the way you did is quite original, as I haven't seen anyone doing it.

The issue with shift registers in this application is that they take space and don't present well. The "nothing but led" approach is quite appealing.

I have been working on something similar, only mine is 12x12x12. It really is an awful nightmare wiring up all the LEDs. The worst part is I finished doing it using magnet wire, only to have insulation in the wire break down and short everything out, so I need to rewire all the common wires.

For mine I am using TLC5951's for the cathodes (though TLC5947s were my first choice but they are too slow for a cube the size of mine), and 4-16 line decoders wired up to create a 7 to 72 line decoder driving P-ch MOSFETs for all the anode common lines.
By using these IC's mine is capable of 36bit colour (though I have limited it down to 24bit).

Mike, if you two want to fight, thats ok with me, but its not my interest., Im interesed in finding solutions, and some experimenting, and hopefully some learning and success.

I would like to know why something is a good idea, or a bad idea, so if you want to talk about what is good/bad about something and why, that is what im hoping to hear.

dhenry, Did you watch this video too, where he shows how he made them? I thought it was pretty impressive.
Im glad you like my shift registers, that is called piggybacking, its commonly used for building memory modules of different sizes, with one sized footprint.

I realized that it shouldnt matter if im using 5v or 3.3 on my other cube, since im syncing with the shift registers, they get 5 volts from the plane pin. I think i originally assumed you needed a resister on the anode side, not the cathode side, and I didtnt want to buy 16 resisters (they cost a quarter each locally...) So I made the cube common anode and used 4 resistors.

When I made the last cube, all the software I found was for common cathode, When I made this one, I made it CC, to avoid those problems.{fail}

Tom, wow 12cubed sounds awesome, is it RGB thats a heck of a lot of wires! and magnet wires has to be very difficult, I've soldered magnet wire, and its a pain in the butt to get the insulation off (I found tinning the end worked, but you have to burn alot of nasty insulation off, and its a lot of effort.

The wire Im using is 19 gauge galvanized wire (like bailing wire) for the anodes, and 24 gauge copper wire for the cathodes (since each LED requires 3 wires, I went with smaller gauge (less obtrusive, and the cube doesnt need that much structural support). I used the copper because I thought it would look good, and I could make the negative lines silver(color), and the positive lines copper)
The 19 gauge is good and stiff, it makes the cube fairly sturdy. Ive found that I spent a lot of time straightening the wire (it comes in rolls, but I want straight lines, and it takes a lot of effort to make the wire straight), I'd like to find straight wire, im considering welding/brazing rods.

Tell me about those TLC5951s and 5947s, im interested in finding PWM solutions for my common cathode cube. Its a 4x4x4, broken into 4 planes, I need to control 48 LED anodes (16 RBG), and 4 plane pins (cathodes). I could run the planes right from the arduino, or ??? The way i was originally planning on doing the matrix was with 4 Shift registers, 3 would control the cathodes, and 1 control the anodes. Now Im considering using 7 shift registers (6 for cathodes, 1 for anodes(1/2 really))

I dont understand the bit about decoders and p-ch mosfets, I did read something about someone hooking up a light strip that was CC, and they used something like that to make it work.

I did a lot of searching last night, and it looks like almost every RGB LED setup is CA, and I wasnt able to find any examples of CC RGB PWM LED drivers. Shift Registers are looking like a better approach right now.

it was pretty impressive.

What's really impressive is how the whole thing is wired up. He used a 32-pin mcu for that 8x8x8 cube.

Grumpy_Mike:

but maybe there is a better way?

Yes you have the LEDs, connect them up with something like a 330R resistor and actually measure the forward voltage then you can do the math correctly to get your current.

I hooked up a 220 ohm on the red, and a 100 ohm on the green. Im using 3.3v from an arduino nano, and with the red LED I get 2 volts, with the green I get 2.7, the green seems pretty bright, but the red doesnt seem very bright.

Calculations Red (3.3-2)/220 = 0.005909091 (or about 6ma)
Green (3.3-2.7)/100 = 0.006 (or 6ma)

Green (3.3-2.77)/75 =0.007066667
Green (3.3-2.88)/50 =0.0084

Red (3.3-2.2)/50 = 0.022 (hey, getting close)
Red (3.3-2.1)/75 = 0.016

Sadly 50 ohms is the smallest resistor I can find.
From that can I calculate what voltage I need for 20ma?

responding to him... (DHenry) is like a battle of wits.... Except you are battling with an unarmed man... Once in a while he even manages to stay on topic...
Mainly he is just annoying as he knows everything about anything... and usually is wrong. IMNSHO

Bob

You are dealing with a few things:

  1. different voltage drops causing different If for the same resistors. In your example, your reds have about 2.1v voltage drop and your greens about 2.8v. So to achieve desired If, the reds need to have resistors of (3.3v - 2.1v) / If and (3.3v - 2.8v) / If for the greens.
  2. even if the same If goes through all leds, they have different efficiency / light output and our eyes have different sensitivity to different colors.

So play around with different resistors until your eyes perceive them to have same brightness. No point in having very precise values for those resistors.

I just did some more testing. i hooked up a 50 to the red, and ran 3.3 to all 3 anodes. It looked a little blue, so I hooked up a 50 to the blue, and a 63 to the red. I then measured the diodes

I found the green, with no resister measured 3.24, red measured 2.15, and blue was 2.7

Red (3.3-2.15)/63=0.018253968
Blue (3,3-2,7)/50=0.012
Green (3.3-3.24)/0= ?
But it still looks like mostly blue

I measured the voltage across the resisters, and the blue measures .49, and the red measures 1.

Im assuming with all 3 LEDs on, it should be white, and any color variance should be adjusted with a resistor.

http://bildr.org/2011/08/74hc595-breakout-arduino/
heres an example of someone running 595s on 3.3 volts from an arduino. They are even running LEDs w/out resistors.

Then I read this
http://arduino.cc/forum/index.php/topic,26476.0.html

  1. Your hc595 is not a perfect voltage source, as it has significant internal resistance. As the current draw goes up, its output voltage goes down (when outputing 1), reducing the current draw. The same mechanism works with a mcu's pin.

  2. Your led does not have a constant voltage drop: the voltage drop goes up, albeit slowly, when the current through it goes up.

Put the two together -> you don't get smoke when powering a led with a hc595 directly.

I've been looking about the internet for more info about 3.3v, and found this about the nano...

Power can be supplied to the Nano via the USB cable; feeding 5V directly into the 5V pin, or 7~12 (20 max, not recommended) into the Vin pin. You can only draw 3.3V at up to 50 mA when the Nano is running on USB power, as the 3.3V is sourced from the FTDI USB>serial IC. And the digital I/O pins still allow a current draw up to 40 mA each.

Im pretty sure that 50 ma wont be near enough, but If I resister the 5v input from the USB to 3.3v that may work. That way, the shift registers are powered directly from the USB, instead of through the arduino.
Its still going to need 17 resistors, which is messier than i would like, but less messy than 50 resistors.

Revisiting resistor options...
Ideally (from the pretty lights perspective), each LED would have a current limiting resistor (thats 192 resistors!), but because of many reasons, its very impractical to put 3 resistors on each LED, but not as impractical to put one on each LED column (or SR output pin, same thing) (48 LEDs), but even that is a lot parts, space, and complexity. Only one plane at a time is lit, so theoretically, it should be the same, but then I think only one LED is actually lit at a time, so it seems that resitoring the planes (common) (like I did on my other cube), would be viable.

I have noticed that on the other cube, when it lights up all the LEDs on a plane, they are not as bright as when it lights up only a few leds per plane. this cube will have 48 LEDs on a single plane, and my guess is that it the dimming would be more dramatic.

HRm... resitoring the USB power input wont work, because the current will vary depending on how many LEDs are lit at one time, I think i would need a 3.3 Voltage regulator to run the CRs at 3.3v.
A driver chip would be nice, sadly I havnt found one that will work with common cathode.

I found a 3.3v voltage regulator (from an old wrt router that died), snatched a few parts from it (Diode, coil, voltage regulator, cap), and soldered them up into a tiny regulated power supply.

This site tipped me off to the VR
http://kioan.users.uth.gr/wireless/wrt54g/supply.html

And looking over the datasheet, they had a typical circuit, which happened to be exactly how Linksys used it, so I just took the parts connected to the VR, and applied them based on the schematic in the datasheet AP1501-33K5 datasheet(7/7 Pages) ANACHIP | 150 KHZ 3A PWM BUCK DC/DC CONVERTER

I wasnt sure about the input cap, so I omitted that part, and it seems to put out 3.4v with no load.
The 12v brick I used said its .3a@12v, the VR is rated at 3a. Im not sure what my current needs are, but I think this will be more than plenty.