0
\$\begingroup\$

I am trying to convert a 3.3V logic signal to 5V logic signal. I am using a p-channel MOSFET and I can not get it to send the full 5V signal through. Below is the circuit I am using. 3.3V to 5V Converter

\$\endgroup\$
4
  • \$\begingroup\$ What's the VGS Threshold for your mosfet? \$\endgroup\$
    – Passerby
    May 12, 2016 at 20:50
  • 2
    \$\begingroup\$ That circuit will require an N-channel MOSFET and will invert your data. \$\endgroup\$
    – Tut
    May 12, 2016 at 20:50
  • 1
    \$\begingroup\$ We don't know to which component the 5V signal is sent, but if it is some logic IC that has logical levels compatible with TTL, you may ba able to send the 3.3V signal directly to it. Standard 5V and 3.3V logic levels are compatible. Check the Voh voltage of the 3.3V device against the Vih voltage of the target 5V device. \$\endgroup\$
    – dim
    May 12, 2016 at 21:02
  • \$\begingroup\$ @dim only if it's 0.6 * VCC. Most ICS I've seen are 0.7 * VCC, or 3.5V minimum. \$\endgroup\$
    – Passerby
    May 12, 2016 at 21:16

3 Answers 3

4
\$\begingroup\$

Use an N-channel MOSFET, or swap the 100k resistor and the P-channel MOSFET.

Also, it'll work a bit better with a lower value resistor. Say, 10k. And both circuits will invert your logic. If you cannot deal with that, then you need a few more components (another MOSFET, for instance).

See the below diagram for two ways that work.

schematic

simulate this circuit – Schematic created using CircuitLab

The MOSFETs in the schematic are merely symbolic, the part numbers may or may not be appropriate.

Because of your 3.3V input, you must choose a MOSFET with an appropriate low turn on voltage. That is, \$V_{gs(th)}\$ must be sufficiently below 3.3V, otherwise your MOSFET will not turn on or be barely on.

\$\endgroup\$
1
  • \$\begingroup\$ There are many MOSFETs now in which your P solution will not close enough to create a 0V out with 3.3V in. However, connect them in series and you have a nice example of your second suggestion ^.^ \$\endgroup\$
    – Asmyldof
    May 12, 2016 at 21:04
3
\$\begingroup\$

There is a fairly standard logic level shifter implemented with an N-channel MOSFET. The level shifter can be used in either direction. Either side may pull the other to (near) ground. The level shifter shown here is designed to work best with open-collector / open-drain drive signals. If it is to be used in one direction only, and the input signal is driven by a circuit with, say, a totem pole or push-pull output, then the resistor on the input side of the level shifter may be omitted.

schematic

simulate this circuit – Schematic created using CircuitLab

Edit:

I have so far failed to find a through hole mosfet which I consider suitable for use in this circuit and which can actually be purchased :(

Signal level through hole mosfets are not as common as power level through hole mosfets (as in TO-220) style. However, 2N7000 is one such signal level through hole device.

I tested the above circuit using a 2N7000 by alternately connecting V3 and V4 signal sources to the circuit.

At 100kHz, the results were

enter image description here

and

enter image description here

At 1 MHz, the rise time on the output side was a significant fraction of the total cycle time.

\$\endgroup\$
5
  • \$\begingroup\$ It looks like going from 5 V on the right to 3.3 V on the left, uses the body diode to get a 0.7 V logic low. Is that the case? \$\endgroup\$
    – PStechPaul
    May 18, 2023 at 1:53
  • 1
    \$\begingroup\$ @PStechPaul, yes the body diode is used to bring the source pin down toward 0.7V. However, once the source pin is 3.3V - Vth, the channel will begin to conduct. 2N7000 may not be the most ideal transistor, it has a wide Vth range. \$\endgroup\$ May 18, 2023 at 1:57
  • \$\begingroup\$ I have so far failed to find a through hole mosfet which I consider suitable for use in this circuit and which can actually be purchased :( \$\endgroup\$ May 27, 2023 at 18:51
  • \$\begingroup\$ @PeterGreen I ran some simulations using a 2N7000 at 100 kHz. I have edited the answer to show my results. Results at 1 MHz were not as nice. What is the maximum pulse frequency you need for your application? \$\endgroup\$ May 27, 2023 at 19:18
  • \$\begingroup\$ To me the problem with the 2N7000 is that the worst case threshold voltage is way too high. With a "typical" part and a 3.3V supply that is bang on 3V3 i'm sure it will work. With a worst-case part and a 3.3V supply that is under-nominal not to much. \$\endgroup\$ May 27, 2023 at 20:50
1
\$\begingroup\$

Convert Logic Signals to a higher voltage (e.g., 3V->5V)

N-ch MOSFET inverted level shifter:

Logic Level Boost Circuit Diagram

  • Drain: output (pull-up to +5V)
  • Gate: input (signal to level-shift)
  • Source: Gnd

The signal is inverted, just like it would be using a P-ch mosfet.

Adjust R1 for the current needs. A higher value of 2-10K for the pull-up will limit the current significantly. So if you don't get the output voltage you expect when connecting it to your load, try reducing the pull-up resistor value.

If your load has significant impedance (such as a solid-state relay), you may need a pull-up closer to 100 ohms.

\$\endgroup\$
2
  • \$\begingroup\$ The image in your answer doesn't show because the link is incorrectly placed. Also, your answer is the same as one of the circuits in @uint128_t's answer. \$\endgroup\$
    – PStechPaul
    May 16, 2023 at 2:00
  • \$\begingroup\$ Yes, @uint128_t gave a great answer, but it seems a separate diagram for the simplified (inverting) version makes it clearer, if non-inverting isn't a requirement. It's also helpful to show it works with a 2N7000. It's complicated enough soldering just the above into a cable, without adding a second stage. \$\endgroup\$ May 17, 2023 at 23:49

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.