LED status readback circuit

Thread Starter

plumbum_by

Joined Jul 23, 2019
6
Sorry for such foolish question, but what is the behaviour of circuit below:

led_circuit.png

LED_ON is 3.3V logic control signal, LED_STATUS is output signal to MCU pin (GPIO).

When LED_ON is logic high and Q1 is open LED1 is ON and LED_STATUS = '0', but what will happen when LED_ON = '0'? Q2 will be closed, LED1 will be OFF, but what will be the state of LED_STATUS signal? Will it be +5V (logic high) or floating and why?
 

scorbin1

Joined Dec 24, 2019
103
If Q1 is conducting, ie. LED On, Your GPIO pin would be held low because the effective resistance of the BJT is negligible compared to the 560Ω current limiting resistor. When Q1 is not conducting, ie. LED Off, your GPIO pin will be held high because the effective resistance through Q1 should be very near to 0 making the 560Ω resistor mostly negligible compared to the BJT.

Please note I say 'effective resistance' for simplicity of explanation. The BJT doesnt actually change it's resistance, but instead controls current flow.
 

Audioguru again

Joined Oct 21, 2019
5,816
Doors open and close. Transistors turn on and turn off.
When the transistor is turned off then the "LED Status" will be floating around +3.2V. Any load current to ground at "LED Status" will cause the LED to glow.

If the transistor is turned on properly then the LED current is (5V - 1.8V - 0.2V)/560 ohms= 5.4mA.
Then the transistor's base current should be 0.54mA.
The 330 ohm resistor value is way too low causing a base current of (3.3V - 0.65V)/330 ohms= 8mA, but the 3.3V logic probably cannot produce 3.3V at the high current of 8mA.

I would calculate the base resistor value to be 3V/0.54mA= 5.6k ohms.
 
Top