witching a mosfet with ground

vshortt

Senior Member
Can anyone point me in the right direction as to how to switch a logic level mosfet with a ground?

I can't supply +5 to the gate directly, the chip I'm using to switch it only switches the ground.

I'm thinking I needing to use an NPN transistor, but I'm not sure I'm on the right path...

any ideas?
 

MPep

Senior Member
Are you driving the MOSFET with a ULN2803 or the like?
If so, you need a resistor between the ULN2803 and +5V supply. Connect the Gate to the junction of the resistor and collector output.

MPep.
 

premelec

Senior Member
I'm not entirely sure I understand - but it would seem you need an inverter - just an NPN with resistor in collector to +V, a resistor from base to +V and then collector goes to N type MOSFET gate and switched ground [I liked witched better :) ] goes to base. When base is grounded collector goes high... MOSFET goes on. Keep track of what voltages are allowed where and what the open switch potential is from ground...
 

Dippy

Moderator
Eh :confused:

Can you do an example schematic of what you want. Just put any old symbol in for the 'switch' and how you wish to control it.
Are you talking about a high-sided switch? I (and everyone else) seem confused.
 

Andrew Cowan

Senior Member
You can switch a high sided P-channel MOSFET by connecting the gate to ground.

Or you can use an N channel MOSFET with an inverter on the gate (could be a pullup resistor). Don't try PWMing it using a pullup, though...

A
 

vshortt

Senior Member
Think of this as the simplest mosfet logic level switch. With an Nchannel mosfet, normally you would supply +5v to the gate to "tun on" the Source-to-drain circuit right? Simple...

I need to tun on the Source-to-Drain, but the chip I'm using DOES NOT make pins "go high" and supply +5v when on - they "go low" when on, supplying a ground. ... When not on, they supply .01v.

This is an LED Driver - I need to "boost the signal" from the driver to drive some highpower LED's. The driver itself is only capable of sinking 70ma per lead, I need more like 1400 - enter the MosFet.

Andrew: PWM is absolutley critical here.
 

BeanieBots

Moderator
If you just want to switch it on and off, then a pull-up resistor is all you need.
If you want to drive it with PWM, then you will need a proper FET driver (which in turn can be driven by your existing output with a pull-up resistor attached).

Why do I get the feeling we are going to go around the how to drive FETs loop again? Has it really been 2 weeks since we last covered this topic:(
 

vshortt

Senior Member
Easy Beaniebots,

I'm not asking about the basics of how to drive a Fet with a positive signal, however this is the first time I've had to drive one with a grounding switch, so it's new to me and I didn't see anything on the board about driving one with such a signal, so I decided to ask.

I'll look into the FET driver, but I think my best bet is really to just go with Pch Mosfets, correct me if I'm wrong.
 

Dippy

Moderator
Yeah, go for P MOSFETs though the precise connections depend on the application which is currently missing.
A P Chan gate to ground will switch it on as long as the MOSFET parameters/specs are observed.

But unless you actually spend 10 minutes drawing and posting a proposed schematic including voltage levels then people can't give you a precise answer.
 

vshortt

Senior Member
Okay, so here's a schematic of what I want to do.. I am sure that something needs to go in between the MOSFET and the IC... Disregard the fact that the schematic doesn't show the Serial in tied to ground... The part of the circuit where the pixaxe talks to the LED Driver chip via i2c works just fine. I can also tie an LED with a 220 resistor to any of the pins on the LED driver and then to +5 and make the LED do whatever I want.

The trick here is to take that signal and "bump it up" so that I can manage a string of 3Watt LED's - each channel will control a differnt color. There will be up to 7 LED's per stirng - some channels will only have a single LED, some 3, some 5, etc.... I essientially want to use the signal from the LED driver to drive the MOSFET with PWM so I can dim each string individually. However the LED Driver actually drives ground, not V+.

all of the output on the IC labeled "OUT X" are .01v when "off" and GROUND when on...

 

BeanieBots

Moderator
I haven't Googled that device so I'll stick with the assumption (bad I know) that it is an open collector device.
In which case, the solution is as I posted earlier.

You can TRY with a simple pull-up resistor but your FETs might get a bit warm depending on the PWM switching frequency and chosen FET gate capacitance.
(I'll leave out the lecture on how & why that is and why you'll have the same problem even if you use P FETs).
 

InvaderZim

Senior Member
BeanieBots is right, the same fundamental limitation on FET driving will exist if you us a pull-up or pull-down resistor. That being said, I'd try it with the P-Channel and pull-up resistors for a simple solution. It looks like you are driving LEDs; that's a low-inductance load, which makes it much more likely that you can get away with a bare-minimum FET driver. Why? Many FET failures happen when an inductive spike is coupled through a parasitic capacitance through the FET to the gate; if the gate is only being held by a weak pull-up, then the FET will switch when it shouldn't. This is also not really a problem here because there is no unlimited "shoot through" current as there is in a motor driver; current is always limited by the series resistor. If the FET accidently switched once in a while, it won't just fry.

There's a lot of good theory on FET driving, but all practical designs start with a decent topology and then swap parts until the FETs aren't running too hot or blowing up all the time. Use a precision thermometer (eg, your thumb) to monitor your FETs; if they heat up badly, most likely they aren't being turned off by the pull-up resistor fast enough (turn-off time much more critical than turn-on time, and your turn-off circuit is the weak link in this scheme). Go to a smaller pull-up or a FET with lower gate capacitance.

You'll want a small resistor in series with the gate also. Often people parallel a reversed diode with this resistor so that turn-on is limited but turn-off isn't (or is differently limited). But that's probably not necessary if your turn-off is driven by a pull-up and not a low-impedence driver.

Finally, a hardware question! I'll savor this day.
 
Last edited:

vshortt

Senior Member
Since I have a buch of N-channel Fets with a logic level gate, I solved the problem like this:

PNP transistor....

Collector connected to gate of N channel Mosfet and 100K resistor to ground

Collector connected +5

Base connected to LED Driver via 10K resistor

The 100K resistor on the Emiter-to-gate connection assures that the gate is always grounded, but is easily overcome by the the Emiter when the base of the PNP is connected to ground (via LED Driver)

Base resistor prevents open load to LED Driver.

Works like a champ and is cheap and lets me use the N-channels that I have on hand.

Mosfets are rated at 30A each, so they run nice and cool.

May not be the best solution for a small parts count, but it works for me because I have a lot of each of the parts.

 
Last edited:

John West

Senior Member
I'm getting really old and feeble minded. I had to redraw that schematic before it made sense to me.

It looks like an effective enough drive circuit for a power FET with high input capacitance - particularly at lower switching frequencies. I'd use it - though I'd probably switch to 220 Ohms on the base of the bipolar transistor to improve protection for the driver device. And I'd carefully select the value of the emitter resistor for max efficiency and coolest FET operation at the expected frequency of operation.
 

Dippy

Moderator
Glad it works. Doesn't look too efficient though hopefuly that doesn't matter.
I'm struggling with drawing a bit as I don't know what all those dots are?
Is the bipolar drawn correctly?

Unless sourcing/budget/time is an issue I think I'd have gone for a proper push-pull MOSFET driver i.c. which you could operate/switch in exactly same way but a lot more efficient.
 

vshortt

Senior Member
Dippy,

you can disregard the "dots" - this was screenshot from a java applet that lets you experiment with circuits. In the applet, the dots move to show you direction of electron flow.

As far as the direction of the PNP transistor, yes, it's drawn correctly in the schematic, but I references th wrong poles in my description. I've fixed that, so take another look.
 

fernando_g

Senior Member
A simple refinement to your circuit.
The resistor at the transistor's base does not have to be that low (100 ohm). The gain of the transistor should allow you for a resistor value of 1k to 4.7k.
You will minimise the IC's drive requirements that way.
 
Top