Red/Green Bi-state LED
Zoot
Posts: 2,227
I have some red/green bi-state LEDs (two leads). The forward voltage req. on the LEDs is about 2.4 volts.
Would the following work?
- hook up one lead of the LED to Vdd with a resistor so I get about 2.5 volts on that lead
- hook up the other lead of the LED (through a resistor) to a PIN of my BS2p40
- a HIGH state on the PIN would light the LED red (5v on LED lead to PIN, 2.5v on the other = ~2.3 volt difference)
- a LOW state on the PIN would light the LED green (0v on LED lead to PIN, 2.5v on the other = ~2.3 volt going the other way)
I saw something akin to this in the documentation for the PWMPal, but I want to do this with only 1 pin.
Also, Is there a way to "float" the pin to turn the LED off?
Could you also do the same thing if you're hooking up the LED(s) to a shift register (to save pins)?
Thanks in advance.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Would the following work?
- hook up one lead of the LED to Vdd with a resistor so I get about 2.5 volts on that lead
- hook up the other lead of the LED (through a resistor) to a PIN of my BS2p40
- a HIGH state on the PIN would light the LED red (5v on LED lead to PIN, 2.5v on the other = ~2.3 volt difference)
- a LOW state on the PIN would light the LED green (0v on LED lead to PIN, 2.5v on the other = ~2.3 volt going the other way)
I saw something akin to this in the documentation for the PWMPal, but I want to do this with only 1 pin.
Also, Is there a way to "float" the pin to turn the LED off?
Could you also do the same thing if you're hooking up the LED(s) to a shift register (to save pins)?
Thanks in advance.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Comments
"Is there a way to "float" the pin to turn the LED off?"
Well if you are able to actually make this work (Red = High, Green = Low) then you could use a capacitor to remove the voltage spikes and PWM it at 2.5v and then yea that should work.
Connect LED-Pin2 to your I/O pin (no resistor here).
Use INPUT to make the pin "float" that will turn the LED OFF.
One downside of this method is that it uses power whether the LED is on or not. About 11mA if you use 220 Ohms resistors.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module"·available from Parallax for only·$49.95 http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com
"I reject your reality, and substitute my own." Mythbusters
·
The attached document shows how, and also has formulae to calculate
the resistor and total current if one led is on, based on led forward voltage
and led forward current.
regards peter
In the Stamp Reference Manual under INPUT and under the discussion of the PIN symbol, I don't see documentation about IN pins "floating", unless I missed it. What's the technical term for a floating pin anyway?
That power's coming across the voltage divider, tho', right? So I'm not sucking it off my Stamp? Yeah, that could be a drag with a lot of LEDs in something smaller. Fortunately, this particular project has a very hefty power supply.
Sort of related question -- if I use some extra pins on a PWMPal, can those pins float to achieve an "off" LED using this kind of voltage divider setup? I don't think you could do it with duty cycles and pulse widths (like getting an orange color).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Post Edited (Zoot) : 4/20/2006 4:56:08 AM GMT
Unless you use another shift register into a tri-state buffer to create your "floating" condition. Adds some complexity and timing issues, though...
Sounds fun!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
Post Edited (Tom Walker) : 4/20/2006 2:22:02 PM GMT
For this particular project, I'm using 4 bi-state LEDs for status indicators and aside from the cool colors, I wanted more possible combinations out of the display -- 3 x 3 x 3 x 3 = 81 combos for 4 LEDs or 3 x 3 x 3 for 27 combos if I need a pin back.
www.semiconductors.philips.com/pip/PCA9532_3.html
(They're $1.65 at DigiKey)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
http://www.elecdesign.com/Articles/Index.cfm?ArticleID=1683
schematic:
http://www.elecdesign.com/Files/29/1683/Figure_01.gif
This does not create a fixed 2.5V point, the·standby current (both leds off)
is therefore approx. 2.7 mA
Edit: I just tried it with 2 standard 3mm leds and all resistors 1k.
Works great.
regards peter
·
Post Edited (Peter Verkaik) : 5/4/2006 9:37:24 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
so 1 pin for 4 states. The SX can do that too.
regards peter