For a project I am working on, the prototype has a green and a red LED. In the production version, I will need 2 green and 2 red LEDS. My project is running at 3.3V.
I don’t have to control the 2 LEDs of the same color separately. What is the best way to wire these up?
Use one digital pin to control both LEDs each with their own resistor
Use one digital pin to control both LEDs with a common resistor (just confirmed that this is not a good choice)
a separate DO pin and resistor for each LED
Probably a silly question but wanted to confirm.
Another side question: Since I need the 4 LEDs and the LEDS are the big power consumers, what are my options for minimizing power consumption; i.e. increase resistor size to reduce current and give up some brightness?
One pin with one resistor per LED. Otherwise they may not be equally bright. If you don’t care about brightness mismatch, then you can use one resistor.
High brightness LEDs are pretty bright even with just a few mA through them. Yes, reduce current with a resistor: vision is most sensitive at low light levels, so this works pretty well.
ijourneaux:
For a project I am working on, the prototype has a green and a red LED. In the production version, I will need 2 green and 2 red LEDS. My project is running at 3.3V.
I don’t have to control the 2 LEDs of the same color separately. What is the best way to wire these up?
Use one digital pin to control both LEDs each with their own resistor
Use one digital pin to control both LEDs with a common resistor (just confirmed that this is not a good choice)
a separate DO pin and resistor for each LED
Probably a silly question but wanted to confirm.
Another side question: Since I need the 4 LEDs and the LEDS are the big power consumers, what are my options for minimizing power consumption; i.e. increase resistor size to reduce current and give up some brightness?
Or use a single digital output pin to control an NPN transistor. Each led should get it’s own current limiting resistor in series, as one led might steal current from the other when there is just a common resistor. Put the pair of LED+resistor in parallel between the supply voltage and the collector of the NPN transistor. The transistor will switch on and off the current running through the LEDs and resistors.
Don’t forget a resistor between the outputpin and the base of the transistor, to limit the current into the base. (As it is also like a diode which can blow with any unimpeded voltage higher than about 0.6 volt)
How much current does it use now? Or what do you consider too much? Perhaps explain a bit of the need to do power minimization. Battery-powered and operational use?
If you need full brightness then you can pulse the leds for short periods at full current/brightness through PWM perhaps. As Lyndon hinted at, the eye can adjust for low light levels dynamically. Short bright pulses still seem bright on average, yet take less average current. But this can also cause some powersupply disturbances. It depends on your application if this is troublesome.
Valen has a good idea. To control LED brightness I always have a minimum resistor on “each” LED so they interact happily with one another. Using a 3.3v supply and the average LED having a 1.2v drop passing 20 ma max I would use a 100-ohm 1/4 or 1/8 watt resistor for maximum brightness. Before I ever programmed a PIC with PWM pulse-width-modulation I experimented with the circuit in the image below. The 555 must be everyone’s favorite chip and used in just about all of my projects for various purposes. I am retired trying to out race senility if I am off target.
oldtemecula:
…Before I ever programmed a PIC with PWM pulse-width-modulation I experimented with the circuit in the image below…
Off-topic: That motor should have had a reverse biased diode across it to shunt the inductive kick when the mosfet turns of. Lest the mosfet dies sooner or later.