probably a stupid issue about MCU mosfet driving - Page 1
Forum section: electronics / beginners

author: mcinque
author_rank: Unknown
timestamp: February 13, 2014, 04:18:13 pm
content: Hi all,I'm attempting to drive two mosfets with an atmega328p and this normally wouldn't be an issue: just take the two n channel mosfets, connect them with the "idiot-proof" pull down resistor between the gate and the ground, connect the source, connect the drain and drive the gate with a 5V digitalwrite from the MCU: all should work fine(I think: if I fail this, I should change my hobby).The matter is that:1st mosfetby driving the gate with 5V digitalwrite, I can sink only 900mA of current (then the voltage drops near zero) from DRAIN pin, while the datasheet of the mosfet I'm using specifies a lot more.driving the gate manually with 12V provides me all the DRAIN current reported on the datasheet (this is ridiculous: following this logic I could light a 220V bulb only providing 220V on the gate)2nd mosfetwhen the MCU sends the digitalwrite to the mosfet, the mcu crash (I can see some strange characters appear on the LCD connected to the mcu)Do you have any explaination about this 2 issues?

author: Simon
author_rank: Unknown
timestamp: February 13, 2014, 05:10:51 pm
content: a mystery, are you sure your Vgs is low enough ?

author: deephaven
author_rank: Frequent Contributor
timestamp: February 13, 2014, 05:31:30 pm
content: Look at the graph on the data sheet on the IRF520 for transfer characteristic. It is behaving exactly as expected. You need an FET with a lower VGS requirement.As to the other problem, more difficult. Check the power supply isn't sagging and that you have enough decoupling.

author: madworm
author_rank: Frequent Contributor
timestamp: February 13, 2014, 05:46:47 pm
content: You need a gate-resistor.Connecting the MCU pin directly to the gate and turning it on leads to a very high peak current, which is likely to damage or at least upset the chip. The maximum current for a GPIO pin will most likely be exceeded many times.

author: Simon
author_rank: Unknown
timestamp: February 13, 2014, 06:07:27 pm
content: Use an IRL540N, you can put a resistor in series with the gate to help control the current if your just doing slow slitching

author: mcinque
author_rank: Unknown
timestamp: February 13, 2014, 06:09:43 pm
content: Quote from: deephaven on February 13, 2014, 05:31:30 pmQuote from: Simon [quote author=Simon on February 13, 2014, 05:10:51 pmDamn, both you are right.Thank youfor waking me from the sleep!Quote from: madworm on February 13, 2014, 05:46:47 pmQuote from: Simon on February 13, 2014, 06:07:27 pmThank you both!I will try it asap, I think 1K for the gate and about 33K for the pull down should do the trick, don't you?

author: mcinque
author_rank: Unknown
timestamp: February 13, 2014, 11:03:24 pm
content: For the VGS issue, I will get a bunch of ILR540N and I'm pretty confident that the issue will be solved.For the buzzer driving, I've discovered that that damn KINGSTATE KPEG276A is HIGLY CAPACITIVE and is not a self drived buzzer, but is a massive PIEZO driverDue to its capacity I've read 120Vpp with DSO at every sound of that damn thing connected! Using a REAL self drived buzzer solved all: no need for the gate resistor.Lesson learned both for VGS and buzzer:I should read better the datasheets.