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

Thats where i got the shift regitsers. they got here in less than a week.

I ended up ordering 200 (100 ohm, and 150 ohm) resistors. $5 is better than $12 i guess, but I still have to wait till next week probably. Hopefully they will be close enough. I also ordered some .1 uf caps.

I spent the better part of the day wrecking and repairing my old cube, I wont be using it for testing stuff anymore. I also soldered up some RGB LEDs to some shift registers to experiment with 3.3v. I can run the blue and green at 3.3 safely. I still need to make new voltage dividers, I keep breaking the tiny ones I've made.

I couldnt even buy shift registers locally,

Very rarely you can. But many distribution houses offer next day delivery. Digikey for example does that, as mouser / newark.

I order my parts in hundreds so shipping cost ends up as nothing.

I think i could have gotten some from the OE shop, they sell NTE parts, and Im sure NTE must make some kind of shift register, but the counter guy wanted me to try to figure out which part would work, and I didnt know, so I left, and bought online instead. I would prefer to buy local, and support local business, but they charge too much, and cant be bothered to help make a sale.

They already have my package ready for shipping (i have the tracking numbers, but they havent been scanned in yet.)

They also sent me email offering me %12 off their normal prices if I buy today. (but not on ebay, on their regular website. The regular website doesnt offer the 4day shipping, they do have 3 shipping options, but the quick way is kind of expensive for a few parts. Im considering ordering those 85 ohm resistors.

I guess I assumed that shift registers were fairly common, they seem to be used in a lot of things.

I cant even find RGB LEDs locally, they only have single color ones, and they want $.65 each for them. It would have cost $40 just for the LEDs on my first cube.

Mike, My old cube uses 4 resistors, one for each plane, which means it uses between 20 and 320ma (assuming my resistor is the right size...), when it lights all LEDs on a plane, it is noticeable, if you are paying attention, but most folks dont seem to notice.

I may try to make and sell a few cubes, so I can buy a bunch of parts and see how many ways I can light up LEDS!

I want to try some of those cool POV projects with spinning LEDs (like spokePOV), or the spinning globe things. I have an old VCR that im thinking about turning into a POV project.

MMMMmmm I love LEDs.

My old cube uses 4 resistors, one for each plane,

Well that explains it, very poor design that.

Grumpy_Mike:

My old cube uses 4 resistors, one for each plane,

Well that explains it, very poor design that.

It was when i changed it up from using 20 pins, to using shift registers that I noticed it, so it would be more like a very poor re-design, if you must form it that way. I prefer to think of it as a work in progress. I may just throw some resistors at it and solve things the easy way, rather than the elegant way.

My resistors should be in today, so I should be able to wire up the cube for 5v, using 100, and 150 ohm resistors.

I also drew up some fritzing images with 3 different setups, one uses 5v, and is probably the common way of doing it.

The other 2 images are running 3.3v from the shift registers, to the LEDs. using 50 ohm resistor for the red.

To keep things simple and easy to understand, this is only using 8leds, and 1 shift register per color, and one for the cathodes (4 total 74hc595s)

5v, 4 shift registers, 16 100 ohm resistors, 8 150 ohm resistors:

3.3v from arduinos 5v line

3.3v from external power supply

Im not sure, but I think the last one needs a ground to the arduino for the latch/clock/data lines to work.

Is there anything wrong with any of those designs? I just realized that I need to put .1uf caps on the shift registers, so other than the caps, is there anything wrong? will one design work better than another?

The middile one definitely has something wrong. You don't use a resistor potential divider as a power supply [unless you use a power op-amp to prevent (make negligible) the effects of loading, but that is a whole other kettle of fish].
You should use a proper voltage regulator - be it a LDO regulator, a switching regulator, a zener diode, or other such voltage regulation devices

Loading 101:

If say for example you have two 1k resistors as a divider and say connect 5v at the top. Under no load, you will get 2.5V. Say you now used that as a power supply, and started drawing i dont know, maybe 1mA from the 2.5V line

You would then have
Ib = Vb/Rb = Vb/1000 [A] flowing through the bottom resistor, and 1mA flowing through the output.
That would then mean that flowing through the top resistor you have:
I = 1 + Vb [mA] = 0.001 + 0.001Vb [A]
The voltage drop on the top resistor would then be:
Vt = IR = 1000*I = 1 + Vb [V]
That would give you a total voltage drop across the potential divider:
V = 5[V] = Vt + Vb = 1+2Vb

So that would mean that at the output, the voltage would be:
Vb = (5 - 1)/2 = 4/2 = 2[V]

So in that case, just 1mA of loading would result in the output voltage dropping by 20%.

In your case you seem to be using 10k for the lower resistor and 5k for the upper resistor and are attempting to power 3 LEDs from it. So input voltage would be 5V, load current would be say 60mA. So just for fun that would give Vb = -200[V]. That figure is of course absurd, and the reason for it is you simply cannot put 60mA through a 5k resistor when the voltage across it is limited to 5V (The maximum would be I=V/R = 5/5000 = 1[mA], and at that amount there would be 0v across the LED).

Wow! that was a really good explanation. So, #2, bad idea, on the voltage divider on the shift register power source, I'll look seeing if I can fix that with a VR circuit.

Resistors and caps came in. I can put some filtercaps on my shifters now.

I may pair up some 100 ohm resistors to put on my 3.3v test RGB leds too to test the 3.3v have something setup like the 3rd example.

I may also be able to rig up the cube similar to the 1st example, I have a 7 piggybacked 74hc595 shift tower soldered up for the cube.

but that still has to wait for me to take care of other business first :frowning:

I've been experimenting, before wiring anything up to the cube. I had a rig setup for running 8 RGB LEDs on 3.3v, but I decided to undo that, and set it up for 5 volts, because it wasnt working, and I wanted to start with something easier.
So, re-soldered it up with resistors (8 100 ohm on the red, and 150 ohm on the blue and green). I have the cathodes (the negative side) soldered to a wire, and the anodes soldered to resistors, that are soldered to 3 piggybacked 595's. I soldered up a few .1uf caps to where I hook the 5 volts up to the shift registers. I made a couple jumpers to power the 595s from the 5v and gnd pins on the uno, and a jumper from the cathode to the gnd on the shift registers.

No LEDs would light up. just to see if If the LEDs would light, i tried hooking up the 5v to the resistors, no luck, but in the process, I touched the cathode wire with the 5v wire, and some leds lit up. I took the ground wire off of the cathodes, and hooked 5v to it, and it seems to work fine (runs the shift pwm demo).

Im confused though. I double checked everything, and my LEDs seem backwards. The schematic shows pins 1,2,3 as cathode, but on all my RGB LEDs, you hook up 5v to that side, and ground on the other side to light them.

I double checked the datasheet online and the only odd thing I can find is the symbol for the LEDs looks funny, on the blue and green leds there is a symbol that looks similar to an LED next to the regular LED symbol.
Im including the image from the ebay auction

Look at the pin numbers on the bottom right diagram (you can ignore the zener diodes). The have drawn the image as if it were from looking at the back.
If you then look at the top left diagram, the cathode is marked with a triangular notch.

The good news is that if you have in fact wired everything as common anode, it is a lot easier to control as you can now use the TLC5940's or any other LED current sink to drive them.

Oh, that was my first thought (that I had wired them common anode), but no matter what side you look at the part, the triangle bit is on the cathode, right? (topside vs upside down). The test unit I made was a 19 gauge wire soldered to the leads that are on the same side as the triangle.

I've checked all the LEDs I've setup, and they all seem to use the + on the side with the triangle, and none work with the - hooked up on the side with the triangle.

I wish I had some tlc chips to test it right now.

Im curious about the funny looking LED symbols in the diagram. Green and Blue look weird, they have a reversed looking diode on top of the regular diode. zener LED? I dont understand.

The LEDs are pretty bright, I think I will need to make tiny diffusers for the LEDs.

Interesting. That means that the diagram is wrong (the mark is the anode not the cathode).

The Zener diodes aren't LEDs. I am not sure why they are there, but I would guess for some sort of overvoltage protection?


You can see the little triangle corners all lined up with the heavy gauge wire. I have a few test setups like this and all of them have all of the cathodes (triangle sides) connected together.

I do have a set of 8 just like these, only with resistors, and they are running on 3 shift registers. I have them wired up rgbrgbrgbrgbrgbrgbrgbrgb, but after reading the code, I would like to have wired them up rrrrrrrrggggggggbbbbbbbb. Its running shiftpwm rgb demo.

I guess one of the benefits of using shift registers and resistors is when you have something goofy like this happen, shift registers will still work.

This is what im working with right now, its a test unit that is setup the same as the ShiftPWM example (even though the LEDs are marked otherwise.)

Im running the 8 RGB LEDs off the arduino, The power supply is via USB (using a usb phone charger, I think its 500ma)

it seems to me that I should be having power issues when its running all the LEDs at 100% (24 LEDs * 20ma =480m. Thats about 160ma per shift register, and about 1/2 amp on the arduino.

according to this site:
http://www.elcojacobs.com/using-shiftpwm-to-control-rgb-leds-with-arduino/
thats not really a problem? I also noticed that there is a picture of 16 RGB LEDs, which is what I will need to do for the RGB cube,

I do have the cube mounted on a case, I have to solder up 48 resistors, and 6 shift registers, which is going to be kinda messy.

This is the next test Im doing, its running the LEDs on a 3.3v power supply, and possibly running the arduino off the 12v that powers the 3.3v circuit, but probably running on the 5v from the usb, I dunno.

The one Im wiring up actually has 100 ohm resistors, I didnt have any 47 ohm resistors.
The wiring between the shift registers and LEDs looks crazy, but i think it will be easier to solder up.

Heres a video of the 3.3v with voltage dividers (like the 3.3v setup in the previous post:

As you can see, it didnt work right, it did make the LEDs light up, but It was pretty wrong.

Heres a video of the 5v test setup (it uses 8 RGB LEDs, 8 150 ohm resistors, 16 100 ohm resistors, and 3 shift registers.) In this video I also include the 3.3v setup, without the voltage dividers, it runs pretty good w/out the dividers, but It may be causing some kind of damage, i dunno.

Instead of soldering up a bunch of resistors, and shift registers, I did a little googling instead.

Check out what I found.
http://aglick.com/charliecube.html

This guy built a 4x4x4 RGB cube using 64 LEDs, some wire, perf board, and a nano. No resistors or transistors or chips of any kind, just some wire, leds, board, and nano.

The way he solved the problem was like using geometry to solve a accounting problem.

I did a lot of soldering yesterday. I found some unused xmas lights that had wires in groups of 3, about the right lenght for my project. I cut, stripped, tinned, and soldered them onto the resistors that I had previously soldered onto the column wires on the cube. I ended up having to untwist the wires to move them through the case, and it ended up pretty ugly. I will probably end up replacing those wires, but they will work for now.
Before green wires:


After green wires:

The horror!


Soldering away...

Which brings us to here:

Now that I have the shift registers wired up to the ribbon cable (clock, latch, data, ground), and wired to the LEDs, I need to figure out how to source current to the common planes.

In my first cube, I used 20 pins, 4 pins sourced 5v (through 220 ohm resistor). I upgraded that cube to using 2 shift registers to control the sink, and sourced 5v via 4 pins through 220 ohms.
I recently upgraded that cube to 16 100 ohm resistors on the column(sink) pins, and removed the 4 220 ohm resistors on plane(source) pins.
In my RGB shiftpwm tests, I sourced 5v to the common pins via the 5v pin on the uno (Originally I had it from a 5v power supply, but later I moved it to the uno for portability).

It seems to me, each of those are drawing too much current through the arduino.

Im considering a few different approaches, I could add a shift register (this is what i had originally figured that i would do). using 4 bits to source the current, and having the other 4 for added features, like buttons? or sound?, I dunno really.
Then I realized that mixing those bits in with the column pins may make shiftpwm, or other however I may control those bits more difficult, and a separate shift register may be better.
I figured, I could use 2 bits for sourcing the current per plane (1 8bit chip to source 1 48 LED plane), but it seems to me running the current for 48 LEDs through 2 shift register pins will be too much for it.

In my previous post, with the 4x4x4 RGB cube, they are able to do this with 64 RGB LEDs, and no other parts. I guess they are able to do all the current control via PWM, and since the red LEDs need a lot less voltage than the other LEDs, it somehow must adjust.

Also, Ive noticed other people posting about making 4x4x4 RGB cubes, if you are making a similar cube, post in this thread with how you are doing it, and what features you are thinking about.

I havnt lit this cube yet, Im still not sure how i want to source 5 volts to the 4 planes. It seems to me that I should be similar to my other cube, but I need to deal with 3 times as many LEDs.

I have built an SMD version of the asher glick cubes spire.

I also came up with a way to do this with 8 RGB LED Spires, but I havnt figured out how to do the 8 led spire in SMD.

I've figured out 2 ways to do the 8 LED spire. One way is to simply build 2 4 LED spires, and rotate the top spire 45 degrees from the bottom spire. Instead of 4 leads, you will have 8.

The more interesting way is instead of using the pi/2 rad formula for rotating the LEDs, use pi/4 rad, and iterate it 8 times (instead of 4). This should end up with 8 leads and 8 charlieplexed RGB LEDs in one column. I have to wait for LEDs to arrive before I can build a spire.

I just read up on the ULN 2003 chip, and it looks like a great way to source 5 volts to each layer. It says it can source upto 500ma, that sounds like plenty compared to a single arduino pin. It looks like I hook ground up to pin 8, 5v to pin 9, and use the first 4 pins for input, and last 4 pins for output to each plane. WahBam plenty of current, with a few pins unused. If I had a ULN2803, I could pair up the 8 arrays into 4 arrays for twice the current.

This way, I can modify my old software for the cube to shift out 48 bits instead of 16, and it should work on this cube. I think i can probably use shiftpwm with this cube too.

Still waiting for new RGB LEDs to arrive... They are common cathode, I will use them to make a charliecube like asher glicks. I cant wait to compare the 2 cubes :smiley: