Electronics > Projects, Designs, and Technical Stuff
MOSFET driven by open-drain level shifter...anything wrong here?
(1/3) > >>
salfter:
I'm working on a 3D-printer control board based on the Teensy 3.6, which has 3.3V I/O.  The N-channel MOSFETs commonly used to control things like the bed and hotend heaters tend to deliver lower Rds(on) values as Vgs goes up.  I thought it'd be a good idea to shift the 3.3V heater signals from the Teensy up to 5V to switch the MOSFETs.

What I've come up with is in the attached image.  HEATER_BED is a 3.3V active-high signal from the Teensy.  It goes through 1/6 of a 74LCX07, an open-drain buffer running at 3.3V.  The output is pulled to 5V with a 1k resistor, then passes through a 100-ohm resistor on the way to the MOSFET's gate.  A 10k pulldown is placed across the MOSFET's gate and source, with the source connected to ground and the drain going to the load: an LED (with dropping resistor) and a bed heater that'll run at 12-24V (or an SSR controlling a 120VAC bed heater).  Values for R29 and R31 are ripped from https://toms3d.org/2016/01/11/guide-properly-picking-and-using-mosfets/; the value for R27 is copied from another part of this project that uses the 74LCX07 for level-shifting into a 5V LCD module.

The thing I'm not entirely sure about is having a pullup and a pulldown on the same signal.  I'm thinking that the junction to the left of R29 will be at either 5V (if the output of U9A is floating when HEATER_BED is high) or 0V (if U9A is pulling the output low when HEATER_BED is low).  The 5V when HEATER_BED is high should then override the pulldown from R31 to turn on the MOSFET, while 0V when HEATER_BED is low should turn off the MOSFET.

Will dueling pullups/pulldowns work like this?  Do I even need R31 in this instance?  The aforementioned webpage recommended it to ensure that the FET is either full-on or full-off so that it never gets into a resistive state that lets the magic smoke out, but if U9A and R27 are guaranteeing either 0V or 5V output, would it be safe to leave out R31?
ogden:

--- Quote from: salfter on March 25, 2019, 04:24:17 pm ---The thing I'm not entirely sure about is having a pullup and a pulldown on the same signal.

--- End quote ---

Right question :) Pull-down is not because of MOSFET gate, but microcontroller pin instead - when MOSFET gate is driven directly from uC pin. Pin of uC usually has "hi-z" state (floating) while in reset/uninitialized. Also 10k is unnecessarily small resistance, 100k is good enough.
jonroger:
All you need is a pull-up to 5V and another resistor to limit teensy pin output.   Direct from teensy to the mosfet gate (no buffer).   Then switch the teensy pin between an input (high impedance, which results in 5V on the gate) to a low output (a sink resulting in near zero on the gate).

Do be careful about what happens when the teensy does nothing (heater on may be a bad default).

Another option is to use a mosfet that is OK with just 3.3V on the gate. 
Hiemal:
Or to just use a proper mosfet driver!
emu_herder:

--- Quote ---dueling pullups/pulldowns
--- End quote ---

A dueling pull-up and pull-down just give you a voltage divider. In this case, with 1.1k on top and 10k on bottom, you get 90% of your source voltage or 4.5V.

Looking at this MOSFET's datasheet, it's fully on at 4.5V and they even specify the on-resistance of 3.0mOhm at 4.5V, so that's actually plenty. If you wanted to get closer to your full 5V, you could change R31 to 100k for ~4.95V. All R31 does is make sure the gate capacitance of the MOSFET discharges when you aren't driving it, so that it turns off when there's no control signal to it. FETs don't turn off until you discharge their gate.

That said, I don't think this is the circuit you want. With an open drain, you not only have very little drive current to turn the FET on, but also with no input to the buffer, the FET will be on(as soon as you power your circuit and before the microcontroller takes control).

Ideally you want an output stage with a pair of transistors that can push/pull the gate. This FET doesn't have a huge gate and I imagine you aren't switching it very often, so that can be almost anything. I attached a simple drive circuit with typical resistor values. I don't guarantee they're ideal values but they're safe values for the microcontroller and drive transistors, so the MCU can't push more than 3mA and the transistors can't push more than 500mA.

If you're trying to drive a lot more than the 10A I've shown through the heater, like the 100A that FET is rated for, you might want to just use a dedicated gate drive IC, or at least use FETs as your drive transistors, and reduce the gate resistance to 1-2ohms, so that your switching times are as short as possible to limit switching loss.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod