Hello,
I was reading these two websites with some solutions to use an LED with an open-drain output.
microcontroller - Driving a LED with an open drain digital output - Electrical Engineering Stack Exchange
Driving LEDs with Open Drain Port Expander Outputs (maximintegrated.com)
I am interested in the solution with a PNP transistor. Both websites suggest the use of a pull-up resistor to mitigate the leaking current. Although both websites suggest different sources for the leaking current.
First website,

"
If Q1 is off there won't be any base current through Q1, so the LED will remain off. Q1 will have a small leakage current, and to avoid that this would get amplified by Q2 I added R3. As long as the leakage current is less than 0.7 V / 15 kΩ = 50 µA all the leakage current will flow through R3, so that will ensure Q2 will be completely off.
"
Second website,

“
the optional 1MΩ resistor ensures that transistor Q4 is off when the port output is high (high impedance), and it should only be necessary at elevated temperatures when Q4 becomes relatively leaky.
“
So I think the first refers to the leaking current from the transistor configured as open-drain and the second website refers to the leaking current from the PNP transistor.
My question is why the resistor works in either case. Why the current still doesn’t flow through the base of the PNP transistor?
Thank you
I was reading these two websites with some solutions to use an LED with an open-drain output.
microcontroller - Driving a LED with an open drain digital output - Electrical Engineering Stack Exchange
Driving LEDs with Open Drain Port Expander Outputs (maximintegrated.com)
I am interested in the solution with a PNP transistor. Both websites suggest the use of a pull-up resistor to mitigate the leaking current. Although both websites suggest different sources for the leaking current.
First website,

"
If Q1 is off there won't be any base current through Q1, so the LED will remain off. Q1 will have a small leakage current, and to avoid that this would get amplified by Q2 I added R3. As long as the leakage current is less than 0.7 V / 15 kΩ = 50 µA all the leakage current will flow through R3, so that will ensure Q2 will be completely off.
"
Second website,

“
the optional 1MΩ resistor ensures that transistor Q4 is off when the port output is high (high impedance), and it should only be necessary at elevated temperatures when Q4 becomes relatively leaky.
“
So I think the first refers to the leaking current from the transistor configured as open-drain and the second website refers to the leaking current from the PNP transistor.
My question is why the resistor works in either case. Why the current still doesn’t flow through the base of the PNP transistor?
Thank you