Go Down

### Topic: Why the resistor (Read 735 times)previous topic - next topic

#### ribbonman

#15
##### Mar 14, 2021, 05:04 am
Just to add one more detail. The tach out is normally two pulses per revolution. So if you use the tach out you may want to be sure of the number of pulses out per revolution.

Ron
It is 2 pulse per rev. I don't really need the tach, I think just turning it either on or off is all I will need.
PWM speed control is on the blue wire.
If you're going to use a transistor to convert 3.3volt PWM to 5volt PWM, then you need of course a pull up resistor between the collector and a 5volt supply (from the Due).
Pull up resistor can be any reasonable value that the transistor can switch (nothing to do with the fan).
Anything between 220 ohm and 1k could work.

Tach output is on the green wire. That's an open collector output inside the fan.
Software pull up on the pin should be enough. Or 1-10k if you want to be difficult and use external pull up.
Leo..
Is there a better way than using a transistor?
So the schematic should look like this.
[/url]][url=https://ibb.co/f1jXWHs][img][/url]

#### Wawa

#16
##### Mar 14, 2021, 05:35 am
It is 2 pulse per rev. I don't really need the tach, I think just turning it either on or off is all I will need.Is there a better way than using a transistor?

So the schematic should look like this.
Schematic looks ok, except for the missing (2.2k - 10k) base current limiting resistor, which you have drawn before.

If you only need on/off, then (~25kHz) PWM is not needed, but you might still need the transistor to convert from 3.3volt to 5volt logic (the blue wire). You could try if the fan still spins at full speed with 3.3volt logic.
If you would use a 5volt processor, then a common digital pin directly connected to the blue wire would be enough.
5volt = ON, 0volt = off (or low speed, depending on the fan).

* Tach can of course also be used to see if the fan is still spinning.

* ~25kHz PWM is an Intel specification for 4-pin CPU fans.
High, so you don't hear the PWM signal inside the fan.
Leo..

#### ribbonman

#17
##### Mar 14, 2021, 05:55 am
Schematic looks ok, except for the missing (2.2k - 10k) base current limiting resistor, which you have drawn before.

If you only need on/off, then (~25kHz) PWM is not needed, but you might still need the transistor to convert from 3.3volt to 5volt logic (the blue wire). You could try if the fan still spins at full speed with 3.3volt logic.
If you would use a 5volt processor, then a common digital pin directly connected to the blue wire would be enough.
5volt = ON, 0volt = off (or low speed, depending on the fan).

* Tach can of course also be used to see if the fan is still spinning.

* ~25kHz PWM is an Intel specification for 4-pin CPU fans.
High, so you don't hear the PWM signal inside the fan.
Leo..
Thanks Leo,
I will give it a try with the 3.3V and see how fast it turns.
I left out the 2.2K - 10K resistor because tach output is open collector and the software pullup on the Due would be sufficient, I can add it back in.

#### Wawa

#18
##### Mar 14, 2021, 06:25 amLast Edit: Mar 14, 2021, 06:27 am by Wawa
Thanks Leo,
I left out the 2.2K - 10K resistor because tach output is open collector and the software pullup on the Due would be sufficient, I can add it back in.
?

I mentioned the resistor in the base line of the transistor (for the fan PWM).
No resistor there could fry the Due pin, because the base-emitter junction of a transistor is like a diode to ground.
Leo..

#### ribbonman

#19
##### Mar 14, 2021, 05:44 pm
?

I mentioned the resistor in the base line of the transistor (for the fan PWM).
No resistor there could fry the Due pin, because the base-emitter junction of a transistor is like a diode to ground.
Leo..
Sorry, should have looked at the old schematic before answering. I will update my schematic.

#### ribbonman

#20
##### Apr 08, 2021, 02:56 am
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

#### TomGeorge

#21
##### Apr 08, 2021, 04:54 amLast Edit: Apr 08, 2021, 04:56 am by 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...
Everything runs on smoke, let the smoke out, it stops running....

#### Wawa

#22
##### Apr 08, 2021, 05:08 amLast Edit: Apr 08, 2021, 05:13 am by 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..

#### ribbonman

#23
##### Apr 08, 2021, 05:18 pm
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...
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.
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.

#### TomGeorge

#24
##### Apr 08, 2021, 05:23 pmLast Edit: Apr 08, 2021, 05:27 pm by TomGeorge
Hi,

Quote
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....
Everything runs on smoke, let the smoke out, it stops running....

#### ribbonman

#25
##### Apr 08, 2021, 05:48 pm
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....
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.

#### Ron_Blain

#26
##### Apr 08, 2021, 06:56 pm
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

#### vishkas

#27
##### Apr 08, 2021, 08:04 pm
The input may be 'open drain and need the 5V to make sure it goes high when the input is floating.

#### ribbonman

#28
##### Apr 08, 2021, 08:05 pm
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.

#### Jiggy-Ninja

#29
##### Apr 08, 2021, 08:11 pm
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.

Go Up