PDA

View Full Version : Bi-color?



roughwire
03-19-2007, 11:57 PM
I want to do a simple wiring project thet invovles 1 pushbutton, and one bi-color LED. All I want to do is run an LED from a 9v battery soa red LED, turns green when pressed.Is it possible to make this without using a microcontroller?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE

stamptrol
03-20-2007, 12:07 AM
MIke,

Use a DPDT push button or switch to control the LED.

In one position, the led is powered with one polarity (will show red) and in the other, the switch changes the polarity applied to the LED and shows green.

Don't forget the current limiting resistor!

Cheers

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com

Paul Baker
03-20-2007, 12:09 AM
Yes, a couple inverters and an H-bridge would work, the switch is input to one inverter whose output is tied to one input of the H-bridge and the input of the second inverter. The output of the second inverter is tied to the input of the second hbridge input. The LED and current limiting resistor is the h-bridge's load.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

roughwire
03-20-2007, 12:28 AM
could I get a quick diagram?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE

Paul Baker
03-20-2007, 12:41 AM
5V
|
/
\ 10k
\ / |\ |\ +----------+
---- \---+---| >O-+-| >O----| |---LED--/\/\-+
| |/ | |/ | H Bridge | |
--- +---------| |-------------+
- +----------+

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

SteveW
03-20-2007, 12:55 AM
Isn't the H-bridge rather overkill? The inverters have plenty of drive for a LED...

Steve

Phil Pilgrim (PhiPi)
03-20-2007, 12:56 AM
If you have a SPDT pushbutton, this circuit will also work:

http://forums.parallax.com/attachment.php?attachmentid=46006

-Phil

Paul Baker
03-20-2007, 01:34 AM
True steve, you have greatly simplified the circuit, I stopped at the first solution I thought of (H-bridge, then how to drive it), but didnt look for simplifications.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

SteveW
03-20-2007, 02:15 AM
Well, if you're prepared to squander a little bit more power, you could do it with a couple of NPNs run as inverters and 4 of resistors. That way, you could also have different currents for red & green directions, which might be handy. If I was aiming for cheap & easy to assemble, I'd be doing it that way. Wou could also stick resistors in the emitters, to build a sort of current limited version, if you wanted to partially reject changes in supply voltage.

Steve