Electronic – Will this transistor setup work for powering a LED

transistors

I think this should work but I would love for someone to confirm it to me.
Transistors aren't really something I'm very familiar with.

Goal:
Power on D1750 (Orange LED) when VCC42 is low – Power off when VCC42 is high
Power on D1760 (Green LED) when VCC33 is high – Power off when VCC33 is low.

Basically an orange standby light and a green power on light.

Supplies:
VCC33_HOT: Always on supply, running when the power is plugged in – Created from a TPS62177 IC
VCC33: 3.3V Supply only running when the device is in an "ON" state – Created from a TPS62135 IC
VCC42: 4.2V Supply only running when the device is in an "ON" state – Created from a TPS62140 IC

Schematic:
BC857 (The transistor, T1)

My 'design':
Schematic

Thanks in advance, much appreciated!

Best Answer

The T1 circuit will work as expected provided that the transistor supply voltage is <= the base drive voltage. It is in your case so your circuit should be fine.

Here is an explanation of the trap that many fall into:

enter image description here

Figure 1. The "high-side" switch fail. Source.

  • If If \$ V_{SS}>V_{MICRO} \$ then the output protection diodes built into the chip provide a sneak path for the base current.
  • The e-b junction of Q1 will be forward biased and current will flow through it, R1 and D1 to the micro supply.
  • Q1 will turn on and LED will light and will not switch off.

Because your micro supply is 4.2 V and the transistor's emitter is at 3.3 V a high on the output will turn the transistor hard off.


LED current

enter image description here

Figure 2. Resistance calculation. Source.

Let's select a current of 5 mA for your LED. This is enough for most modern small LEDs to glow brightly. From Figure 2 we can see that at 5 mA an orange LED will drop about 1.65 V. Allowing about 0.3 V drop across your transistor that leaves 3 - 1.65 = 1.35 V across the current limiting resistor. From Ohm's law you can calculate the required value as \$ R = \frac {V}{I} = \frac {1.35}{5m} = 270 \ \Omega \$.

Base resistor

  • The base resistor we can use the rough approximation of \$ I_c = h_{fe}I_b \$ where \$ I_c \$ is the collector current, \$ h_{fe} \$ is the transistor gain and \$ I_b \$ is the base current.
  • The collector current is 5 mA and we can assume a gain of > 100 for a small signal transistor.
  • From the above \$ I_b = \frac {I_c}{h_{fe}} = \frac {5m}{100} = 0.05\ \mathrm{mA} \$.
  • A suitable base resistor is then \$ R = \frac {V}{I_b} = \frac {3}{0.05m} = 60 \ k\Omega \$. To be sure to drive the transistor fully into saturation most of us would pick a lower value to increase the base current. The transistor won't mind. 33 kΩ would be fine.