Electronic – arduino – DC fan control using an arduino UNO and a N channel MOSFET

arduinomosfet

I am trying to produce a variable speed fan control using an arduino UNO. I tried something using a BJT which didn't work and so it was suggested that I use a MOSFET instead. I am just looking for some feedback about something I have designed before I go and prototype something that is useless or breaks delicate hardware.

Here is the schematic that I have drawn:

Basically the PWM value is set serially via the serial monitor varying the pulse width sent to the gate of the MOSFET and hence the amount of time per wavelength that the DC fan is switched on.

Basically the PWM value is set serially via the serial monitor varying the pulse width sent to the gate of the MOSFET and hence the amount of time per wavelength that the DC fan is switched on.

I got the idea from this guy here https://www.youtube.com/watch?v=Pw1kSS_FIKk who did the same thing except with the fan powered by a 12 V battery. The battery seemed like it would provide more than enough current but would I be able to get maximum RPM with just the 12 Volt power supply being fed into the arduino?

My fan is rated at 130 mA but I know that the arduino only gives 40mA at best. Does anyone have anything to suggest?


This is what I mean enter image description here
Ignore the math below because I am pretty sure its wrong. After revising this component I understand it will have a variable current flowing from the drain to source depending on its operating point (determined by the gate to source voltage and the 12v power supply).

With that said the overall output current due to Vgs will be reduced due to the resistance of the DC fan am I right? What would you suggest I do to find the drain current when the FET is switched on?

Best Answer

Using a MOSFET is not a bad way to switch loads. You will need a few resistors though; see this post for some good examples of MOSFET switch circuits.

Your Arduino can give ~40mA max on an output pin. A MOSFET should draw next to nothing into its gate (in fact, many times it is assumed to be zero). Consider where current for the fan is being drawn from - when the MOSFET switches on, current flows from your 12V supply (Vin is connected to the barrel jack, so the current output of this pin is determined by whatever supply is plugged into the barrel jack) through the fan to ground. The 12V is also connected to a 5V regulator on the Arduino, so it essentially has its own supply fed by Vin. You just have to ensure that when your fan switches on, it doesn't draw so much power from the supply that the Arduino resets.