10
\$\begingroup\$

I know I can use a transistor as a switch like this:

schematic

simulate this circuit – Schematic created using CircuitLab

Can I use only one transistor that will output the same signal (not inverted)? I want to use it to shift voltage level. The input is digital at 3.3V and should output 5V TTL levels.

\$\endgroup\$

3 Answers 3

20
\$\begingroup\$

This circuit tends to be used quite often: -

enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ Very interesting. Would it be possible to put one GPIO of a board such Raspberry or BeagleBone at the input without frying the board? What I don't understand is: at the basis you have a constant voltage, the collector is pulled up. So how can you be sure that no current is moving from the 5V to the input? Eventually destroying the driving board? \$\endgroup\$
    – Dave
    Jan 23, 2016 at 20:37
  • \$\begingroup\$ Because the transistor is configured as an emitter follower and the voltage on the emitter is base voltage minus about 0.6V. If the emitter got higher it would turn off the transistor thus preventing the voltage rising much above about 3V. Think of base and emitter and what differential voltage they must be at to stat to turn the transistor on. \$\endgroup\$
    – Andy aka
    Jan 23, 2016 at 21:41
  • \$\begingroup\$ @Andyaka Will this work if we change 5V to 3.3V? \$\endgroup\$ Aug 14, 2018 at 18:36
  • \$\begingroup\$ If you did that you wouldn’t need a level shifter. \$\endgroup\$
    – Andy aka
    Aug 14, 2018 at 21:22
21
\$\begingroup\$

Absolutely.

enter image description here

This circuit takes advantages of the properties of a MOSFET to bidirectionally switch a signal between two different voltage levels.

\$\endgroup\$
7
  • \$\begingroup\$ I was interested in doing this with a bipolar PNP or NPN. \$\endgroup\$
    – Cornelius
    Apr 21, 2014 at 17:15
  • 4
    \$\begingroup\$ @Cornelius This answer is the better one dude because it is bidirectional whereas my circuit is not. \$\endgroup\$
    – Andy aka
    Apr 21, 2014 at 17:16
  • 1
    \$\begingroup\$ @Andyaka: You're a good guy. Ignacio: useful circuit :) \$\endgroup\$
    – bitsmack
    Apr 21, 2014 at 19:26
  • 1
    \$\begingroup\$ @bitsmack yeah I'm all-heart muhuhahaha \$\endgroup\$
    – Andy aka
    Apr 21, 2014 at 20:05
  • 1
    \$\begingroup\$ If you have 5V on both sides then why do you need a level shifter? \$\endgroup\$ Aug 7, 2015 at 18:51
9
\$\begingroup\$

The input is digital at 3.3V and should output 5V TTL levels.

For this situation you very likely do not need any conversion circuit at all.

Both 3.3 V and 5 V TTL logic switch with a threshold of about 0.8 V. Therefore no conversion circuit is needed to drive a 5 V TTL input with a 3.3 V logic signal. To be absolutely sure, check the minimum Vih of your 5 V TTL device and make sure this number is less than the minimum Voh of your 3.3 V device.

This figure, from the TI app note, "Selecting the Right Level-Translation Solution", shows that the specified input, output, and threshold levels are the same for 5 V and 3.3 V TTL circuits:

enter image description here

If your devices are actually not TTL but CMOS, you may still be able to connect them without a conversion circuit, but noise margin will be reduced because the CMOS switching threshold is Vcc/2 rather than a fixed voltage level.

As you see from the chart, you cannot reliably use a 3.3 V TTL signal (or even 5 V TTL) signal to switch a 5 V CMOS input, so for either of those situations you would need a converter circuit as outlined by the other answers here.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.