8x8x8 multiplexed LED cube with an Arduino Mega 2560

dc42:

CrossRoads:
Seems to be a logic level part
http://www.irf.com/product-info/datasheets/data/irf9540n.pdf

No, it is most definitely not a logic level part. Rds(on) is quoted at Vgs=10V only. It might just work @ 1.28A, it depends on whether the part you get has a higher or lower than normal gate threshold voltage, whether the 5V supply is a little higher or lower than normal, and on the temperature. Bad choice for this project.

heh, well, I guess I have 10 of them I wont be able to use. I wish someone had posted something like that in my thread a few weeks ago when I asked. nobody posted anything one way or another, so i looked around at parts that I could order, and those seemed like the right option, but I guess I should get some of the ones you posted earlier.

If I do some 12v stuff (like putting LEDs on cars), would the be good for that?

Hippynerd:
If I do some 12v stuff (like putting LEDs on cars), would the be good for that?

Yes, if you give them 10V or 12V gate drive. With 5V gate drive they will probably be OK for switching up to about 1A.

Based on what i've read around here, it sounded like the RDS was the key issue when picking a mosfet, that and one big enough to handle the current. which was the criteria I used when looking for mosfets. Its like LED drivers, there are an overwhelming amount of options, and precious little information about why one would be good or bad for something.

So, what factors do you need to know to pick the right mosfet?

RDS, VGS? ??? ???
Are there any good websites that might help learn, and or pick out a good part? How about one for LED drivers, that sure would be nice!

First, determine the maximum value of Rds(on) that you can accept. This is typically determined by the maximum current you will be switching, and the power dissipation in the mosfet that you can accept. Unless the current is very high, then you will normally want to design for no heatsink. In this case I suggest limiting the power dissipation to 1W for a TO-220 mosfet, or 0.5W for one in a smaller package (but check the datasheet in case it is lower). Use lower values if ventilation will be poor, e.g. in a sealed box. Since the static power dissipation is I ^ 2 * R, you have Rmax = Pmax/I^2.

Now look for mosfets which have Rds(on) no higher than that value, specified at the gate-source voltage (Vgs) you will be using or lower, and the maximum current you will be using or higher. Also the drain-source (Vds) rating needs to be high enough for your application.

When using mosfets for low speed switching applications, that's usually all there is to it. In this particular example, there is an additional consideration that Rds(on) should be low enough such that the voltage drop across the mosfet does not cause the brightness of the LEDs to decrease significantly as more LEDs are turned on.

Thanks for that explanation, its a bit difficult to understand, since I have no idea of how much I can accept of several factors. It would be nice to have a table of applications, and specific parts with specific details that were easily compared to other parts. Watt/package size is a nice relationship, that seems easy enough to factor.

Lets use 20 mA x 64 LED as an example. Assuming its running on 5v, using constant current driver to sink, (that sounds like the direction he is heading), it should use up to 1.28A. With this design, he is only doing 12.5% duty cycle. How do we apply the math to figure out what specific specifications to look for, and ranges maybe? It seems like a simple table would be easy enough to make.

Hippynerd:
Lets use 20 mA x 64 LED as an example. Assuming its running on 5v, using constant current driver to sink, (that sounds like the direction he is heading), it should use up to 1.28A. With this design, he is only doing 12.5% duty cycle. How do we apply the math to figure out what specific specifications to look for, and ranges maybe? It seems like a simple table would be easy enough to make.

Let's look at power dissipation first. If we assume that the software works so that the 1/8 duty cycle won't be exceeded, and we go for 0.5W maximum power dissipation in the mosfet, then the dissipation while the mosfet is conducting can be up to 8 * 0.5W = 4W. So we need Rds(on) <= 4/(1.28 * 1.28) = 2.4 ohms.

However, the voltage drop would then be 2.4 * 1.28 = 3.1V, and we certainly can't tolerate that in a LED driver running from a 5V supply as there wouldn't be enough voltage left to drive the LEDs and series resistors. So in this case, maximum Rds(on) is determined by maximum allowable voltage drop. If we were not concerned about the LEDs getting dimmer as more are turned on, we might allow 0.5V, allowing Rds(on) of up to about 0.4 ohms.

I search for MOSFETs like this at digikey.com:

x-channel mosfet (P or N)
in stock
Fets-single
logic level
thru hole (for prototyping anyway)
sort by price (click on unit price)

scroll down past the 1,000 qty min buy parts to the 1-lot, looking for a low Rds part,
which usually puts me at the start of the TO220 type parts.
Then I check to make sure the gate capacitance isn't ridiculous.

Right now, that search puts me at these two parts
p-channel - small list of parts, just 12 choices

n-channel, 18 pages of parts
after the price sort, right on the first page

Very nice explanation dc42! Now I understand why I need the MOSFETS that I need.
I bought the NDP620Ps from Farnell in the end: http://ro.farnell.com/jsp/search/productdetail.jsp?sku=1017724

In the datahsheet we can see this:
"Features
-24 A, -20 V. RDS(ON) = 0.05 W @ VGS= -4.5 V.
RDS(ON) = 0.07W @ VGS= -2.7 V.
RDS(ON) = 0.075 W @ VGS= -2.5 V."

I hope that's good news. What confuses me is that you used Ohms for the unit of Rds(on) and the datahseet uses Watts. But I guess V=IR and W=IV, so W = V/R*V = R. W=R ?!

Data sheet says 0.05 ohm, right on page 1.
http://www.fairchildsemi.com/ds/ND/NDP6020P.pdf

When I look at the datasheet, the characters that you describe as W are Greek omega-characters.

Rds(on) = 0.05 Ohms then, so it's good :slight_smile:

Thanks!

For anyone else who might be interested in the future to build a LED cube based on this design, I've put together a component list with prices based on what I have bought for the project. I tried to buy the components as cheap as I could, most of them off eBay, but for many of them I have bought more than actually necessary, because they sell in bulk or because I wanted some spare parts. Here's what I got:

NDP6020P: 14 pcs 33.3 EUR (43.8 USD)
3mm diffused blue LEDs: 1000 pcs 19.4 EUR (25.5 USD)
TPIC6B595N shift registers: 20 pcs 9.3 EUR (12.3 USD)
1K variable resistors: 100 pcs 7.4 EUR (9.8 USD)
5V 3A power supply: 1 pcs 7.1 EUR (9.4 USD)
Craft wire 0.8mm 6m: 3 pcs 7 EUR (9.2 USD)
Jumper cables 40 PCS: 2 pcs 6 EUR (7.9 USD)
Capacitors (0.1 uF) + resistors (82R, 220R): 3 pcs 4.6 EUR (6.1 USD)
PCB 18x12 cm: 2 pcs 3.9 EUR (5.2 USD)
Female pin headers: 200 pcs 3.8 EUR (4.9 USD)
TO-220 heatsink: 10 pcs 3.4 EUR (4.5 USD)
IC sockets DIP-20 for TPIC6B595N: 10 pcs 2 EUR (2.7 USD)
Crocodile clips: 2 pcs 0.8 EUR (1 USD)
Total: 108 EUR (142.3 USD)

Sorry, I just can't get the data into a well-formatted table.

This does not include, of course, the price of the Arduino driving the cube or other miscellaneous stuff like soldering materials or the prices of some tools that you use for other projects too.

Somehow I got lost on the math there DC. 1.28 * 1.28 = 1.6384, divide by 4 and you get .4096.
How do you come up with .5 watt?
He will need 8 mosfets, each one will run 1/8th of the time (12.5%), each one will need to be able to source between 0 and 1.28A. I see the 1.28 in there, and the 4 was from half watt times 8. So I see some of the numbers, and understand where they came from, Im still confused with the math, and where half a watt came from. it seems arbitrary.

I tried crossroads technique, and came up with 7 P-channels, I started by searching "p-channel mosfet", then clicked a link that said Fets-Single, That displayed a page with many options, I selected logic level gate, through-hole, and then I scrolled the package column, and selected the TO-220-3

From there, I notice that all of the parts have many mOhm RDS (way way over .4 ohm), not even close to mOhms.
I dont know what a good/bad gate capacitance is, but I can only find gate charge, and input capacitance.

I can also see that the NDP6020 is rated at 60 watts, and if using 1/2 watt, Im guessing you wouldnt need a heatsink.
How many 20mA LEDs could you run on that mosfet?

Also $150 for the parts for a 8x8x8 cube sounds like a lot, but I havnt built a cube that big.

6 Meters of wire seems like a low estimate to me too, I bet you use over 8. what kind of wire is it? soft wire is very difficult, but harder wire is a bit easier, and ends ups being sturdier. I find very hard steel works the best. For cube building, and general keeping wires straight, thinner and softer are more difficult, thicker and harder are easier, but for soldering, thinner is easier.

Hi!

I'm planning to run 64 20 mA LEDs from one of those MOSFETS.
That price of 142$ includes components for the big 8x8x8 cube, but also for the small 4x4x4 learning cube and some spares. I guess that if I tried to but onyl as many components as necessary for the 8x8x8 cube only, I could have pulled it off for about 100$.

6m of craft wire is definitely not enough. But I have bought 3x6=18m, which is probably twice as much as I need. I do not know how soft or hard it is, I bought it blindly from eBay based on the suggestion of somebody who has already used the same or similar craft wire to build a LED cube successfully. It is 0.8mm thick and is sold rolled up, I'll have to straighten it before soldering.

Hippynerd:
Somehow I got lost on the math there DC. 1.28 * 1.28 = 1.6384, divide by 4 and you get .4096.
How do you come up with .5 watt?

See reply #83. I suggested a maximum of 1W for a TO220 mosfet with no heatsink, and 0.5W for a mosfet in a smaller package.

CrossRoads, is there a special reason why the LED cube that we've discussed here uses the cathodes as columns (64 cathode columns) and the anodes as planes (8 anode planes) and not the other way around? Many other cubes that I've seen use anode columns and cathode planes and it seems to be more practical that way because the anodes are 2-3 mm longer, which compensates for the fact that the LED heads are taller than wide, so the horizontal and vertical distances between the LEDs could be longer and still equal if we used anode columns and cathode planes. Is it possible to do this reversing of anode/cathode roles? If yes, how?

Thanks,
Andras

Cathodes as columns because the TPIC6B595 can only sink current, not source it.
I have not seen a shift register that is designed to source 20mA (and not running at the Absolute Maximum as many people use 74HC595) outside of the 74AC299P which I think is not procurable in DIP form anymore. I bought a tube of them from Newark for not much when Newark was getting rid of the last of theirs.

I had not considered LED pin lengths - just figured cube dimension would adjusted to actual parts purchased, which no doubt vary by manufacturer.

74AC299.pdf (130 KB)

Well, I'll sacrifice those 2 millimeters then :slight_smile:
Thanks!

BTW, happy new year!

Thanks! Happy New Year to you as well!

Finally all my parts for the LED cube have arrived (except some minor things that I can start without) :slight_smile: I plan to start working on it soon, I will show you pictures when I'll have some results.
The only problem is that the LEDs that I bought seem to have very short legs. The Anodes are 18 mm and the cathodes are 15 mm. It will be a crowded cube...