Setting up a Common Anode Dual LED with one reference point.

Roger_tech

Aug 13, 2025
17
Joined
Aug 13, 2025
Messages
17
I want to use a dual LED in my schematic. The dual LED used is common anode. The LEDs should be controlled by a single pin from a battery charger IC. At one event the pin is pulled low, LED 1 should be ON. At another event, the pin open-drained. I've connected a 10k ohm resistor from my common anode node to this pin(so that it will be pulled high, when open-drained). When open-drained, the current from the pull-up resistor would drive a NPN transistor with the LED 2 connected at the collector and the emitter tied to ground. Are there any issues with this setup?

The IN pin is the 5V input from a USB_C receptacle.
The STAT pin is the reference pin.
Screenshot 2025-12-06 at 11.56.04 AM.png
 

Delta Prime

Jul 29, 2020
2,987
Joined
Jul 29, 2020
Messages
2,987
Are there any issues with this setup?
Unless your charger IC is capable of multiplexing, you’re gonna need two transistors which are probably integrated in the charger IC itself you may not even need drive transistors.
As it stands, it is bad engineering practice therefore.
Please provide datasheets for the components you wish to use
That includes your charger IC
Along with the entire schematic
Because…
Need to know the specifications of your LED, common anode
Need to know what type of transistor because it’s dependent on collector current and base current
R = (Vs - Vf dependent on color.
- Vce(NPN) depending on collector current and base current of your transistor. - Vlo)/If dependent on (Max)sink current of your charger,IC.
 
Last edited:

danadak

Feb 19, 2021
1,062
Joined
Feb 19, 2021
Messages
1,062
Rough mockup. Note if chg pin goes tristate this leaves one led on, so not
suitable solution. Note pin V max of 4.8 for case driving high but with load.
1765020722955.png
 

AnalogKid

Jun 10, 2015
3,045
Joined
Jun 10, 2015
Messages
3,045
If U11 pin 16 is rated to sink the amount of LED current you want without its output voltage rising above 0.4 V, then your circuit should work as is.

There is another connection trick that requires one extra diode, but no transistor and only one current-limiting resistor.

What is the voltage source for the circuit? (3.3 V, 5 V, other - ?)

ak
 

AnalogKid

Jun 10, 2015
3,045
Joined
Jun 10, 2015
Messages
3,045
Here is the basic idea from a post on another forum. In your case, SW1 is replaced by the uC open-collector output pin 16.

When the output is open-circuit, there is no current path for D6 so it is off. D7 is lit with current through R4. When the output is pulling low, D6 now has a current path. Because the D6 forward voltage Vf is lower than the combined forward voltages of D7 plus D8, D6 starves current away from them. It effectively "shorts out" D7 by pulling the voltage at the bottom of R4 down until it is less than the minimum required forD7 plus D8.

ak

LED-Switch-1-c2.gif
 

danadak

Feb 19, 2021
1,062
Joined
Feb 19, 2021
Messages
1,062
The only "tricky" part is with the newer highbright leds even at low V's a
few uA will cause a glow, so a check for that makes sense. This shows the
Green LED, when "off", has .75 mA thru it, its model has 2.1V at Vth. So looks
to be a problem getting it "off". RED led model's Vth is 1.7V.

1765104573392.png
 

AnalogKid

Jun 10, 2015
3,045
Joined
Jun 10, 2015
Messages
3,045
The only "tricky" part is with the newer highbright leds even at low V's a
few uA will cause a glow, so a check for that makes sense. This shows the
Green LED, when "off", has .75 mA thru it, its model has 2.1V at Vth. So looks
to be a problem getting it "off". RED led model's Vth is 1.7V.
Delete R1. It acts as a ballast resistor, and the circuit will not work with it in place. Yes, the two LED currents will be different. Cost of doing business. If the two LED brightnesses must be approx. equal, achieve this with component selection.

ak
 

danadak

Feb 19, 2021
1,062
Joined
Feb 19, 2021
Messages
1,062
Delete R1. It acts as a ballast resistor, and the circuit will not work with it in place. Yes, the two LED currents will be different. Cost of doing business. If the two LED brightnesses must be approx. equal, achieve this with component selection.

ak
R1 represents the output drive Z from the cmos gpio, a crude estimate based on
a processors min max Vol Voh at speced current ratings.

Forcing it to 0 ohms still problem remain, green not shutting off if glow issue
there with actual parts.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,270
Joined
Nov 17, 2011
Messages
14,270
Looking at the MP2672 datasheet, we see, that [imath]\overline{STAT}[/imath] is an open drain output. It can not actively deliver a high signal. So the solution provided by @AnalogKid in post #5 is probably the most basic one.
 

Stefanjack

May 7, 2026
1
Joined
May 7, 2026
Messages
1
Your approach can work, but the main issue is that a 10k pull-up usually won’t provide enough current to properly drive the NPN transistor and illuminate LED2 reliably. The transistor may stay in a weak or undefined state.
A better approach is to use a stronger pull-up (for example 1k–4.7k depending on current needs) and add a base resistor to the NPN transistor. Also make sure the charger IC’s STAT pin can safely sink the LED current when pulled low.
 
Top