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
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..
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..
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..
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...
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..
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.
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....
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
The input may be 'open drain and need the 5V to make sure it goes high when the input is floating.