Go Down

Topic: 8x8x8 multiplexed LED cube with an Arduino Mega 2560 (Read 126076 times) previous topic - next topic


It sounds to me like you have grounding issue. One easy way you can make a good ground, is to connect a wire to your plumbing (this assumes you have metal plumbing that goes underground, or is somehow grounded. You might try using that as a ground for a power strip, and just use that power strip. You of course would need to very careful to not short anything that might cause you injury.

If you happen to have a long metal rod, you could hammer it into the ground to get a good ground, its kind of extreme, but it may suit your circumstances.

We use 120 here, and they have a tester that costs a few bucks, less than 10 I think, and you just plug it in the wall socket, and it tells you if things are wired properly. Its a fairly common tool, you may know someone that has one that you can borrow.


boffin, Im a big fan of the deadbug style prototyping.

The hard part of building that circuit looks like the ribbon wire, that stuff isnt designed to be soldered, the insulation is designed for easy clean cutting with connectors. It shrinks way back when you heat the wire, you really need to pre-tin it, then trim the wire down after the insulation shops shrinking back.

Soldering LEDs without a board to hold them is a lot more difficult, and using some kind of jig to hold the parts while soldering really make a big difference in the end product.


One easy way you can make a good ground, is to connect a wire to your plumbing

Please, don't do that! Think bath tub and electric, not a good thing. Using plumbing pipes for ground is what used to be done in the past (in the USA) however, it can go badly wrong if the water pipe is not going to earth ground. Driving a ground rod into the earth (have said earth area checked first) is the safest method.


Diving a metal rod into ground is not an option because the apartment is on the 10th floor :)

Anyway, I've just tried the touch-the-LED-touch-the-grounding experiment in my parents' house. Here everything is fine (I got a quick pulse of light from the LED on first touch but nothing ever since - I guess there might have been some static electricity left in me or in the iron), so I decided to move the LED project here. I don't really have another choice. The grounding in the apartment where I've started the project is giving off current at 90 V, so it's dangerous for sensitive equipment :(

Good thing I managed to figure it out in time. I've only wasted 12 hours of work, about 70 LEDs and about 6 meters of good craft wire. Better like this than being sorry with the 8x8x8 cube.

Thank you all for helping me figure this out! I really appreciate your help.


Yeah, you should probably check things out before hammering a rod into the ground, you could hit electrical, gas, or water plumbing!

Also, you should not take a bath with your soldering iron, or your other electronics, its not good for them, or you.

Since you mention that you are in an apartment building, there is little that you can do You can check to make sure you are getting a good ground with a previously mentioned device. You can ask your landlord about it, maybe there is something that they can do?

You may also be able to use some plumbing for a good source of ground.

Now is probably a good time to learn about ESD, and EOS. You and other objects can store up and discharge quite a lot of electricity (like a million volts under some circumstances). You dont need a million volts to destroy sensitive electronics, you can happily destroy stuff with much lower voltages that you wont ever feel. You have probably been giving them LEDs a bit of EOS while messing around with them, but LEDs seem not too sensitive to ESD.

ESD = Electric Static Damage = Part destroyed
EOS =Electrcal Over Stress = Part weakened.


Don't worry, I'm not going to take a bath with my soldering iron :P

I just got myself a pair of thin rubber gloves. No more EOS for the LEDs ;)


Good ESD techniques usually mean constant grounding (usually though a high value resistor), rather than insulation. insulation keeps you from discharging, and it means that it builds up until voltage levels get  high enough to arc.

Good grounding is probably what you want, insulation usually turns you into a bigger capacitor.


Okay... but should I ground the soldering iron, the cube or myself? I'm figuring that I shoudl ground myself because the static electricity may build up in me and if that is grounded through the iron, it will go through the LEDs unti;l it gets to the iron...


On a different matter now...
Last time we talked about the driving circuit, it looked like this, or at least this is what I understood:

I'm hoping that CrossRoads still reads this topic...
Can somebody please help me clarify the following things:

1. What should the value of the resistors between the G and S pins of the NDP6020P-NDs be? I remember CrossRoads mentioning at some point that they could be left out (these resistors). I don't know if that's healthy or not because I don't understand the role of these resistors. Or maybe he meant that the resistors between the anode-driving TPIC6B595 shift register and the G pin of the NDP6020P-NDs is what could be omitted and those 220 Ohm resistors should actually be between the G and S pins of the NDP6020P-NDs?
2. If the target current for each LED is 20 mA, have I calculated correctly the valu of the resistors that go to the cathode columns (56 Ohm)?
3. Is there anything missing from the diagram?
4. Is everything connected as it should be?

I'd really like to be sure that the diagram is 100% correct because this is what I'm going to base my driving circuit on and I reall think I've had enough unpleasant surprises :)

Thank you!


I could be mistaken but I think your 56ohm resistors should be closer to 100 ohm (or maybe 91?) assuming you are running them at 5v, and VF 20ma is at 3.3v.

I cant help you with the other stuff...


Yes, but I think the value of the LED resistors should not be calculated for a voltage of 5V-3.3V because there's some voltage drop across other components too, just not sure how much and where...


I've studied things a bit more and I think there might be some problems with my diagram.

This is my diagram (modified version of CrossRoads' diagram):

And this is CrossRoads' original diagram:

There are a few things that I think may be wrong:
1. The 220 Ohm resistors should not go between the shift register (TIPC6B595) and the MOSFET (NDP6020P-ND). Instead there should be no resistor between the shift register and the MOSFET, the 220 Ohm resistors should be between the G and S pins of the MOSFET (they are what they call pull-up resistors). I think...
2. If you look at CrossRoads' original image, there are some resistors and capacitors connected to pins 7,1,9,10,21,20,22,8 of the Arduino. I removed those, thinking that they are not needed. Now I'm not so sure anymore...
3. I still wonder about what value is needed for the cathode resistors if I want 20 mA per LED and the LEDs drop 3.3V from the 5V that is available. The question here is if the MOSFETS or something else also has a voltage drop that needs to be taken into account and if yes, how much.


Hopefully crossroads will clarify things, but i seems to me that the i/o>gate resistors were probably from using pnp transistors, and if you are using logic level mosfets, you probably dont want a resistor there, but I think the gate>source resistor is to help it shut off, so it can switch faster. but Im a bit confused about many things transistor...

Check your calculations on your led resistors, I bet you are set for 30ma, not 20.


Thanks, Hippynerd! You've helped me a lot lately :) When my final 8x8x8 LED cube will be done, I will symbolically dedicate one of it's LEDs to you :) Another one is definitely for CrossRoads and the rest of you guys who have given me so many useful bits of information should also get one :) I guess I'm talking nonsense here, but hey, it's my way of expressing gratitude.

So back to the hardware, I agree with you. The gate-source resistors are needed as pull-up resistors (I've just learnt today what that means). The resistors between the shift register and the mosfets can probably be left out, as CrossRoads said earlier.
As for the LED cathode resistors, I think the safe way to go is to calculate their value based on a voltage of 5V - 3.3V (5V comes from the power supply and 3.3V is the voltage drop across the LED). With a target current of 20 mA, we get 100 Ohms for the resistor value (http://led.linear1.org/1led.wiz?VS=5;VF=3.3;ID=20). Even if the mosfet drops an additional 0.5V (which I don't know, I'm just assuming the worst here), with 100 Ohm resistors the current passing through the LEDs will be about 13 mA, which should be well enough for the LEDs to work properly.

I've done some experiments a few months back with some standard 5 mm white and blue LEDs and they give up pretty strong light even at 0.5 mA. I don't know if that's still true when they are switched very fast. I don't know if their turn-on time is affected by the intensity of the current. I guess we'll find out :) Anyway, for the 4x4x4 test cube I will include some variable resistors in line with the 100 Ohm resistors to see how much I can reduce the current without affecting the cube's light levels too much. This way, wehn I build the real cube, the 8x8x8 one, I might be able to use resistors which will reduce the current values much and this way the cube's power requirements will be significantly lower.


The Gate-Source pullup resistors, 5K should work well. Provides 1mA of pullup curent.
The Arduino-Gate resistor, 220 ohm , will pull the gate good & low. Vg will be ~5V*220/(5000+220) = 0.2V.

The LED current limit resistor:
(5V - Vce-pnp transistor - Vf-led - Vds-shift register)/(current-desired) = R
So an example might be:
(5 - 0.5 - 3.3 - 0.08)/20mA = 56 ohm
0.5 & 3.3 are my speculation, dependent on the parts selected.
0.08 is from Rds of TCIP6B595 of 4 ohm at 100mA, so 4ohm * 20mA = 0.08V

So read your datasheets, plug in your numbers & desired currents, go from there.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up