- Joined
- Jul 4, 2009
- Messages
- 16,489
- Helped
- 5,157
- Reputation
- 10,347
- Reaction score
- 5,207
- Trophy points
- 1,393
- Location
- Aberdyfi, West Wales, UK
- Activity points
- 139,503
Sorry for misunderstanding.
I'll throw another idea into the ring then, it saves on space and uses a few less components: Don't use 5V as the supply, use something higher and drop it to 5V only for the controlling PIC. The higher voltage will let you wire the four LEDs in series although you will have to drive them through transistors. Forget the idea of wiring LEDs in parallel, it may work if the LEDS are very closely matched but there is a very high probability that they will be of unequal brightness or some will not light at all. To use them sucessfully in parallel you need a resistor in series with each LED. On the bright side (pun!) if you use a driver transistor you can run the LEDs at higher brightness, bearing in mind the maximum current you can typically draw from each PIC pin is about 20mA and there is a maximum for all pins combined of around 200mA. To be honest, I always design for a maximum current of about 5mA per pin and usually far less.
For example, use 12V as the supply (because it's commonly available) and use a resistor and Zener diode to regulate the PIC VDD at 5V. Four LEDS in series drop 2.2V * 4 = 8.8V so the single series resistor would be (12 - 8.8)/0.05 = 64 Ohms, a standard 68 Ohm will do fine. The idea isn't good if you want to use bi-colour LEDs though because reversing the polarity becomes more difficult.
Q. Are you planning on using one LED that produces 2 (or 3) colours or one LED of each colour in each position.
As you can see, there are multitudes of solutions. The problem isn't making it work, it's finding the easiest way to make it work.
Brian.
I'll throw another idea into the ring then, it saves on space and uses a few less components: Don't use 5V as the supply, use something higher and drop it to 5V only for the controlling PIC. The higher voltage will let you wire the four LEDs in series although you will have to drive them through transistors. Forget the idea of wiring LEDs in parallel, it may work if the LEDS are very closely matched but there is a very high probability that they will be of unequal brightness or some will not light at all. To use them sucessfully in parallel you need a resistor in series with each LED. On the bright side (pun!) if you use a driver transistor you can run the LEDs at higher brightness, bearing in mind the maximum current you can typically draw from each PIC pin is about 20mA and there is a maximum for all pins combined of around 200mA. To be honest, I always design for a maximum current of about 5mA per pin and usually far less.
For example, use 12V as the supply (because it's commonly available) and use a resistor and Zener diode to regulate the PIC VDD at 5V. Four LEDS in series drop 2.2V * 4 = 8.8V so the single series resistor would be (12 - 8.8)/0.05 = 64 Ohms, a standard 68 Ohm will do fine. The idea isn't good if you want to use bi-colour LEDs though because reversing the polarity becomes more difficult.
Q. Are you planning on using one LED that produces 2 (or 3) colours or one LED of each colour in each position.
As you can see, there are multitudes of solutions. The problem isn't making it work, it's finding the easiest way to make it work.
Brian.