Why simple solutions are not always the best one.
I another thread there was a question about driving 15 LEDs from a 12 V supply.
Let's consider several options. In all cases either an NPN transistor or a MOSFET turns it on/off.
1. One resistor per LED, all LED-resistor pairs in parallel. If the LED has a 3 volts drop, the resistor drops 9 volts. So 3/4 of all the power goes to heat up the resistor. Not very efficient, but the resistor values are not critical.
2. 5 branches with 3 LEDs in series in each. Again the LEDs drop 3 volts each, 9 volts total. The resistor will drop another 3 volts. Now only 25% of power is wasted, but there is another issue. For a 12 V supply the resistor will be 150 ohm to limit the current at 20 mA.<snip>
3. Same thing, but there is a switching transistor in each of 5 branches and another one to set the current at 20 mA. Now we'll always drive the LEDs at 20 mA regardless of the voltage variations, but we use 10 transistors.
So is there a better solution? You bet. For example to use a switching DC/DC converted. There are specialized ICs for it, some quite inexpensive. Like the good old MC34063 - $0.5 or so. It has built-in current limiter that can be set to our 20 mA and drive all the 15 LEDs in series. Or if we have a microcontroller in the circuit anyway, we can roll our own step-up converter.
The PIC drives a MOSFET with a PWM wave. The duty cycle should depend on the voltage across C2 measured by the PIC's ADC. At 20 mA that will be 200 mV. There is a danger in this circuit: if for whatever reason the pin controlling the MOSFET is stuck in the ON state, the MOSFET and/or L1 will release the magic smoke. Better to drive the MOSFET with a fail safe circuit.
I another thread there was a question about driving 15 LEDs from a 12 V supply.
Let's consider several options. In all cases either an NPN transistor or a MOSFET turns it on/off.
1. One resistor per LED, all LED-resistor pairs in parallel. If the LED has a 3 volts drop, the resistor drops 9 volts. So 3/4 of all the power goes to heat up the resistor. Not very efficient, but the resistor values are not critical.
2. 5 branches with 3 LEDs in series in each. Again the LEDs drop 3 volts each, 9 volts total. The resistor will drop another 3 volts. Now only 25% of power is wasted, but there is another issue. For a 12 V supply the resistor will be 150 ohm to limit the current at 20 mA.<snip>
3. Same thing, but there is a switching transistor in each of 5 branches and another one to set the current at 20 mA. Now we'll always drive the LEDs at 20 mA regardless of the voltage variations, but we use 10 transistors.
So is there a better solution? You bet. For example to use a switching DC/DC converted. There are specialized ICs for it, some quite inexpensive. Like the good old MC34063 - $0.5 or so. It has built-in current limiter that can be set to our 20 mA and drive all the 15 LEDs in series. Or if we have a microcontroller in the circuit anyway, we can roll our own step-up converter.
The PIC drives a MOSFET with a PWM wave. The duty cycle should depend on the voltage across C2 measured by the PIC's ADC. At 20 mA that will be 200 mV. There is a danger in this circuit: if for whatever reason the pin controlling the MOSFET is stuck in the ON state, the MOSFET and/or L1 will release the magic smoke. Better to drive the MOSFET with a fail safe circuit.
Attachments
-
66.5 KB Views: 50
Last edited by a moderator: