Why the resistor

I came across a IRF520 breakout to power the Noctua 4 pin 12V fans that I'm incorporating into my design. I have a couple questions regarding safe wiring of the component.

  1. Instead of running 12V directly to the fans I would connect to the IRF520 and then out to the fans?
  2. With switching the IRF520 on/off I wouldn't require a PWM pin from the Arduino Due, any digital pin would be fine?
  3. Will not using the PWM signal to the fan damage the fan in any way or shorten it's life span?
  4. should I use a flyback diode between signal and GND?

Spec from ad

Voltage: 3.3V, 5V
Ports: Digital Level
Output load voltage :0-24V
Output load current: <5A (1A above need to add heat sink)
Platform: Arduino, MCU, ARM, raspberry pie
Using original IRF520 Power MOS, you can adjust the output PWM
Arduino drive up to 24V allows the load, such as LED lights, DC motors, miniature pumps, solenoid valves
PWM dimming LED can be used to achieve stepless dimming, variable speed motor

Hi,
I think you are not reading the datasheet correctly.
It is the tacho output that needs the resistor;


You have to go down another page to get to PWM speed control and it says nothing about a pullup resisitor.

Tom... :slight_smile:

Why would you switch a 4-pin fan.
4-pin fans have all the switching electronics inside (2 and 3-pin fans do not).

From the Noctua link: "...most Noctua PWM fans can be operated at below 20% and will stop at 0% duty-cycle..."

IRF520 mosfets shouldn't be used with 5volt logic Arduinos, and certainly not with 3.3volt logic (Due).

4-pin fans that don't turn off with zero PWM should be switched high-side (in the +line).
With a PNP transistor or P-channel fet.
A level converter (second transistor) is then also needed.
See this page, diagram 3 or 4.
Leo..

TomGeorge:
Hi,
I think you are not reading the datasheet correctly.
It is the tacho output that needs the resistor;


You have to go down another page to get to PWM speed control and it says nothing about a pullup resisitor.

Tom... :slight_smile:

My dilemma with the fan is the 5V PWM signal and I thought this MOSFET would accomplish that, I'm not looking for speed control of the fan, just a simple on/off at a certain temp. I'm using a 3.3V Due.

Wawa:
Why would you switch a 4-pin fan.
4-pin fans have all the switching electronics inside (2 and 3-pin fans do not).

From the Noctua link: "...most Noctua PWM fans can be operated at below 20% and will stop at 0% duty-cycle..."

IRF520 mosfets shouldn't be used with 5volt logic Arduinos, and certainly not with 3.3volt logic (Due).

4-pin fans that don't turn off with zero PWM should be switched high-side (in the +line).
With a PNP transistor or P-channel fet.
A level converter (second transistor) is then also needed.
See this page, diagram 3 or 4.
Leo..

I was going to use a transistor to change the Due 3.3V logic signal to get to 5V PWM required by the fan and thought the IR520 would be easier to incorporate into my enclosure, I really only need it to turn the fan on and off without any need for variable speed.

Hi,

My dilemma with the fan is the 5V PWM signal and I thought this MOSFET would accomplish that, I'm not looking for speed control of the fan, just a simple on/off at a certain temp. I'm using a 3.3V Due.

If all you want to do is turn it ON and OFF, no speed control, then just use a HIGH SIDE MOSFET SWITCH, to switch the positive supply, controlled by a digital output of your controller.
NO PWM REQUIRED.

Input the temperature and using an if statement to compare it with your set level, decide if you need to turn the digital output HIGH or LOW.....

I think you will find if you do not provide a PWM to the speed input wire the fan will run at full speed by default.

Have you connected the two power wires of the fan to a power supply and noticed that it spins with no other connections?

Tom.... :slight_smile:

TomGeorge:
Hi,
If all you want to do is turn it ON and OFF, no speed control, then just use a HIGH SIDE MOSFET SWITCH, to switch the positive supply, controlled by a digital output of your controller.
NO PWM REQUIRED.

Input the temperature and using an if statement to compare it with your set level, decide if you need to turn the digital output HIGH or LOW.....

I think you will find if you do not provide a PWM to the speed input wire the fan will run at full speed by default.

Have you connected the two power wires of the fan to a power supply and noticed that it spins with no other connections?

Tom.... :slight_smile:

I have applied 12V and the fans run which is why I got the IRF520 breakout to switch the power on/off, it is a N channel MOSFET that can take a 3.3V or 5V signal to operate it per the ad from Amazon.

I was asking if that would hurt the fan in any way trying to switch it like that and if I need a flyback diode to protect the Due or the IRF520.

I read the advertising. The IRF520 is not a logic level MOSFET regardless of the advertising. Looking at the IRF520 modules like this one I see no way that module will function on 5.0 let alone 3.3 volts. I see the IRF520 and a few resistors and maybe a cap on that board. This is the data sheet for the IRF520 N Channel MOSFET.

If you go with a N Channel MOSFET you would use low side switching.

Since you have a 4 wire fan and just want On/Off control why not just hold the fan PWM In line High or Low with High being full speed and low being Off? As pointed out the IRF520 is a poor choice and your fan should have onboard switching. Reading the IRF520 data sheet and looking at the various modules out there for that MOSFET I don't see it as working with a 5 volt or 3.3 volt gate signal.

Ron

The input may be 'open drain and need the 5V to make sure it goes high when the input is floating. Home Security System using Arduino UNO in Proteus - The Engineering Projects

Ron_Blain:
If you go with a N Channel MOSFET you would use low side switching.

Since you have a 4 wire fan and just want On/Off control why not just hold the fan PWM In line High or Low with High being full speed and low being Off?
Ron

I don't know if the 3.3V signal will function so I will take your word for it.
I would love to just use the PWM signal to make it High or Low but the Due only has 3.3V PWM and the fan needs 5V PWM to operate. I was going to use a transistor to pull the logic to 5V and was looking for a breakout board to do that and came across the IRF520 and it seemed to do just that but I'm wrong now that I run how to wire it through my head with the advice given.

vishkas:
The input may be 'open drain and need the 5V to make sure it goes high when the input is floating.

Inputs are not open drain. Ever. That's not what that means.

Do I need to bust out some Inigo Montoya memes for the people that keep saying this? "Open drain input" literally makes no sense. Outputs are open drain (like the fan's tach output), not inputs.

Jiggy-Ninja:
Inputs are not open drain. Ever. That's not what that means.

Do I need to bust out some Inigo Montoya memes for the people that keep saying this? "Open drain input" literally makes no sense. Outputs are open drain (like the fan's tach output), not inputs.

Inconceivable!

In my efforts to learn about this IRF520 MOSFET I hooked it up to my Due, I connected pin 13 to the signal terminal and Due GND to the GND. I connected a 5V power supply to the to the Vin and GND of the IRF520. I uploaded the blink.ino with a 10 second delay and the IRF520 switched the power on and off at 5V to the V+ and V- of the IRF520. It seems that 3.3V can switch the MOSFET gate to complete the circuit.

What am I missing that this is a bad option for turning the fan on/off?
Does it have to do with 12V GND tying in with 5V GND and the Due GND?

ribbonman:
What am I missing that this is a bad option for turning the fan on/off?

The IRF520 is simply not suitable for 5 V logic control. It will work up to about 500 mA and presumably your fan requires less than that. Ron cited the datasheet.

At 3.3 V, I'll bet it gets warm and the fan does not really run at full speed. :roll_eyes:

Sorry, but if you choose to blindly believe Amazon ads, you may be in for some pain.

Have to chuckle at this line which says it all: :grinning:

Output load current: <5A (1A above need to add heat sink)

ribbonman:
What am I missing that this is a bad option for turning the fan on/off?

That module (an N-channel fet) disconnects fan ground.
That means 12volt could appear on the fan's PWM and tach lines.
Since we don't know what's inside the fan, that could be bad for the fan and/or the Due.

What was wrong with the diagram of post#12, apart from the missing collector resistor to 5volt.
Leo..

This is the Arduino Duemilanove. I suggest you read the data sheets the ATmega168 (datasheet) or ATmega328 (datasheet). I have one sitting here. It's a 5.0 volt chip. How do you come up with 3.3 volts?

https://www.arduino.cc/en/Main/arduinoBoardDuemilanove

Even if that were the case a simple single transistor like a 2N3904 (NPN) could be used to take 3.3 volts to 5.0 volts easily. I suggest you read some data sheets and get a handle on what you have and where you want to go.

Ron

OP talks about a Due in post#5, not a Duemilanove.
A Mega-sized Due has a 3.3volt processor.
Leo..

Wawa:
That module (an N-channel fet) disconnects fan ground.
That means 12volt could appear on the fan's PWM and tach lines.
Since we don't know what's inside the fan, that could be bad for the fan and/or the Due.

What was wrong with the diagram of post#12, apart from the missing collector resistor to 5volt.
Leo..

I was looking for some type of board with a transistor on it to create the diagram in post #12 that I could easily mount to my Din rail and this popped up so I thought it would work. I was concerned about the mixing of all the different voltages but thought a flyback diode would take care of the 12V coming back to the Due but didn't think about it running back to the PWM or tach lines. I was thinking if the fan turns on/off with just the 12V and doesn't use the PWM or tach then I wouldn't have to worry about them.
I wasn't thinking about how much amperage the fans would be drawing since they are pretty small and I had a 12V 5A power supply but with the MOSFET possibly overheating that is also a flaw in my learning curve.

Paul__B:
The IRF520 is simply not suitable for 5 V logic control. It will work up to about 500 mA and presumably your fan requires less than that. Ron cited the datasheet.

At 3.3 V, I'll bet it gets warm and the fan does not really run at full speed. :roll_eyes:

Sorry, but if you choose to blindly believe Amazon ads, you may be in for some pain.

Have to chuckle at this line which says it all: :grinning:

More like ignorance is bliss than blindly following. :slight_smile:

Ron_Blain:
This is the Arduino Duemilanove. I suggest you read the data sheets the ATmega168 (datasheet) or ATmega328 (datasheet). I have one sitting here. It's a 5.0 volt chip. How do you come up with 3.3 volts?

https://www.arduino.cc/en/Main/arduinoBoardDuemilanove

Even if that were the case a simple single transistor like a 2N3904 (NPN) could be used to take 3.3 volts to 5.0 volts easily. I suggest you read some data sheets and get a handle on what you have and where you want to go.

Ron

We wouldn't be having this discussion if I had 5V PWM, life would be so much simpler but it just seems I can't do simple.

Thanks Leo and got it. So 3.3 volts. What's the fan current? You can get 3.3 to 5.0 or 12.0 or greater using a transistor driver. Use an NPN like the 2N3904 or 2N2222 and write your code accordingly. That or just cascade a few transistors so you don't need to flip the polarity in your code. Either way this seems to be more complicated than need be.

My bad on the Due. :frowning:

Ron