Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] 24V DC FAN Control with NMOS

Status
Not open for further replies.

ensyksl

Newbie
Joined
Mar 20, 2024
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
32
Hi everyone,
I'm trying to control a 24V DC fan motor using an IRF540N MOSFET and an STM32 microcontroller. I've built a basic circuit, with the STM32 output pin (3.3V) triggering the N-channel MOSFET. However, I'm failed and would appreciate your assistance.
1710941595679.png
 

The circuit will turn the fan on if you apply enough voltage on the gate pin. Note that the IRF540n might need as much as 4V on it's gate before it starts to conduct, you may not have enough from the STM32 for that to happen and even then you will need much more to reach full conduction.

If you are trying to control the fan speed with PWM, this is not the way to do it.

Brian.
 
Vgs(th) = Vt is defined as the threshold of leakage before it becomes a switch.. VGS = VDS, ID = 250μA. ( The Id leakage levels is unique for each FET and depends on OEM test method and RdsOn)

You much choose a FET with Vgs(th) max < 50% of 3.3V aka "logic level" FET.

If you plan to switch off quickly , you need to know the flyback voltage does not exceed the Vds max or add a 100 mA diode to Vdd to clamp it.
if you want to control speed, then you need to add a 50 mV current sense resistor and regulate the current while adding a heat sink equivalent to the fan power rating. Ideally mount the FET or heatsink where the fan air velocity is highest.

This could also be low cost NPN 1.5A 1 Ohm switch

TTC004B

TTA004B,Q


or for a few cents more a 3A 0.4 ohm NPN switch https://www.digikey.ca/en/products/detail/stmicroelectronics/BD241C/2827178

But there are cheaper choices in low Vt Nch FETs .

My Rule of Thumb
- for Vt (aka Vgs(th) )
- Use at least Vgs= 2x Vt max for low threshold types​
- Use at least Vgs = 2.5 x Vt max for standard enhancement mode FETS with Vt = 2 to 4V.​
- Use much more I max than you need otherwise it must have a a good heatsink.

such as ;

RdsOn (Max) @ Id, Vgs = 90mOhm @ 3.6A, 4.5V
Vgs(th) (Max) @ Id = 1V @ 250µA


OPTIONS
If you didn't want to change FET or layout the only solution would be to cut and jumper in a CB switch or CE switch and invert code.

Common Base NPN can raise the voltage (non-inverting) with some method to limit Vgs< 20V ( R divider or zener)

But you are not alone . A high percentage of students forget the threshold effect and the quadratic equation for Vgs-Vt vs Id and that all old FETs were conventional threshold Vt= 2 to 4V. I'll let you find your notes.
 
Last edited:
Thanks for your answers.
  • Actually when I tried this circuit with led (without fan motor) I succeeded. I think due to the low current sink from the nmos collector, the circuit works it.
  • I will add a diode, sure I don't want the EMF voltage to burn out my circuit.
  • Yes, my purpose is speed control with PWM, but I don't need exact speed control. Just enough to change the speed of the fan motor. Isn't the circuit sufficient for that?
 

A LED will show some illumination even at low current, the fan probably needs much more.

I would suggest you replace the IRF540 with an NPN transistor, it needs 0.6 - 0.7V voltage drive instead of the 4V you need to guarantee MOSFET operation. Add a series base resistor to limit the base current and it should work as an on/off switch.

PWM might not work, it depends on the type of fan. If it is purely a DC motor it might work but controlling the speed will be unreliable unless you can add some feedback control system. If the fan has a built-in driver circuit (like PC cooling fans) it will already have some start-up and speed regulation built in to it so pulsing the power with PWM will confuse it.

Brian.
 
If "DC fan motor" is a usual electronically commutated brushless DC type, consider that it may be not suited for direct PWM operation. They usually involve a larger input filter capacitor, you'll need an external filter choke. Better use a fan motor with built-in speed control and separate pwm input that can be driven by logic level. If the motor a simple brushed DC, PWM operation is no problem.
 

If "DC fan motor" is a usual electronically commutated brushless DC type, consider that it may be not suited for direct PWM operation. They usually involve a larger input filter capacitor, you'll need an external filter choke. Better use a fan motor with built-in speed control and separate pwm input that can be driven by logic level. If the motor a simple brushed DC, PWM operation is no problem.
This is the fan motor I bought
1711089728039.png
 

You will not be able to use PWM with a typical BLDC computer muffin fan. That will damage the CAP & FET circuit inside the FAN and make noises.

But can use the IRF540 with a pull up resistor or better use a 10k ohm thermistor, and make it variable temperature controlled if you cool the FET with the FAN and 1W Heatsink.

No need for a CPU control.


1711094401028.png


I changed resistor to represent 0.68W fan and adjusted Pot. If FET gets hot the threshold will reduce and the fan will speed up too. but now it is a much smaller fan and only 0.68W and the FET will not get hot but will be more stable if kept at room temp.

1711094789169.png

Adjust sliders to see how power is controlled .

Very little Pot current so it can be just a thin film 100 Ohm only trimmer.


Thermistor may be epoxied to your hottest part or other suitable fastener.

--- Updated ---

also no diode needed now.
 
Last edited:
Hi,

such electronic devices come with a datasheet.
Reading helps!
It says:

7. DO NOT use power or ground PWM to control the fan speed.

It maybe takes less than 10 seconds to do an internet search for "mf40202v2 PDF" ... and then do a PDF_search for "PWM".

Klaus
 
But when you can’t find a fan speed control design IC and you want to just invent one like this, just do thought experiments or smoke tests in the lab to test thermal resistant vs air surface velocity. You’ll never forget the results.

What would happen if you used an NPN common base switch as a thermal sensor with Vb using a room temp diode… knowing Ic is temp. controlled by Vbe?
 
Last edited:
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top