Electronics > Electronics

Bi color LED question

(1/3) > >>

Eco19R:
Hey - I had a quick question,

Is there a way to control a Bi color LED with only one pin on a MCU?

I was thinking that you could have it hooked up like this


                                  +5V
                                     |
                                 Resistor
                                     |
MCU-- Resistor--------- >LED>
                                     |
                                 Resistor
                                     |
                                   GND
                           
If the MCU pin was set to input, the led would be off

if the MCU pin was set to high the LED would be one color

if the MCU pin was set to low the LED would be a different color

Would this work?

Thanks for any information you can provide.

555 timer chip guy:
in theory yes but I have been proved wrong before the only sure way to know is
to test it.

frank26080115:
bi color LEDs don't work like the way you are describing, they have two anode leading to one cathode (or vice versa), cathode must always be ground for either to work

if you use a inverter on one pin you can switch between the two using one I/O but you cannot have both off

unless you have one of those weird ones you have to charlieplex, in which case you would still need two I/O to work (your diagram confused me)

what you are discribing is something like two diodes pointing in one direction, in which case you can have either both on, one on, or the other one on, it is impossible to turn it off as if the control pin is high-z state (or input state), current will flow right through both diodes at once

Eco19R:
Actually the bi color LED I am referring to only has two leads - its like two LEDS in one connected in parallel with reverse polarities.

Input state = high Impedance = no current would flow through LED,

Low = Current would flow through LED into MCU.

HIGH = Current would flow through LED to ground.

I think it would work - as long as the resistor values are correct.

Can anyone else share any insight into this subject?

Ro-Bot-X:
it will work if you connect it like this:


                                  +5V
                                     |
                                 Resistor
                                     |
MCU -----------<LED>-----+
                                     |
                                 Resistor
                                     |
                                   GND
                           

Navigation

[0] Message Index

[#] Next page

Go to full version