3.3V to 5V logic converter using p-channel mosfet

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.

• What's the VGS Threshold for your mosfet? May 12, 2016 at 20:50
• That circuit will require an N-channel MOSFET and will invert your data.
– Tut
May 12, 2016 at 20:50
• 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.
– dim
May 12, 2016 at 21:02
• @dim only if it's 0.6 * VCC. Most ICS I've seen are 0.7 * VCC, or 3.5V minimum. May 12, 2016 at 21:16

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.

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.

• 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 ^.^ May 12, 2016 at 21:04

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.

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

and

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

• 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? May 18, 2023 at 1:53
• @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. May 18, 2023 at 1:57
• 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 :( May 27, 2023 at 18:51
• @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? May 27, 2023 at 19:18
• 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. May 27, 2023 at 20:50

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

N-ch MOSFET inverted level shifter:

• 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.

• 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. May 16, 2023 at 2:00
• 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. May 17, 2023 at 23:49