Slow MOSFET turn off - Page 1
Forum section: electronics / projects

author: Oaklander
author_rank: Regular Contributor
timestamp: August 12, 2018, 05:20:20 pm
content: I have MOSFETs as switches. The circuit is shown in the attached picture. The input to the gate is coming from GPIO pin of AVR microcontroller and the source is connected to a LED-light module.My device has 16 identical copies of the circuit. Most of them turn the LED off instantly but some are slow. The slowest one stays on for four seconds after the GPIO is set LOW.I only have one prototype of the device so I can't compare different units. I wonder if this could be caused by bad solder joint or something.

author: Muxr
author_rank: Super Contributor
timestamp: August 12, 2018, 05:27:44 pm
content: 1M pulldown is pretty weak. You can try 10K or 4.7K instead.

author: Neukyhm
author_rank: Contributor
timestamp: August 12, 2018, 05:38:41 pm
content: Quote from: Muxr on August 12, 2018, 05:27:44 pmAgree. Try using a lower value resistor. I usually put 1K to my IRFP250 mosfets.

author: bingo600
author_rank: Super Contributor
timestamp: August 12, 2018, 05:58:07 pm
content: But he mentions setting the gpio pin low.Shouldn't that pull down the gate through 100ohm , faster than 4s ?Or does the 1M prevent current to flow to gnd, when discharging/Bingo

author: Oaklander
author_rank: Regular Contributor
timestamp: August 12, 2018, 06:00:13 pm
content: But the problem is only with three of the MOSFETs. All the others switch off instantly.

author: wraper
author_rank: Unknown
timestamp: August 12, 2018, 06:02:43 pm
content: Quote from: bingo600 on August 12, 2018, 05:58:07 pmLOL what?Is MCU output really set low or just high impedance? What if you don't use mcu but manually switch R37 between +5V / GND?

author: Benta
author_rank: Super Contributor
timestamp: August 12, 2018, 06:19:22 pm
content: What's the 1 M (or whatever value) even doing there? Seems useless to me.

author: mzzj
author_rank: Super Contributor
timestamp: August 12, 2018, 06:33:25 pm
content: Stinks like MCU output setting registers..

author: ogden
author_rank: Super Contributor
timestamp: August 12, 2018, 07:25:40 pm
content: Quote from: Benta on August 12, 2018, 06:19:22 pmIt's not. Most I/O pins of firmware-less MCU are floating inputs. If you screw-up your firmware or GPIO initialization, such (preferably 10..50k) pull-down resistor can save your circuit, especially in BDLC motor control application.

author: Benta
author_rank: Super Contributor
timestamp: August 12, 2018, 10:02:49 pm
content: ogden, you're right. It came to me as well after posting. Uninitialized I/Os are a problem. But 1 M? No way.

author: bson
author_rank: Unknown
timestamp: August 12, 2018, 10:20:22 pm
content: 4s sounds like the leakage through the 1M resistor when the GPIO pin is set to input or some other high-impedance function. Smells like a pin configuration firmware bug.

author: bson
author_rank: Unknown
timestamp: August 12, 2018, 10:24:07 pm
content: Reduce the 1M slightly, to say 47k to make it a weak pulldown. This keeps the gate from drifting and makes the FET shut off in case of - ahem - firmware bugs that accidentally misconfigure it. It will also keep it low during power-on reset until the pin is - ahem - correctly configured. And, finally, on power-off as rails ramp down and the µC is suspended by the brownout detection circuitry, it shuts off the FET should the firmware - ahem - "forget to".

author: David Hess
author_rank: Super Contributor
timestamp: August 13, 2018, 01:15:31 am
content: Some microcontroller input and tri-state output pins have 100 kilohm pullups or similar which may or may not be selectable to prevent ambiguous logic states. This may be part of a "bus hold" function. Combined with the 1 megohm pull-down this may be causing a problem.

author: Oaklander
author_rank: Regular Contributor
timestamp: August 13, 2018, 03:04:57 am
content: The other two slow MOSFETs take about half a second and a second to turn off. Can the firmware bug explain that?

author: Oaklander
author_rank: Regular Contributor
timestamp: August 13, 2018, 05:45:22 am
content: I now checked the software and there is no difference in the configuration of the pins. I also checked the datasheet for alternate pin functions but they are all disabled and should not interfere.

author: poorchava
author_rank: Super Contributor
timestamp: August 13, 2018, 07:57:16 am
content: Maybe some of the GPIO have their low side drivers damaged?

author: gasmeter
author_rank: Contributor
timestamp: August 13, 2018, 08:30:44 am
content: HiA few things with Fets I have learnt over the years.1/ Never underestimate the gate capacitance, especially if your switching any current .(I have seen power fets blow up just because they are driven by an IO pin from a micro and not a proper drive circuit).A slow moving Gate makes the Fet operate in its linear region for a time which causes it to heat up and can cause thermal run away.2/ If switching use a gate drive IC they can sink/source massive current to discharge that capacitance, you will be amazed how much current it takes.3/ Make sure the supply driving the gate is very well decoupled.If you are dumping current into a gate, it has to come from somewhere local.4/ If possible turn the FET on Hard.For your application I assume you have a scope ?Simply look at the gate waveform and if your not sure post here.I come across a lot of circuits where the FET gets very hot just because its not being turned on/off fast enough.Then I don't know what load you are switching but look at the drain.I hope that helps.Peter

author: Oaklander
author_rank: Regular Contributor
timestamp: August 13, 2018, 01:06:47 pm
content: I have now made the measurements with the scope.The voltage on the gate of the MOSFET instantly drops to ground level. The voltage on the drain fades just like the light intensity of the LED.That's what happens when I measure them separately. But if they are both measured at the same time there is no delay. Then the slow LEDs turn off just as fast as the others.To me it seems like a hardware problem. Somehow some of the gates of the MOSFETs are slow to discharge, but the presence of the oscilloscope probe makes them discharge faster.

author: senso
author_rank: Frequent Contributor
timestamp: August 13, 2018, 02:02:51 pm
content: Bad ground somewhere.

author: sanman
author_rank: Contributor
timestamp: August 13, 2018, 02:42:27 pm
content: Connect the troublesome MOSFET to one of the lines that is working with the other MOSFETS?

author: StillTrying
author_rank: Super Contributor
timestamp: August 14, 2018, 10:15:17 am
content: Quote from: Oaklander on August 13, 2018, 01:06:47 pmActual values forinstantlyandground levelwould help to solve the mystery. If it takes more than about 1 or 2us for the gate to get below 0.2V the GPIO is not driving it low properly.

author: Oaklander
author_rank: Regular Contributor
timestamp: August 14, 2018, 05:45:37 pm
content: It was a bad solder joint.I noticed that the LEDs turn on if I press on the components with my finger. The slow ones illuminated very bright but others very only glowing a little. That made me think that maybe my finger was good enough conductor to turn the FETs on. Then I did the same test with a plastic bag as insulator between my finger and the PCB. Then nothing happened. That made the problem look like problem with pull-down so I checked the soldering of the 1M resistors and it worked. All the LEDs now turn off very quickly.

author: StillTrying
author_rank: Super Contributor
timestamp: August 14, 2018, 09:10:00 pm
content: It seems odd relying on 1M to pull the hexfet gate and GPIO below 1V when the GPIO could just drive it there!

author: JustMeHere
author_rank: Frequent Contributor
timestamp: August 15, 2018, 01:44:07 am
content: Quote from: StillTrying on August 14, 2018, 09:10:00 pmShouldn't you pull the one way or the other so that the FET is in a known state during micro start up and programming?

author: Oaklander
author_rank: Regular Contributor
timestamp: August 15, 2018, 05:30:47 am
content: Quote from: StillTrying on August 14, 2018, 09:10:00 pmYeah. I don't really understand what happened. The GPIO pins are pulled down to ground to turn the FETs off. The 1M resistor should not have any effect on that.