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

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.

Something strange happened. When I tried to hook up the 3.3v to the shift registers, i disconneded the 5v, and the cube didnt stop working, it kept on working until I disconnected the ground.

I hooked up the 3.3v and ground from the 3.3v power supply to the shift registers on my old cube, and it didnt work right. its hard to explain how it worked, but it was slowed/delayed, and it seemed to not display stuff. It was just wrong.

Im totally baffled how/why the shift registers and cube were running on 4 wires (clock, data, latch, and ground)

Clamping diodes on the inputs of the shift register IC. Basically if you remove Vcc, power can flow from an input which is set at logic 1 to Vcc via the protection circuits. This is not good for the IC as the protection circuits aren't designed to power the thing.
If theArduino is running at 5V still you also have a problem as you are running the shift register at 3.3v meanung that the inputs will be far above the absolute maximum allowed voltage of Vcc+0.5V

Tom, are you saying that the SRs are getting power from the data/clock/latch line? and that if i put a diode on those lines it will be ok? or that I should resistor the inputs down to 3.3v.

When I made the 3.3v power supply, i was thinking I could run the arduino at 3.3v, but the docs say minimum input voltage is 6v (but isnt the usb power 5v?)

I still need to find some decoupling caps, my shift registers dont have any on them, and I guess they like them.
I have lots of broken stuff i could pull smd caps from, but sadly, i dont know their value, I probably have many many suitable caps on various broken boards.

I also found this website with a 5x5x5 RGB cube thats running on shift registers and ULN 2003 chips. The way they mulitplex uses a lot less pins, but I cant figure out a way to build it, and make it stable with SMD LEDs, and solid uninsulated wire.

They are doing 25 x 15, If I could figure out how to do the SMD LEDs my cube would be 12x16 (28 pins), half as many as ithem currently using 48 x 4 (52 pins)

They use the ULN 2003 on 2 of the shift registers, is this for current limiting? The schematic shows no resistors, but it looks like the PCB has places for 1206 lands, and my guess is those are the resistors.
I also notice that they claim that most RGB cubes are common cathode, but theirs is common anode. That seems odd to me, since I seem to only find drivers for common anode setups.

I also found the rainbowduino (seeedstudio), uses my9221 chip, for their 4x4x4 CC RGB cube. Sadly, i havnt been able to find that part.

I have some ULN 2003s, and from what I see on ebay, they are fairly inexpensive.

What I am saying is that when you disconnected the 5V line, it stayed working because there are diodes built into the chip. This is a very bad way of operating the chip.

When you connected 3.3v, you need to level shift signals from 5v down to 3.3V otherwise there will be excessive currents flowing through the same built protection diodes which will damage the chip.

Level shifters can range from dedicated IC's to Transistors, to basic resistor potential dividers.

Hrm.. ok, this is interesting. Could you give me a couple examples that I could start experimenting with ? I have some resistors, I could make a resistor potential divider, What values would be appropriate? Looking over the wikipedia page Voltage divider - Wikipedia

It looks like their example of 6v from 9v, is the same ratio 3.3v from 5 v. In which they say R1 should be twice the value of R2. I've looked, and not found a pair of resistors that are suitable, however I have some tiny resistor packs, and I could bridge 2 resistors to make one resistor thats half the value of the other resistors. They are pretty low resistance (63 ohms).

How about the ics or transistors? I have some routers that I can pull parts from, maybe I have the transistors already?

1.8k and 3.3k tend to work well.