EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: mcinque on February 13, 2014, 04:18:13 pm
-
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 mosfet
by 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 :-DD)
2nd mosfet
when 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?
-
a mystery, are you sure your Vgs is low enough ?
-
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.
-
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.
-
Use an IRL540N, you can put a resistor in series with the gate to help control the current if your just doing slow slitching
-
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.
a mystery, are you sure your Vgs is low enough ?
Damn, both you are right. |O Thank you for waking me from the sleep!
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.
Use an IRL540N, you can put a resistor in series with the gate to help control the current if your just doing slow slitching
Thank 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?
-
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 driver |O :wtf: :rant:
Due 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. :palm: