LED Current Draw and Resistor Selection
If I've read the propeller data sheet correctly, it can supply up to 40 mA. For my LED project I have the LED's Charlieplexed so I can control them with various pin combinations. I want to light more than one LED at a time, but I definitely want to be within the prop's specs.
I have calculated that a 220 ohm resistor will result in an 8 mA current from a single pin. So I should be able to concurrently light 4 LED's and stay well under 40. I could light 5, but that would be pushing it.
Does this sound correct? Thanks in advance.
I have calculated that a 220 ohm resistor will result in an 8 mA current from a single pin. So I should be able to concurrently light 4 LED's and stay well under 40. I could light 5, but that would be pushing it.
Does this sound correct? Thanks in advance.
Comments
-Phil
3. 3 - 1.6 (LED voltage drop) = 220 * 8 mA
And did I read the propeller data sheet correctly?
Personally, I think I'd try using no resistor and just pulsing the LEDs directly from a Prop pin...
Actually, I take this back because then the current would not be completely defined.
I think I like it better when the external circuit defines the current...
http://ledcalc.com
The effect of these are to put less current into your led, so you'll end up with more like (3.3 - 1.6 volts led drop) / (220 + 27 + 27) ~ 6.2mA rather than 8mA.
You can easily verify this for yourself my measuring the voltage across your 220 ohm resistor(s) for the cases where 1, 4 etc LEDs are lit
Would make sure all leds draw is lte the 8ma you have calc'd with.
Frank
It's the side effect of charlieplexing that you can only have one LED set ON at any one time.
You just have to do it really fast to make them all look on.
http://youtu.be/8apRaZQbv5w
As anything else you would have random/limted control what is on or off
You could not go over the 40mA, unless you use the highduty version
http://www.electro-tech-online.com/microcontrollers/119157-charlieplex-n.html#post979377 (don't forget 2k resistor to base)
Actually the resistance would be 27 ohms to Vss or Vdd. If I am wrong on this I am sure Beau will correct me, but typically the output pins will be totem pole fashion with one 27 ohm to VDD and another 27ohm to Vss. You may turn off both FETs to acheive tri-state function, one or the other on for high or low, but likely never both (unless this is done for some special reason i.e. 1.65 on the output pin). so the current will actually be
(Vss - Vled)/(Rseries+Rint)
where Rint is the 27 ohms to Vdd or Vss depending on how the led is connected and which internal FET is driving the pin.
Frank
(output hi) P16 ----/\/\/\
|>|
P17 (output lo)
(1) Single led "charliplex" using a red led and 220 ohm series resistor
Supply 3.27v
P16 = 3.118v with respect to Vss
drop across 220 ohm resistor 1.274v => 5.8mA flowing
drop across red LED = 1.698v
P17 = 0.145v => 25 ohm lo side fet resistance
(2) Using a 1 ohm series resistance to measure current easily
Supply = 3.31v
P16 = 2.533 v
drop across 1 ohm resistor 24.2mv => 24.2mA flowing
drop across red LED = 1.804v
P17 = 0.703v => 29 ohm lo side fet resistance
What this means, even with IR leds (which have a lower voltage drop), at 3v3 supply you're never going to hit 40mA driving leds in charliplex fashion. The internal fet resistance just won't allow it. This is a 'feature'
To be specific the alternate columns are charlieplexed to half the column pins required. I have a pin per row so I can light up more than one row LED at a time. My plan is to light them up in groups of four so I can sweep through all LED's faster.
These are interesting results and 5.8 mA result means I have plenty of headroom and no worries about current draw for what I am planning.
I finished up the wiring and used 220 ohm resistors on each row. I wrote a program to sweep through the LED matrix illuminating one LED at a time. It works well, so now I need to get cracking writing a real program. I'll throw up a video soon.
Posting a video is a good idea. Please don't throw up.
This is what appears in the eye when you become an English teacher.
When available, I use a resistor substitution box and start with a higher resistance value.
You can lower the values incrementally until the LED is at perfect illumination.