Mosfet Switching Problem

Thread Starter

LLofYorkshire

Joined Jan 15, 2020
21
Hi,

1st post on the forum and very new to power electronics design, and to electronics in general. I designed the attached circuit to attempt to power on and off a solenoid coil. I have no prior experience of using mosfets, other than using off the shelf H-Bridge modules such as the IBT-2 and IBT-4. In this application I don't need to switch direction of current flow, so opted for a single low-side mosfet per coil instead of H bridge.

The problem is that when I supply the gate of the mosfet with what should be zero volts, zero duty from the MCU (pin21) then it is switching on. If I leave it open circuit then it is off.

High voltage/current supply is 12V (limited to 2A by PSU), MCU is 3V3.

I've checked the code by using an off the shelf h-bridge (IBT-2). I don't have a scope unfortunately, but I've measured the voltage at pin21 to be 90mV max, and on the Hz/Duty setting it's reading 0Hz and 0% duty. As you can see from the picture, I've only populated 1 channel for debugging, and bypassed the current sense part.

I'd be grateful if somebody could take a look at the Schematic and let me know what stupid thing(s) I've done please with the design.
 

Attachments

pmd34

Joined Feb 22, 2014
527
Hi LL.. everything looks and sounds ok, just that perhaps your low level output of the microcontroller is too close to switching on your MOSFET (which one are you using?), you could look for some with a higher threshold gate voltage, or specifically logic level switching, you could probably solve it by putting in a pull down resistor on the gate, but you could also look at your Controller Data sheet, there might be some options to change how the outputs behave, ideally you want the output to be actively pulled low.
 

Thread Starter

LLofYorkshire

Joined Jan 15, 2020
21
Hi pmd34

The mosfet is IPD040N03L, which is advertised as logic level, and does seem from the graphs to be ok.
The MCU is an Espressif ESP32. it's on the sparkfun Thing breakout board.
 

pmd34

Joined Feb 22, 2014
527
Hi LL.. I see the mosfet you use does have a low threshold voltage, or 1V min so at the 0.9V you measure it is indeed likely to be partially switched on. The ESP32 data sheet lists that the output low voltage level should be max. 0.1x supply voltage so the 0.9V is a little high. Is the port configured properly as an output?
 

BobTPH

Joined Jun 5, 2013
8,813
90mV is 0.09V, not 0.9 V.

If you measure 0.09V from source to gate, and the MOSFET is on, it is defective.

Are you sure the source and drain are not reversed?

Bob
 

Thread Starter

LLofYorkshire

Joined Jan 15, 2020
21
The Mosfet was blown. Failed closed.
Checked the datasheet to make sure I got the pinout right.
I put a new one on, and instead of using the PWM output from the MCU I just used a 3V3 directly as input to the resistor on the gate.... That caused it to blow immediately..... going to get a bit of Perf board out and mock up on there. Strange
 

Thread Starter

LLofYorkshire

Joined Jan 15, 2020
21
What is connected to P13?
Check the resistance between the terminals of P13.
It's a coil. copper wire around a steel shaft. Resistance is 1.6ohm. The circuit is to control the current through there. At the moment for testing I'm using a current limited PSU (limited to 1A at the moment)
 

AlbertHall

Joined Jun 4, 2014
12,345
If the MOSFET switches on at all it will try to draw far more current than the PSU can supply and it will hit the current limit. Disconnect the the coil of wire from P13 and see whether the LED responds as you would expect.
 

Thread Starter

LLofYorkshire

Joined Jan 15, 2020
21
Well..... after removing anything from P13 and re-testing it started off behaving as I would expect- sort of, at first:
When testing using just a 3V3 (logic high) on the gate the mosfet would switch on (LED on full brightness), but it latched on. Expected behavior I suppose possibly since I was leaving the pin floating after removing the 3V3 on the gate to activate it, and then rounding it would switch back off.

Next I attached the MCU with a fade cycle on the PWM output, and the mosfet did what I expected. Faded on and off.

Then I disconnected the PWM signal and powered back on the circuit (12V), without anything connected and the LED was permanently on. Grounding the pin doesn't switch it off now. Will remove and test to check if it's blown or something else going on in the circuit. can't have been more than 0.02A current draw
 

AlbertHall

Joined Jun 4, 2014
12,345
You should not leave the MOSFET gate floating. The gate is very high impedance and can pick up interference or static voltages so operation is undefined and potentially damaging for the gate insulation.
 

Thread Starter

LLofYorkshire

Joined Jan 15, 2020
21
Thanks Albert.
Ok. after making a rod for my own back by the sounds of it there... I think I had a combination of problems. Mostly caused by me leaving the gate floating it seems.
It looks like the PWM output on the MCU was not working - stuck high, maybe because of a damaged mosfet, which I didn't realise and was confusing me also. When I reprogrammed the MCU it worked fine again. Now I make sure to connet and power the MU and have the PWM running before I power up the 12V supply. Seems ok so far.
Just LED config: Works fine
With coil also config: Works fine
I had the Schottky diode removed for these tests so will add that back in now to check that ok too. Indecently I don't know if I need that as the MOSFET has a flyback diode in the package. bit of an aside I know but be great to get your view on that also please.
 

AlbertHall

Joined Jun 4, 2014
12,345
You certainly do need the diode. The coil back-emf will drive the drain of the MOSFET positive and the diode in the MOSFET will be reverse biased and so offer no protection at all.
 

Thread Starter

LLofYorkshire

Joined Jan 15, 2020
21
Thanks for all the help guys. Got a couple of channels working properly now and will hopefully get the rest up and running over next couple of days when more bits arrive.
 
Top