View previous topic :: View next topic |
Author |
Message |
John Morley
Joined: 09 Aug 2004 Posts: 97
|
Driving a bi-color LED..... |
Posted: Fri Jan 20, 2006 4:12 pm |
|
|
Hi All,
I have a project where I'd like to drive a bi-color LED. The one I'm thinking of has 2 pins (anti-parallel connected LED's). If I hang the LED between 2 digital outputs with a series current limiting resistor, I should be able to turn on one LED by setting one output hi and the other low. The other LED can be turned on by swapping the outputs. I don't see any reason why this won't work. Is there any better way?
Thanks,
John _________________ John Morley |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Fri Jan 20, 2006 4:46 pm |
|
|
Yes it should work, the PIC can source/sink up to 25mA in its outputs. Toggling the
outputs you will get a mix of both colours.
If you want to save one PIC pin, you can connect the bicolor LED to 1/2VCC (2.5V)
and other side to one output + series resistor. You will get 2 colours and the mix of them too.
Downside is that at least one colour always should keep lite on.
Better way ? surelly will be a better way, folks in this forum are plenty of good ideas.
Humberto
Edited for spelling correction only. (is/are)
Last edited by Humberto on Sat Jan 21, 2006 8:13 am; edited 1 time in total |
|
|
stewart
Joined: 28 Nov 2005 Posts: 12
|
|
Posted: Fri Jan 20, 2006 5:21 pm |
|
|
To turn the LED off, just set the output bit to an input.
Stewart |
|
|
Eugeneo
Joined: 30 Aug 2005 Posts: 155 Location: Calgary, AB
|
|
Posted: Fri Jan 20, 2006 8:16 pm |
|
|
Where can you get a cheap 1/2 VCC without using a Voltage divider that is push pull? |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Fri Feb 03, 2006 12:58 am |
|
|
I like the voltage divider idea. Even without a voltage divider there would have to be at least one current limiting resistor anyways. For an indicator type LED the current limiting resistor would be on the order of 500ohms, and the total resistance of the divider would be 1000ohms. The leakage would be 5mA, which might be bearable for a wall-powered device. |
|
|
|