cant figure out where im loosing power to my led's in my led cube(SOLVED) - Page 1
Forum section: electronics / beginners

author: markedagain
author_rank: Newbie
timestamp: January 17, 2012, 04:21:32 am
content: hey guys, im pretty new to electronics, i might sometimes miss the complete obvious basics so bare with me please.i tried to draw this but it did not work out. i have a 4x4x4 cube of green leds, i multiplex them and have 12 anodes and 4 cathodes. i connected the 12 anodes to pnp transistors emitter and collector is on 5 v from battery. the base of the transistor has a current limiting resistor and a pull down resistor ( not sure if i need this) and then it connects to a mutliplexing chip. ( chip outputs high for off, hence i used pnp). but the chip only allows 12 outputs, so the cathodes of the leds i put a current limitnig resistor then into collector of pnp , emitter to ground. and the base i connected directly to arduino digital ports.so my problem, when i try to give the illusion all the leds are on i can barly see the leds. when 1 is lit it looks pretty good. my voltmeter does not allow me to measure the current cause its a crap voltemeter and i guess does not go down to <20ma. i have a 150k resistor on the cathodes, and i have a 1 k resistor on the bast of the 12 pnps leanding to chip. i also added 10k pull downs so pnp would properly turn off cause chip does not seem to ground when not high. my multiplexing chip is 74ls154 , my pnps are generic 3906.i feel like the transistor might be to slow, maybe im not saturating the transistor ( im confused on that concept) but i cant remove the transistors cause my mutliplexing chip has to be inverted and if i use an inverter i dont have enough current without a transistor again.so im lost

author: IanB
author_rank: Super Contributor
timestamp: January 17, 2012, 04:29:55 am
content: It's really hard to visualize your circuit from your description alone, but remember that multiplexing means that only one LED can be on at a time. You have 4 x 4 x 4 = 64 LEDs. Therefore if you try to light them all up at once, each one can only be on for 1/64th of the total time. That means the current is being shared over all 64 LEDs at once and each one will only appear 1/64th as bright as a single LED by itself. So depending on exactly how your circuit works, this could be the problem.

author: markedagain
author_rank: Newbie
timestamp: January 17, 2012, 05:10:55 am
content: ok best attempt here without getting it confusing, this represent i layer there would be 3 more like this. going from A1 to A12 and C1 to C4.yes im def lighting one led at a time. i start it off with a delay(100) between each on off, then i lower it to where i see all the leds are on at the same time, this only seems to happen at delay(1) but even when i get near delay(30osih) and all the lights are flickering i seem to see a drop in intensity of light.

author: Torrentula
author_rank: Regular Contributor
timestamp: January 17, 2012, 06:22:19 pm
content: Quote from: markedagain on January 17, 2012, 05:10:55 amOf course your LEDs dim! The more LEDs the micro has to multiplex the faster it must switch between every LED meaning that every LED is on for a shorter time, which results in less brightness. On my first cube I could see the LEDs flickering as well.The only way to get around the LEDs flickering is increasing the multiplex frequency. When multiplexing you want to wind up the frequency as high you can. Increasing the frequency will to a certain degree fix the dimming but because of the way multiplexing works you will always have a dimming effect.I hope this helps!TorrentulaP.S.: Shouldn't there be 16 columns instead of only 12 columns? Otherwise I don't know how to reach 4x4x4

author: Psi
author_rank: Super Contributor
timestamp: January 17, 2012, 09:28:10 pm
content: If you look at the LED datasheet you will see that there's a pulsed rating for current.If the led is rated at 20mA, for example, you might see something like '100mA pulsed @ 10% duty, 1kHz'This is intended for multiplexed setups. It means that if you only have the led on for a small time you can safely increase the current to get some brightness back.It works because heat is the real issue that kills leds and if you only have the led on for 10% of the time then it's only going to get ~10% as hot. Therefor you can increase the current safely.Be aware though, if there's a bug in your multiplexing code and it stops switching, one led will be on continuously.This will be a problem since you're driving at its pulsed current rating and it's no longer being pulsed.So it will die pretty instantly.

author: markedagain
author_rank: Newbie
timestamp: January 18, 2012, 05:55:27 am
content: Quote from: Torrentula on January 17, 2012, 06:22:19 pmhehe good catch, yes but my mind seems to only count to 12 then gets saturated.Quote from: Psi on January 17, 2012, 09:28:10 pmok this makes total sense. is there a generic number i should follow for a green led? i got a bag of assorted leds with no clue what they are other than there color.also turns out my pull down resistors were a bad idea, they endup turning on the pnp always and sending current, figured it out when i went back to a longer delay to just blink each light they were still on.im not sure how i can get a quicker frequency using an arduino. are you talking about the atmegas frequency clock?

author: markedagain
author_rank: Newbie
timestamp: January 18, 2012, 06:07:46 am
content: ok quick update, i checked random few leds and 100 ma seemed like a good number , and a 50ohms did the trick, leds are def brighter, will have to rework some of the code to make sure leds dont turn on for more than a short time always, even when pattern is to to turn on 1 led.ok quick transistor question then ill mark thread solved. i have a pnp 3906. my signal to base is 5v, how much current do i need to fully saturate it, i dont understand the datasheet on these numbers, they seem to only give test conditions and some voltage and not current. im currently using a 1k resistor, i tried a 330 but noticed no change. also turns out from what i read pnp requires pull up not pull down resistors, whats the reasoning behind the pull up on a pnp?

author: IanB
author_rank: Super Contributor
timestamp: January 18, 2012, 08:03:28 am
content: Quote from: markedagain on January 18, 2012, 06:07:46 amJust look at the on characteristics and the saturation conditions. You will see there a typical rule of thumb that the base current should be about 10% of the collector current. So if the collector current is to be -100 mA then the base current should be about -10 mA. Note how these values are negative. This is because the current is flowingoutof the transistor, not into it.QuoteA PNP transistor is a mirror image of an NPN transistor. Everything works in reverse. So to turn on a PNP transistor you pull the base low so current can flow out of it, and to turn it off you take the base high so the current goes to zero. A pull-down resistor would therefore turn the transistor on and would be counter-productive if your goal is to keep the transistor turned off until switched. But you don't need a pull up or pull down resistor if your base drive has low impedance high and low states. What resistors you need depends on the properties of the device being used to switch the transistor.

author: amspire
author_rank: Super Contributor
timestamp: January 18, 2012, 08:06:04 am
content: The 2n3906 has a maximum current of 200mA, and most of the guaranteed specifications are for 100mA or below.So for 100mA, it will turn on to at least 1v VCEor less with a base current of 3.3mA. It typically turn on to less then 0.2V with a base current of 10mA/collector current of 100mA.Now I am still confused about how the 12 transistors connected to the multiplexer are connected, as you said the collectors of the PNP transistors were connected to the 5V. Did you mean the emitters?Assuming the PNP emitters are connected to the 5V rail, you have a problem. The multiplexer high output is typically 3.4V and it can be lower, and that will still leave the transistor turned on. So you need two resistors to act as a voltage divider, so that the transistors definitely turns off. The multiplexer has a maximum LOW current of 8mA. That means a series resistor of 560 ohms that goes from the multiplexer output to the base and 180 ohms from the base to the 5V. This will make sure the transistor turns off with a worse case multiplexer output voltage, and the transistor will get 4.2mA base current. This should be good up to at least 100mA collector current and may typically manage 200mA reasonably (but definitely not guaranteed).Even if the HIGH voltage from the multiplexer is at the minimum of 2.7V, the base voltage on the transistor will be .55V which is near enough to off. It will typically be less then .38 Volts and that is completely off. The resistors will probably pull up the output of the multiplexer above the specified output so it may be possible to increase the 180 ohm resistor to a larger value, that will get a mA or two extra into the transistor base. If you want to be totally safe, stick to the values I suggested.Richard

author: Torrentula
author_rank: Regular Contributor
timestamp: January 18, 2012, 04:15:11 pm
content: QuoteNo I meant increasing the multiplexing-frequency so that the LEDs get switched faster by the ATmega --> the higher the frequency the less flickering you will have. It's basically the refresh rate of the cube display.Reducing the flickering is the reason why newer TVs have a refresh rate of at least 200Hz. At 200Hz you wont see the TV screen flicker at all.If you want to modify your hardware instead - as suggested in the previous posts - then you don't have to wind the frequency up that much.Torrentula.

author: markedagain
author_rank: Newbie
timestamp: January 21, 2012, 01:23:17 am
content: Quote from: amspire on January 18, 2012, 08:06:04 amwell that was it, basics that i simply dont know and i never needed a pnp before. turns out i had the 5v connected to collector, it is 16 anode. seems like it was still turing on the led's but on high frequency it was not allowing as much current vs its norm operation with 5v on emiter.i also did not need the pull up resistor, led have always turned off properly.thx alot for the info and the help. now im off to code, and once i get a few patterns down, going to hunt for 600 cheap leds for an 8x8x8