Shop OBEX P1 Docs P2 Docs Learn Events
Bi-color? — Parallax Forums

Bi-color?

roughwireroughwire Posts: 78
edited 2007-03-19 19:15 in General Discussion
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 so·a red LED, turns green when pressed.·Is it possible to make this without using a microcontroller?

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

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2007-03-19 17:07
    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 BakerPaul Baker Posts: 6,351
    edited 2007-03-19 17:09
    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
    Propeller Applications Engineer

    Parallax, Inc.
  • roughwireroughwire Posts: 78
    edited 2007-03-19 17:28
    could I get a quick diagram?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MIKE
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-03-19 17:41
             5V
              |
              /
              \ 10k
         \    /   |\     |\      +----------+   
     ---- \---+---| >O-+-| >O----|          |---LED--/\/\-+
     |            |/   | |/      | H Bridge |             |
    ---                +---------|          |-------------+
     -                           +----------+
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • SteveWSteveW Posts: 246
    edited 2007-03-19 17:55
    Isn't the H-bridge rather overkill? The inverters have plenty of drive for a LED...

    Steve
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-03-19 17:56
    If you have a SPDT pushbutton, this circuit will also work:

    attachment.php?attachmentid=46006

    -Phil
    260 x 260 - 1K
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-03-19 18:34
    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
    Propeller Applications Engineer

    Parallax, Inc.
  • SteveWSteveW Posts: 246
    edited 2007-03-19 19:15
    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
Sign In or Register to comment.