Bicolor LED Switch driven by a PIC, need to pull outs to GND?

Sep 05, 2006 3 Replies

I have a bicolor led switch that I would like to control with 2 different output lines from a PIC that I'm using. I'm having trouble figuring out the circuit.



The switch is:

formatting link



SPDT Red & Green



Their datasheet (linked above) shows the LEDs circuit to be:



--->|---0 LED1 |



0---| | --->|---0 LED2


So, I figure I want a 180 Ohm R between + and the single leg, the other



2 need to be pulled to ground.

I did not look at the datasheet close enough when I ordered this part and planned the circuit in my head. I thought it was the opposite, where there were 2 feeds to the forward side and 1 pull to ground.



I guess I need a circuit that looks like:


--->|---0 -- ??? --- PIC Out1 |



+5V 0---| | --->|---0 -- ??? --- PIC Out2

What is the blackmagic I can use to pull an active high output to ground?



Just two resistors where your ??? are. Drive the output low to turn the LED on, assuming you're writing the code. If you're not writing the code, and the outputs are high for ON, then add one inverter on each output (eg. use 2/6 of a 74HC04)

Best regards, Spehro Pefhany

"it\'s the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

The first question that comes to mind is why do the outputs have to be active high? If they could be active low, you could just use a 470 ohm resistor in place of ???.

But if there is some good reason they have to be active high, then you might add a 2N7000 or BS170 N channel mosfet as an inverter. Source goes to ground, drain to resistor to LED, gate to PIC output.

Hello,

Thanks, I tested this today and it worked. Thanks aga> >

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required