Author Topic: Single transistor level shifter  (Read 1687 times)

0 Members and 1 Guest are viewing this topic.

Offline belzrebuthTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
  • Country: gr
Single transistor level shifter
« on: May 24, 2021, 09:28:29 pm »
Hi all,
I'm trying to build a simple circuit that accepts a 0 to 1V (maybe more) square and converts it to 0 to 10V square or thereabouts.
Typical input value can be 0 to 5V and approx output should be at least 0 to 7V.
The caveat is that the output should be 0V when the input is disconnected.
This circuit feeds a flip flop clk input so it needs to be zero output when nothing is connected to the input.
Power supply is around 10V.
At first I thought about the attached circuit but then I realised that while it works for zero input when the input is entirely disconnected the output sits at almost VCC potential because it forms a voltage divider between VCC and ground.
Is there any single transistor that can do this?
NPN, PNP or even a MOSFET is acceptable but there's no room for an opamp or else I could use that.
I know that there are single opamps in smd package like the lm321 that take as much space as a transiistor and I could use that but wondering if there's any single transistor or mosfet solution.
Thanks!
 


Offline Manul

  • Super Contributor
  • ***
  • Posts: 1158
  • Country: lt
Re: Single transistor level shifter
« Reply #2 on: May 24, 2021, 10:49:00 pm »
I know that there are single opamps in smd package like the lm321 that take as much space as a transiistor and I could use that but wondering if there's any single transistor or mosfet solution.

I know, that it is not your question, but keep in mind rise and fall times, which might be important. Normally we try to keep digital signals transitioning fast. So op amp is a very poor choice. It is typically way too slow and also slows down even more because of saturation. With level shifters like in your schematic, it might be required to keep pull-up quite low to achieve fast transitions and high frequencies, because of transistor and load capacitance. If your flip flop has schmitt trigger inputs - you will not get digital flicker problems, but clock speed might be limited by slew rate if it is slow.
 

Offline belzrebuthTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
  • Country: gr
Re: Single transistor level shifter
« Reply #3 on: May 24, 2021, 10:54:45 pm »
That's perfect pqass.
I really wouldn't have thought of that.
So you're keeping the transistor biased at all times with the 10k going to the base?
Is the diode only there to protect the input from current flowing from VCC?
Will this be safe if I apply a square of say 0 to 10V at the base?
Maybe I should include a resistor in series with the input?

Manul :Thanks for your insight; this is not a high speed circuit.
It's intended to switch a signal on-off manually via a remote trigger.
There's actually a push-button with a debounce network in there as well and never had a false trigger event.
I only now needed to remotely turn this FF on and off while keeping the pushbutton functionality intact.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 910
  • Country: ca
Re: Single transistor level shifter
« Reply #4 on: May 24, 2021, 11:12:35 pm »
That's perfect pqass.
I really wouldn't have thought of that.
So you're keeping the transistor biased at all times with the 10k going to the base?
Is the diode only there to protect the input from current flowing from VCC?

Will this be safe if I apply a square of say 0 to 10V at the base?
Maybe I should include a resistor in series with the input?
Yes, the 10k keeps the transistor on by default.
The diode is there to suck current away from the base to 0V when the input is 0V.

Notice the voltmeter says 658mV when input is 1V.  That's the BE diode in the transistor.
So when the input is 1V, the diode is reverse biased and no current goes from input to base, therefore, no resistor required.
However, it may be necessary to use a schottky diode if a regular 1N4148 has a forward drop higher than the BE-drop.

Since the diode is reverse biased if input is greater than 0V, it doesn't matter how high the input can get (well, up to diode breakdown). What's important is that the input can get down to 0V. Or use a schottky and get ~200mV more headroom.
 
The following users thanked this post: belzrebuth

Offline belzrebuthTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
  • Country: gr
Re: Single transistor level shifter
« Reply #5 on: May 24, 2021, 11:14:06 pm »
Thanks so much for your awesome solution and explanation pqass.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 910
  • Country: ca
Re: Single transistor level shifter
« Reply #6 on: May 25, 2021, 12:10:40 am »
Thanks so much for your awesome solution and explanation pqass.

You're welcome.

See new simulator link below.  I've slowed down the clock and added ammeters to the base and input diode.

Notice that as the input goes from 1V to 0V, the current of 0.9mA alternates to the base or to the diode (which has a lower voltage drop at that current) pulling the node at the base from 638mV to 446mV (the latter shuts-off the transistor entirely; just some 31nA leakage).

Also, if you right-click the mouse over the CLK, click Edit, and change Max Voltage to 10 and DC Offset to 10 (ie. 0V-20V square wave), that it has no effect on the voltages at the base base node; still alternating between 638mV and 446mV.

http://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWEBmB0BskBMAWdn0B2SQwgTggUhCSpoFMBaMMAKABcaccV0AOGoXS8B1CIz4YcYPoSyRZOPjgqjo3dFjBY+VMroToEhcHBAATegDMAhgFcANu1YBzQcOTL3IPD2qRWACdvVCxvXH9TOFYAJXCcamNheVEoHzFI-2gEVgB3EIQwow9CqCCQYpRSyu5UsHgAtxqlCsMfdD8y-KSQCJ8WvoDg2t6E-oFkfjT6+DzWkrC5alCygAcQJarF+XHwNMaNnZHN333WdZXJidKRiH9XLd2V0-u4rDkRcDIwq72wpBgAOy+2yrHMTymCWWUzCllsjmc6xGvxGtzOblRLVRHTOAGdeh9fpcppFbA5cfRWMhiBCBAhuJ87mVqdQoZ9iQImQEAPbgHg41mTf5QWCQZDaAG9PkoEAAYQAMgBpVi8pACnyoHj1EVwMCGLCS4XIEDygDyAEEACKsIA
 

Offline AndersJ

  • Frequent Contributor
  • **
  • Posts: 410
  • Country: se
Re: Single transistor level shifter
« Reply #7 on: May 25, 2021, 01:19:46 am »
The diode MUST be a schottky.
To avoid the need of a schottky diode,
add a diode pointing right, in series with the base.

Also,
the driving circuit needs to be able to SINK the current through the 10K resistor.
The original circuit needed to SOURCE the current.

If the input is always 0-5V,
or 1-3V,
the diodes can be omitted if a 2N7002 or BS170 FET is used instead of a BJT.

If input sink current is an issue,
the 10K resistor can be larger, if a FET is used.
"It should work"
R.N.Naidoo
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf