8x8x8 multiplexed LED cube with an Arduino Mega 2560

Hello again!

I did some more tests and... I'm even more confused :expressionless:

First of all, I measured the voltage between the tip of the soldering iron and the wall socket's grounding. I've set the multimeter to 750 V AC and tried it. The result: 90 V! Wow! I know that there's no error in my measurement because I tried measuring the mains voltage with the very same settings and I got 230 V, which is the standard value here in Eastern Europe.
Next I took another old soldering iron, which does not have grounding. With that one I obtained 45 V.

You know that what I initially observed, yesterday, was that if I touch either leg of the LED with the tip of the iron and the other leg with my finger, the LED lit up (although it was dimmer than usual). So I thought to myself, let's try to ground the tip of the iron by connecting it with a wire to the wall socket's grounding. And this is when the real surprise came! The theory was that the current will not go through the LED, it will go through the wire directly to the wall grounding and the LED will not light up. Instead the LED lit up twice as bright! Remember that I was still touching the LED's other leg with my finger.
Next I completely took out the soldering iron from the equation. I just held one LED leg with my fingers and I connected the other LED leg directly to the wall grounding through a wire. The LED still lights up, although not as strongly as through the soldering iron.

So what is going on here? Am I producing electricity and it's flowing through the LED into the wall grounding? And for minutes and minutes, without an end? How can I be producing electricity constantly? OR is the electricity coming from the wall grounding and going into me?
I tried holding the LED and connecting the other leg to some other mass, like the radiator, that way it does not light. But if I connect one leg to myself and the other leg to ANY wall grounding in the apartment, it lights.

What's going on here? The only thing I can think of is that the wall grounding is not done properly and that it's leaking very small amounts of current at 90 V...

I'll try taking the LED into another home in a different part of town, let's see what happens.

What a stupid game of circumstances that lead to the destruction of my 4x4x4 cube!

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 :slight_smile:

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 :frowning:

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 :stuck_out_tongue:

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

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 :slight_smile:

Thank you!
Andras

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 :slight_smile: When my final 8x8x8 LED cube will be done, I will symbolically dedicate one of it's LEDs to you :slight_smile: 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 :slight_smile: 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 :slight_smile: 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.

Thank you, CrossRoads!

So, in other words we do need the 220 Ohm resistors between the shift register and the NDP6020P-ND gate. We also need pullup resistors between the gate and source of the NDP6020-ND and their value should be 5 KOhm.

As for the LED current limiting resistor, I understand now which components drop voltage and need to be taken into account. I guess your guess of 0.5 is from the NDP6020-ND. I've read the datasheet, not just once, but I can't figure out the voltage drop based on the graphs. Here is the excat datasheet of the NDP6020-NDs that I've bought from Farnell: http://www.farnell.com/datasheets/59594.pdf

The 3.3 voltage drop for the LEDs is a correct assumption.

One more important question: CrossRoads, in your image the Arduino had some additional things (capacitors, resistors) connected to some pins on the top and left, so it would seem that not only the MOSI, SCK, SS and GND pins are connected. Is that needed, or is that just some leftover from another circuit? If needed, what values would those be and what is their role?

Thank you very very much or your answer!

Ok, I didn't realize the NDP6020 was a MOSFET with 0.023 ohm on-resistance. Its voltage drop will be 0.023 * planned current (# of LEDs per row) or very small.

I drew up a standalone microcontroller circuit; if you are using an actual arduino, those are already built in, so you only to connect to the SPI pins and Gnd.
The standalone circuit has 10K reset pullup resistor, 16 MHz xtal, 22pF caps, and 100nF caps on VCC/AVCC/Aref.

Thank you, CrossRoads, very much! :slight_smile:

So that means that the voltage for which we need to calculate the current limiting resistors for the LEDs looks like this:

5V (source) - 3.3V (LED) - 0.08V (TCIP6B595) - 0.023 * 64 * 0.02 = 5 - 3.3 - 0.08 - 0.03 = 1.59. In other words we need 82 Ohm resistors. Luckily I have a few hundred of those laying around :slight_smile:

At this point I understand the driving circuit 100%. I will soon post an updated diagram to reflect the reality accurately.

In the meantime I'm progressing with the 4x4x4 test cube. You guys were right when you advised me not to start with the 8x8x8 one. No amount of theory can prepare you for the difficulties encountered during soldering. A practice cube is a must. In a few days it will be ready and I'll come back with pictures.

Thank you all for your help!

1.59V/20mA = 79.5 ohm, 82 being a standard value should work well.