Having issues driving high-side MOSFET

Hey guys,

I have this circuit that I've used many times in the past, and I know it works:

In the past it was used to detect the 5V line in a USB interface, if VBUS was ON, it would turn on the MOSFET and hence, turn on the 5V power rail. I am now trying to drive the same line from an Arduino Leonardo, so I attached it to D4, however, whenever I turn ON D4, the whole board, including my arduino goes into a RESET loop.

If I however, disconnect D4 from D301, and simply attach it to the 5V (non switched) power rail, it turns ON the MOSFET just fine, like it does on plenty of my other boards.

I've tried with 2 different Leonardos, and a home-brew Arduino I use for prototyping and they all have the same behavior.

Any ideas?

I assume that the Arduino and your MOSFET circuit have a common GND

UKHeliBob:
I assume that the Arduino and your MOSFET circuit have a common GND

Yes, they both share the same ground.

D301 serves no purpose but otherwise looks ok.

If I however, disconnect D4 from D301, and simply attach it to the 5V (non switched) power rail, it turns ON the MOSFET just fine

Who's power rail? Your circuit or the Arduino?

Sounds like a ground loop somewhere within the supplies and since we can only see an isolated piece of the circuit, a guess is the best you're going to get.

WattsThat:
D301 serves no purpose but otherwise looks ok.

Who's power rail? Your circuit or the Arduino?

Sounds like a ground loop somewhere within the supplies and since we can only see an isolated piece of the circuit, a guess is the best you're going to get.

The board's main power is coming from a 12V external power supply. I am using a buck converter to get 5V to power the rest of the devices:

I use the 5V to power the built in AVR in the board, which is based off of the Leonardo board:

So, if I connect the 5V to the base of the BJT the circuit works normally, everything powers on, and all the devices on the board work flawlessly, including the controller.

If I however, try and control that MOSFET with either the controller on board, or an external Leonardo (I connected the Leonardo to the 5V rail, and connected both board's grounds together) they both exhibit the same symptom, the controller ends up in a reboot loop. I notice tho, that both appear to go into programming mode? I can see the LED on D13 pulsing, like when I'm programming the Arduino.

Edit:

This is the section of the layout that has the MOSFET

If you pull the mosfet out of the circuit, does having D4 high still reset the controller?

Then, with the mosfet still out, does shorting 5V to 5V_SW cause a reset?

One of those two should put you on the path to finding the trouble source.

PS: still not seeing what 5V_SW controls, don’t see it on the prints anywhere.

Thanks for the advice. I tried it.

I can turn on/off the BJT without any issues, and after removing the MOSFET I can "short" the 5V and the 5V_SW line without causing a reboot.

So separately both circuits work, but together something is not working and I can't figure out what it is.

Check your footprint for Q302. It looks like you have the emitter and base pin swapped.

I do. I had to mount the BJT upside down. (oooooops).

Hi,
Did that fix the problem?
Tom.. :slight_smile:

TomGeorge:
Hi,
Did that fix the problem?
Tom.. :slight_smile:

No, it didn't. I knew about the wrong print from the first board bring-up. The board didn't work at all with the BJTs mounted like that. There are more of these BJTs that have the footprint wrong, but once I mount them upside down the board turned out, but that's when I noticed this other issue.

My guess is that you need more decoupling at the fet- try increasing C301 or adding capacitors in parallel with it, 10uF or maybe even 100uF
This is assuming you don't have any bad parts and they are connected correctly
You might also be having an oscillation- try adding a small resistor (100 ohms or so) in series with the fet gate and or a small cap from the gate to ground (0.001uF perhaps) or even just touch the fet leads with your fingers and see if the problem stops
Mark

What is connected to 5V_SW? What load are you driving here?

Hi,
Have you got a DMM to do some voltage trouble shooting?

Thanks. Tom… :slight_smile: