BJT switching and LED at output

Thread Starter

Shane47

Joined Jul 22, 2023
12
Hi,

I wanted to switch to 12V output using a NPN BJT. To indicate HIGH and LOW, I wanted to connect a LED, I simulated output in the LTSPICE, which shows connecting the LED will not give me the correct Out. Any ideas on how to tackle this ?

1690047089701.png1690047106865.png

Thanks
 

crutschow

Joined Mar 14, 2008
38,316
You circuit should work with proper component values.

To fully turn on the transistor R1 should be no larger than 10 times R3, or 1kΩ (base current should be about 1/10th of the maximum collector current for good transistor saturation).

Also use an actual transistor model, not the default, as it can cause flakey operation.

What is the purpose of C1, as that will generate a large transient current when the transistor turns on?
 

boostbuck

Joined Oct 5, 2017
1,034
Apart from the valid comments above, the circuit switches as you might want, but will not work as you are not supplying enough current to the LED.

That LED has an operating current of about 1 Amp, but your circuit will supply 12V / (100 +1000 ohms) is about 10 mA or one hundredth of the required current.
 

BobTPH

Joined Jun 5, 2013
11,463
I know that but why are you telling me it's not my circuit. The TS said: " I want the LED lit when the output is HIGH(12V) and LED off when 0V."
It was directed at the TS, sorry about the confusion.

I know you know that. It is just that the TS stated the behavior based on the output, not the input as one would normally do. And it is not clear to me that he understands that the circuit is an inverter.
 

DickCappels

Joined Aug 21, 2008
10,661
When the input is high, do you want the LED to be on or off?
What is the source of the input signal (examples: NE555, PIC controller, manual button, etc?)

I think we can give you a corrected schematic with the additional information requested above.
 

ScottWang

Joined Aug 23, 2012
7,498
Why the voltage of the input pulse is 10.75V, why it is not 10V or 12V?
The output terminal is connected to what kind of component or device?
 

WBahn

Joined Mar 31, 2012
32,703
Hi,

I wanted to switch to 12V output using a NPN BJT. To indicate HIGH and LOW, I wanted to connect a LED, I simulated output in the LTSPICE, which shows connecting the LED will not give me the correct Out. Any ideas on how to tackle this ?

View attachment 298848View attachment 298849

Thanks
It would help if you let us know what signal your graph is showing the voltage for? Is it the collector of the transistor? Don't make people that you are asking for free help from have to guess. Help us help you.

What is it that is telling you that the circuit is not doing what you want it to do. Don't make us read your mind.

As I see it, your approach is to have the LED on when the input signal is LO, placing the transistor in cutoff. How much current does your LED need to be adequately illuminated? What is the forward voltage across the LED when it is illuminated? Don't make people that you are asking for free help have to spend time trying to look up the specs on the components you are using. Again, help us help you.

A typical LED used as an indicator will have a voltage drop of about 2 V and a current of about 10 mA.

When you input signal is LO, your output appears to be about 11.2 V, which would be about 8 mA through R3 and a further drop of about 8 V across R2, putting the forward drop across D2 at about 3.2 V. That suggests that it is a blue or a white LED. Unless it is a power LED, it should be ON in this state.

When your input is HI, the voltage at the collector is about 2.2 V, which is not enough to forward bias the LED, so it is OFF in this state. You have a current of 100 mA through R3. To put the transistor into saturation, you need a base current on the order of 10 mA. But your base current is only about 1 mA. So your transistor is operating in the active region with a beta of about 100, which is likely what the transistor model is set for.

Bottom line, the circuit appears to be doing what you appear to want it to do, provided that 8 mA of current in the LED is sufficient to get it to light up. If you are using an LED that needs considerably more current than that, the question becomes... why are you doing that?
 

Thread Starter

Shane47

Joined Jul 22, 2023
12
When the input is high, do you want the LED to be on or off?
What is the source of the input signal (examples: NE555, PIC controller, manual button, etc?)

I think we can give you a corrected schematic with the additional information requested above.
I want the LED ON when the output is HIGH
Apart from the valid comments above, the circuit switches as you might want, but will not work as you are not supplying enough current to the LED.

That LED has an operating current of about 1 Amp, but your circuit will supply 12V / (100 +1000 ohms) is about 10 mA or one hundredth of the required current.
I realized that I picked up a random LED model from LTSPICE but I was planning to use a typical LEDs with ~2V Vf and 10-20mA If.
 

Thread Starter

Shane47

Joined Jul 22, 2023
12
When the input is high, do you want the LED to be on or off?
What is the source of the input signal (examples: NE555, PIC controller, manual button, etc?)

I think we can give you a corrected schematic with the additional information requested above.
I want the LED ON when input is LOW ie OUTPUT HIGH.
Source of the input is an opamp output.
 

WBahn

Joined Mar 31, 2012
32,703
But what is it that you are seeing that is giving you the impression that the original circuit isn't working (even given the poor choice of LED model)?
 

Thread Starter

Shane47

Joined Jul 22, 2023
12
But what is it that you are seeing that is giving you the impression that the original circuit isn't working (even given the poor choice of LED model)?
My actual concern was to get a perfect 12.0 V output, while still using the led to visually reflect the output.

The led I chose is a random LTSPICE model. I am looking to use something with 2V vf and 10ma if
 

boostbuck

Joined Oct 5, 2017
1,034
Since the output in your circuit is at the junction of the resistor and LED, the output voltage is 12V minus the voltage drop across the resistor, at the operating current of the LED. It will be 12V exactly if no current is drawn. Any circuit's 'perfect' behaviour will be impacted by such practical issues.

You might consider, for example, moving the LED to before the output transistor so it doesn't influence the output by its load. Or giving the LED it's own transistor so that the effective drive current is low enough to be an acceptable load.
 
Top