Author Topic: Issue in basic transistor circuit  (Read 1555 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Issue in basic transistor circuit
« on: April 01, 2021, 08:47:34 am »
I have three input levels: 0V, 2.5V & 5V.
Output I need is:
A). 5V or 0V input, then output 0V
B). 2.5V input, then output is 5V


Need to made this circuit by using low cost transistors only. I tried making below circuit, but seems like transistor as buffer is not working. Can someone suggest correct method with lowest transistor count

 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16737
  • Country: us
  • DavidH
Re: Issue in basic transistor circuit
« Reply #1 on: April 01, 2021, 03:28:42 pm »
The circuit which commonly performs that function is called a "window comparator".  It can be made with two comparators.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 6841
  • Country: pl
Re: Issue in basic transistor circuit
« Reply #2 on: April 01, 2021, 04:17:00 pm »
I don't quite get this circuit.

Q2 is an inverter which goes low when Vin exceeds ~0.7V. Fine, that will take care of detecting the 0V case.
Q1 is an emitter follower. Meh, not sure why.

Q3, Q4 is kinda a NAND gate, but Q3 is also an emitter follower. The output will never go lower than Q3 emitter because of Q3 saturation. That's not good.

And NAND doesn't even look like the right function here, it seems you need NOR. This is as simple as removing Q3 and making Q4 driven by either Q1 inverter going high (0V input) or the divider R1/R7 (whose values are quite wrong btw) going high.


If you want a solution, I think this will work:
Leave R5, Q2 as is.
Replace R4 with a 4k7/1k or similar divider connected to the input.
Connect Q4 base to the output of said divider.
Remove everything else.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3447
  • Country: nl
Re: Issue in basic transistor circuit
« Reply #3 on: April 01, 2021, 06:25:21 pm »
Some suggestions:

With 0V input, you want 0V at the output -> Use a pull down resistor for the output.

With 2V5 at the input you want 5V at the output:
Use a resistor divider (From 2V5 to 600mV) and an NPN transistor, then an PNP transistor to pull the output high.

With 5V at the input, you want 0V at the output:
Use a resistor divider (From 5V to 600mV) and an NPN transistor, and then short the base of the other NPN transistor to GND.

This should work because the Collector-Emitter voltage of a saturated transistor is lower than the base voltage needed to open the other NPN transistor.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 6841
  • Country: pl
Re: Issue in basic transistor circuit
« Reply #4 on: April 01, 2021, 06:56:22 pm »
Yeah, it will. And another suggestion: turn that circuit upside down and ditch the inverter transistor :D

BTW, whatever you choose to build, mind that Vbe of a transistor decreases 2mV/°C. This has particularly bad consequences when the transistor is fed from a divider.
« Last Edit: April 01, 2021, 07:01:09 pm by magic »
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2122
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Issue in basic transistor circuit
« Reply #5 on: April 01, 2021, 07:00:00 pm »
You haven't specified how tight around the 2.5V you want the action, so I've assumed 2.5V +/-0.5V.

Here's a simpler (3 transistor) design. Assuming this is an academic exercise as 1K seems quite low - if it's for an actual design then probably increase the resistor values x10.

https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 6841
  • Country: pl
Re: Issue in basic transistor circuit
« Reply #6 on: April 01, 2021, 07:20:18 pm »
See what happens to your carefully crafted thresholds over temperature :D

For a sufficiently wide range it's barely possible to make it work within any tolerance at all.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3272
  • Country: gb
Re: Issue in basic transistor circuit
« Reply #7 on: April 01, 2021, 10:58:38 pm »
Need to made this circuit by using low cost transistors only.

Buy LM393 dual comparator for little more than the cost of transistors and end up with something that actually works.
 

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Re: Issue in basic transistor circuit
« Reply #8 on: April 02, 2021, 07:38:03 am »
I tried simulating in multisim and its working.
Next is to add one more input and get output like this:
I tried simulating by : Inverter+NOR+AND gate (5 transistors) and its working. Is there any way we can reduce number of transistors or use some digital gate IC/comparator for ease of operation and keeping low component count also.

 

Online magic

  • Super Contributor
  • ***
  • Posts: 6841
  • Country: pl
Re: Issue in basic transistor circuit
« Reply #9 on: April 02, 2021, 09:03:59 am »
This is what perfection looks like 8)
 :-DD

(Okay, not sure if it will work equally well in the real world. But I did simulate sensitivity to resistor mismatch at least - it seems to tolerate 5% pretty well.)

Next is to add one more input and get output like this:
I tried simulating by : Inverter+NOR+AND gate (5 transistors) and its working. Is there any way we can reduce number of transistors or use some digital gate IC/comparator for ease of operation and keeping low component count also.
If a reliable 5V supply is available, then all you need is LM393 and five resistors.
If not, the Doctorandus_P circuit can be made to work at reasonable temperature ranges. And the thing that I posted here is an improved version for unreasonable temperatures, replacing the NPNs with compensated bandgap references. Something similar could likely be whacked together with a pair of TLV431 or similar ICs plus a PNP.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19614
  • Country: gb
  • 0999
Re: Issue in basic transistor circuit
« Reply #10 on: April 02, 2021, 09:21:20 am »
I tried simulating in multisim and its working.
Next is to add one more input and get output like this:
I tried simulating by : Inverter+NOR+AND gate (5 transistors) and its working. Is there any way we can reduce number of transistors or use some digital gate IC/comparator for ease of operation and keeping low component count also.
Why not use a window comparator circuit, as mentioned above?

Here are some links. Just use the LM393, rather than the more expensive, surface mount only, TLV1702.
https://www.ti.com/lit/ug/tidub01/tidub01.pdf
https://www.electronics-tutorials.ws/opamp/op-amp-comparator.html
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12917
Re: Issue in basic transistor circuit
« Reply #11 on: April 02, 2021, 11:51:37 am »
It is *possible* to build the O.P's gated window comparator purely with jellybean NPN BJTs and resistors, without compromising on the window thresholds, with enough hysteresis to prevent indeterminate behavior and with reasonable temperature stability, but it certainly wont be cheap (or low power). 



Here is a LTspice sim of one possible solution, utilizing long-tailed pair discrete comparators with current mirror tails and hysteresis, and multi-transistor RTL logic to combine the comparator outputs, with a push-pull output stage.  As the O.P. didn't specify the acceptable range for the window, I am assuming that thresholds near 1.25V and 3.75V would be acceptable.



I've included a .plt file (rename it without the .txt) to show the output with respect to the two input voltages as they are swept over the range 0V to 5V, to show the hysteresis ranges.

However you'd be crazy to build this instead of the various IC comparator versions that have been proposed.  :popcorn:  :-DD
« Last Edit: April 02, 2021, 11:53:13 am by Ian.M »
 
The following users thanked this post: Ysjoelfir

Offline nali

  • Frequent Contributor
  • **
  • Posts: 664
  • Country: gb
Re: Issue in basic transistor circuit
« Reply #12 on: April 02, 2021, 12:27:35 pm »
I'm wondering if this is a homework assignment, and the objective is to think more about properly defining the problem before coming up with a solution. E.g. what are the parameters for the 2.5V 5V 0V states.

If for example you could say that anything that is within a PN junction's worth of 5V & 0V represents "true" for their respective states, and rather than say "2.5V" say that anything between the above values represents "true" for a 3rd state then you can simplify things with minimal use of BJTs and a bit of diode logic.

 
The following users thanked this post: fcb

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2451
  • Country: gb
  • Recovering Electrical Engineer
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 664
  • Country: gb
Re: Issue in basic transistor circuit
« Reply #14 on: April 02, 2021, 06:43:06 pm »
see https://www.pcbway.com/blog/Engineering_Technical/Battery_Monitor_Circuits.html

I can't see how that circuit would work. The cold end of R3 will sit at the Vf of the red LED, and as green & yellow LEDs typically require a higher Vf than red (plus the Vce of T1/T2) they would never light.
 

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Re: Issue in basic transistor circuit
« Reply #15 on: April 03, 2021, 10:14:49 am »
@sghioto suggested this circuit and in simulation in mutisim its working. But issue is Vcmr of LM393 is 0V to (Vupply-2.0V). How to accommodate that?
Edit: Max Vcc in system is +5V only.
« Last Edit: April 03, 2021, 10:26:03 am by Vindhyachal.takniki »
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3077
  • Country: us
Re: Issue in basic transistor circuit
« Reply #16 on: April 03, 2021, 10:30:34 am »
Quote
@sghioto suggested this circuit and in simulation in mutisim its working. But issue is Vcmr of LM393 is 0V to (Vupply-2.0V). How to accommodate that?
Edit: Max Vcc in system is +5V only.

Use voltage dividers to bring the inputs into the common mode range. You'll also, of course, have to adjust your reference voltages.
 

Offline camila

  • Contributor
  • !
  • Posts: 11
  • Country: us
Re: Issue in basic transistor circuit
« Reply #17 on: April 03, 2021, 11:19:01 am »
Must have tried with the diode combinations
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf