Playing with fire (LEDs with no resistors): Cool Update
Rayman
Posts: 14,838
Just did a quick test of Tubular's output pin resistance measurments:
http://forums.parallax.com/showthread.php?135845
His graph shows a resistance of ~27 or 30 Ohms at 3.3 Vdd.
I happened to have a Red/Green LED with a forward drop of 2.1 V and a current rating of 25 mA...
So, my math shows I can hook it up without resistors...
Anyway, I gave it a try and it seems to work fine:
Update: Look below and you'll see it's perfectly safe doing this with normal green LEDs (or any LED with threshold voltage >2.2 V and 20 mA rating).
Cool Update: Use a regular green LED as photodetector this way too! (see reply #22 on page 2)
http://forums.parallax.com/showthread.php?135845
His graph shows a resistance of ~27 or 30 Ohms at 3.3 Vdd.
I happened to have a Red/Green LED with a forward drop of 2.1 V and a current rating of 25 mA...
So, my math shows I can hook it up without resistors...
Anyway, I gave it a try and it seems to work fine:
Update: Look below and you'll see it's perfectly safe doing this with normal green LEDs (or any LED with threshold voltage >2.2 V and 20 mA rating).
Cool Update: Use a regular green LED as photodetector this way too! (see reply #22 on page 2)
Comments
Red Led: Voltage drop = 1.96 V, current =21.3 mA
Green Led: Voltage drop = 2.17 V, current = 18.5 mA
So the common cathode current is just under the 40 mA spec for a Prop pin.
I think most regular red leds are rated for 20 mA, so this might burn them out...
But, green leds look like a great fit. The current is safely below the 20 mA typical rating due to the higher voltage drop.
Blue or yellow would probably draw less current, but maybe too much less, making them not as bright.
So, using 2 prop pins (to double source impedance) with a green LED looks safe.
Here's a shot with 4 of them on steady.
Each draws 18 mA, just under the 20 mA rating...
If I apply Vdd with one pin and Gnd with a second pin, that puts ~80 Ohms in series with the LED,
which is enough to limit the current below the 20 mA max.
Putting two LEDs in series wouldn't work because 3.3 V isn't enough to forward bias two LEDs in series...
Tubular's measurements show the Prop's pins all have an internal resistance of ~40 Ohms...
Heater, I wonder if they sell LEDs that are back to back in the same 2-pin package...
Do you mean something like this?
Then I don't think I understand this question:
A bi-color blue and green LED would be kind of boring. Red and green making yellow, is a lot better than blue and green making bluish green (or maybe greenish blue).
Could use use a relatively high frequency, low duty cycle, PWM to keep the red LED's current in a safe range? I agree with others who are going to say this is dangerous.
From what I've tried blue and white leds are always safe, and charliplexing (driving both the anode and cathode of led arrays) from two or more prop pins, is safe with red and green leds.
It's worth checking the absolute maximum values of forward current, and also power dissipation for a led, just to make sure there is plenty of headroom. But many LEDs are capable of going well beyond 20mA without complaint (worth checking the maximum power dissipation rating for continuous use)
I'm not sure where your 40 ohm figure is coming from - did you measure that? Just curious as that's a fair bit more than what I found (27 ohms at 3v3).
If you use a back-to-back LED, there is no point unless you can reverse the polarity to get the second color, so this necessitates using two prop pins to drive it.
If you have two prop pins, you have ~ 54 ohms of series resistance, so even for a 2v Red LED this is a maximum continuous current of 24mA ( (3v3-2.0)/54 )and really unlikely to do any damage to the Prop or LED.
You've no idea how long I have being wanting to get that in a thread / conversation / report / document - I guess I watched too much sci-fi in the 1970s!
Lol, yeah its not the same since the advent of the microprocessor (that doesn't handle reverse polarity quite so well). Here's a mighty satisfactory list of "reverse polarity" shows and episodes.
http://tvtropes.org/pmwiki/pmwiki.php/Main/ReversePolarity
and I like the line about "if you want to put a modern MP3-compatible stereo in your '59 Morris Minor, a car polarity swap is a must"
Duane, I'm sure PWM at even 90% would be perfectly safe with a red LED.
But, the green is 100% safe, no matter what you do (as long as it's between 2 prop pins).
I don't have that red/green led, but it'd be fun to get one and see if it survives.
The one in the Parallax store don't seem to have an specifications....
160-1058-ND
I think it's because the "red" is actually "red-orange" according to the datasheet.
Datasheet also says it may take up to 30 mA, so it should be safe.
Perhaps just avoid red and orange LEDs if skimping on resistors.
Also, I just took a look at the datasheet for the 160-1058-ND and it shows the current going down with temperature...
Not only can you drive green LEDs with no resistors, but you can use them as ambient light sensors too!
Go grab your Quickstart and some green LEDs because this is cool
By just putting Vdd on the cathode and using the anode as an input, I can detect light and
use the blue leds on the Quickstart as status.
What's more, I think I could detect the intensity of the light by how long it takes to change state.
What's even more, is I think I could tell the color of the light with different color LEDs...
Ah, I think I've confused the transistor temperature dependence with diodes... In the transistor charge carriers get swept away to the collector if they mount the potential barrier (and higher temperature means more charge carriers have higher kinetic energy).
In a diode there isn't the same mechanism to grab every charge carrier. http://en.wikipedia.org/wiki/Diode#Temperature_measurements suggests the tempco can be either positive or negative for a diode and depends on the process and doping.
However I know photovoltaic cell voltages drop with increasing temperature similar to the Ebers Moll transistor model... I think that must have confused me since the naive model of a photovoltaic junction is of a light-dependent current-source in parallel with a forward biased PN junction.
I am alternating the output such that P7..P0 is HLHLHLHL (all red), then LHLHLHLH (all green).
I don't have a part number on these leds unfortunately, but they are milky diffused, 2 pin, and then red is much dimmer than the green at the same current (on a LED tester box). Green is about 2.1v drop and red about 1.65v.
It's been running for a couple of hours so far, we'll see whether it dies before the tennis ends. I don't have any 1 ohm resistors handy here to check the current but will do so tomorrow. I think its about 34mA peak.
you could blow up the LED. But this way, (green LED and using 2 Prop pins) it's perfectly safe and you can't hurt anything if you
make a mistake...
Tubular, I'd be surprised if it lasted very long at 34 mA...
Well, 40ma is the abs max current limit per pin, according to the datasheet. So it is well within that limit. And remember each pin is connected to 2 LEDs, so the effective current through each led is about half, or 17mA. So it should run for a while, but lets find out.