Simple level shifter

Discussion in 'General Electronics Chat' started by cmartinez, Jul 7, 2018.

  1. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,512
    6,489
    I need a level shifter so that a 3.3V output from an MCU can trigger the input of an Nfet (TK40E06N1) whose requirements are that at least 4.5V are applied to its gate.

    The Nfet works fine if I apply 5V to its gate. But what I haven't been able to understand, is how to level-shift the 3.3V trigger from my MCU.

    It's imperative that as little current as possible is used in the circuit, that's why I tried to sim this arrangement in LTSpice, but I can't seem to make it work.

    [​IMG]

    The output reads at the same level as the input, and not at the 5V that I actually want:

    upload_2018-7-7_15-11-57.png

    What am I doing wrong?
     
  2. wayneh

    Expert

    Sep 9, 2010
    14,860
    5,343
    I'm confused by the circuit but here's a stab. MOSFET non conducting, output must be 5V. MOSFET conducting, Vout = 0 if V3 is low and 3.3V if V3 is high.

    The part that's confusing me is that the gate voltage will never be >3.3V, right? I thought you wanted 5V on the gate to turn it fully on?
     
  3. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,512
    6,489
    Maybe I didn't explain myself. I want the output of this circuit to drive another mosfet's gate at 5V.
     
    wayneh likes this.
  4. dl324

    AAC Fanatic!

    Mar 30, 2015
    7,225
    1,674
    I'm not sure why LTSpice isn't showing 5V at the output when the input is at 3.3V. The MOSFET should be off, and the output should be pulled to 5V by R2.
     
    cmartinez likes this.
  5. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,512
    6,489
    Could it be a faulty spice model for the 2N7000? ... I've already tried the 2n7002 model, to no avail...
     
  6. wayneh

    Expert

    Sep 9, 2010
    14,860
    5,343
    I suspect it's not fully off?
     
    -live wire- likes this.
  7. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,512
    6,489
    I played with the resistor's values a bit, changing R1 to 300K, for instance, and the result is still the same.
     
  8. dl324

    AAC Fanatic!

    Mar 30, 2015
    7,225
    1,674
    With a Vgs of 0V, it should be off. Idss is 1uA at 25C, so Vout should be more like 4.99V.
     
    cmartinez likes this.
  9. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,512
    6,489
    I know ... I've tried the sim using a different mosfet model, and it's still not working. Funny thing is, I have this same arrangement working using a ZVNL120A nFet, and it works just fine in the real world. But using 4k7 for R1 and R2.
     
  10. dl324

    AAC Fanatic!

    Mar 30, 2015
    7,225
    1,674
    It's the simulator because we know the circuit works. There are many commercially available circuits using 10k resistors; though they usually use a low Vth device.

    2N7000 is marginal at 3.3V, but Rds (on) is negligible with a 10k pull-up. So the output will still be recognized as a LOW.
     
    cmartinez likes this.
  11. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,512
    6,489
    What the heck, then... I'm just gonna breadboard it and test it, see how it goes... I'll be back with the results as soon as that happens.
     
  12. bertus

    Administrator

    Apr 5, 2008
    18,593
    3,603
    Hello,

    When you could get hold of an BS107, you would have a gate threshold of max 2 Volts.

    Bertus
     
    cmartinez likes this.
  13. jpanhalt

    Expert

    Jan 18, 2008
    6,383
    1,222
    cmartinez likes this.
  14. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,512
    6,489
    Good idea ... maybe I should just go with a small p-channel mosfet and use it to drive the n-fet's gate directly, like this:

    upload_2018-7-7_17-0-21.png

    I have a few ZVP2106ASTZ laying around, maybe they could do the trick, right?.

    EDIT: Orientation of the P-Fet has been corrected.
     
    Last edited: Jul 7, 2018
  15. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,512
    6,489
    Thanks, John. Interesting circuits. Thing is, I need the circuit to consume as small amount of current as possible. What do you think of my last post?
     
  16. jpanhalt

    Expert

    Jan 18, 2008
    6,383
    1,222
    I have not simulated your circuit. Intuitively, switching a mosfet gate would require very little current long time, but certainly the current for switching is high.

    Aside from the XBEE circuit that I have used, here are the options in my file:
    Microchip:
    http://ww1.microchip.com/downloads/en/DeviceDoc/chapter 8.pdf
    TI:
    http://www.ti.com/lit/sg/scyb018f/scyb018f.pdf
    Philips (secondary site):
    http://www.adafruit.com/datasheets/an97055.pdf
    Sparkfun board and schematic:
    https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide

    Sparkfun's circuit looks inviting.

    John
     
    cmartinez likes this.
  17. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,512
    6,489
    It certainly does, it looks exactly like the circuit I first tried before starting this thread... too bad I can't make it work in LTSpice...
     
  18. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,512
    6,489
    This is the last version of the circuit I'll be trying.

    upload_2018-7-7_17-18-16.png

    The load I'll be switching is actually a solenoid, so I've added a snubber to it, plus a weak pull-up resistor to the p-fet's gate to make sure that the circuit doesn't start with the fet turned on.
     
  19. ebp

    Well-Known Member

    Feb 8, 2018
    2,054
    725
    I suggest trying a sim run of the original circuit with V1 set to something a bit less than 3.3 volts - perhaps 2.5 to 3 V. This would make for negative gate-source voltage when the input is high.

    Another thing you might try to get some idea of how the FET model performs is to just make a common source circuit and drive the gate with a triangle wave of perhaps -1 V to +3 V, This should tell you something of the model's gate threshold and transconductance.
     
  20. dl324

    AAC Fanatic!

    Mar 30, 2015
    7,225
    1,674
    What's the threshold voltage of the P MOSFET? You're going to have 1.7V across the source-gate when you want it to be off.
     
Loading...