Can I level shift without inverting using a single NMOS? - Page 1
Forum section: electronics / projects

author: drakejest
author_rank: Regular Contributor
timestamp: August 02, 2021, 12:38:41 pm
content: Is there anyway to reliably level shift without inverting the output signal using a single NMOS? Preferbly using the 2n7002 NMOS because i already have those on hand.Can it be done like in sparkfuns schematics?What would be the ratings of the level shifter? my highest voltage i can shift to is the DS rating on the NMOS? How about the drive capability, i would guess that i should limit the drive current on what my mCU gpio can signk right?

author: fcb
author_rank: Super Contributor
timestamp: August 02, 2021, 12:55:16 pm
content: Yes. That's a pretty common way of doing it, should work fine with 2N7002 if the supplies are say 3.3 and 5.Can even work shifting between 1.8V and 10V although you are close to the lower borderline (defined by Vgs of the MOSFET, you are in (or close to) the linear region and speed will be an issue as well as temperature dependencies).

author: drakejest
author_rank: Regular Contributor
timestamp: August 02, 2021, 01:14:20 pm
content: Speed not much of an issue, im running it at relatively low speeds 100 - 400 kHz. what about its drive capabilities though?Also im confused arent mosfets 'bi-directionnal' when turned on ? so what is preventing the high voltage going into the low voltage?

author: razvan784
author_rank: Regular Contributor
timestamp: August 02, 2021, 01:39:57 pm
content: Quote from: drakejest on August 02, 2021, 01:14:20 pmYes, but the mosfet is only on when the signal is low. When the signal is high the mosfet is off, but mind the body diode, which is also off when connected from the side with the lower supply towards the one with the higher supply.

author: jpanhalt
author_rank: Super Contributor
timestamp: August 02, 2021, 01:47:28 pm
content: This is my old link to the Philips/NXP (AN97055) shifter:https://www.nxp.com/docs/en/application-note/AN10441.pdfIt should go directly to the newer version of the application note, AN10441. See section 2.1.1 of the new version.

author: Zero999
author_rank: Super Contributor
timestamp: August 03, 2021, 08:05:35 am
content: The circuit will also work with a BJT, but it gets run in reverse, so it can't level shift by more than 5V.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 03, 2021, 01:55:51 pm
content: Why invert the BJT? It works just fine in the normal way, and to much higher voltages.Note that a speed-up cap (say 47pF across R2) may prove beneficial. The input drive has to be symmetrical, which is usually the case (CMOS driving pin).I've used a similar mechanism in other circuits before; here's a complementary 12V level shifter for example:https://www.seventransistorlabs.com/Class_D_Amp.pdfSpecifically, after IC1B; note that its output only pulls up to 2*Vbe, and it can pull down towards zero (at a few mA). When pulling down, C2 quickly shunts off Q3, and D3+D4 biases Q4 on. Q4 turns off a bit slower (it does go into saturation) but Q3 only turns on after Q4's storage time is done, so the timing is fairly close (within 20ns I think it was). The pull-ups are CCS for speed, but they're not plain old CCS; in fact as one side saturates, base bias is shunted (D6-D7 drop less then 2*Vbe) saving bias current into the low side. More specifically, it acts as a current mirror, so the wasted bias current will about equal the load current. (Which as this is a gate driver, DC bias is about zero, so it's pretty efficient.)When a similar cross-coupling drive is used with PMOS, you have a very similar circuit as used in actual CMOS level shifters. (The difference there is, the PMOS Rds(on) is made relatively large so they act as conditional pull-ups that the NMOS can still pull down, and the gate and drain are cross connected so they act as a flip-flop, which removes static current draw.)The main trouble with discrete MOS is -- besides the obligatory* body diode -- the capacitance is just so high. They're all made for switching modest loads, not light logic signals. Mostly super old types too (like BSS138 and 2N7002). And RF transistors don't offer anything, as they've been cycled through regularly as technology and applications advance; you can get a 60GHz transistor today, but nothing for just a few.*There are very few devices available with separate substrate pin anymore; mostly for odd edge cases like battery switching, so rated for much more current (higher capacitance) than is useful for logic signals.So if you do need speed, and can't afford the lower pull-up resistors and everything, BJTs may be an option. You do need the extra resistor(s) though.Tim

author: langwadt
author_rank: Super Contributor
timestamp: August 03, 2021, 03:38:16 pm
content: Quote from: Zero999 on August 03, 2021, 08:05:35 amI'd think the MOS version has a slight advantage in that the body diode speeds up the first part of the rising edge

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 03, 2021, 06:25:53 pm
content: Quote from: langwadt on August 03, 2021, 03:38:16 pmSure. Though the BJT will remain saturated for a moment, while the input rises. Good enough to drive 10s of pF through the same voltage range I'd guess?Tim

author: Zero999
author_rank: Super Contributor
timestamp: August 03, 2021, 06:37:53 pm
content: Duh, there was no need for the BJT to be reversed.

author: MarkF
author_rank: Super Contributor
timestamp: August 03, 2021, 07:07:58 pm
content: Two interesting videos I found:1) This first one describes using the body diode of the MOSFET to provide bi-directional operation2) This second video has a detailed description and demo with the effects of frequency and source output impedance effecting the low level voltage

author: Zero999
author_rank: Super Contributor
timestamp: August 03, 2021, 10:00:40 pm
content: Quote from: langwadt on August 03, 2021, 03:38:16 pmI agree that the MOSFET version is generally better in most applications, but BJTs are generally cheaper. The only other advantage of the BJT version is it will work at a lower voltage.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 04, 2021, 02:35:50 am
content: A short video about level translation: