Just ensure you use a blocking diode.
I have a pair of those back to back pushing waste warm air through 50 foot of 6' pipe to prevent the water pipes that also run inside the 6" pipe from freezing.
Very good for long term use too as this pair has been running for over a year.
it might be ok, but it might cause an audible whine in the fan. The 25KHz figure is chosen because it is too high pitched to hear.
The fan may not start at a low duty cycle. For example it might not start at a duty cycle below 25%. But once it has started, it may be possible to reduce the duty cycle down to 10% and the fan will still run.
You should put a 10K pull-down on pin 9. This will prevent the mosfet from partly switching on while the Arduino is booting.
If you want to use the tach output of a 3-pin fan, then you must control/PWM high-side.
Third diagram on this page.
Commercial 3-pin PC fan controllers use AFAIK a frequency below our hearing range (30Hz).
It would ofcourse be a lot easier to just use a 4-pin fan (and ~25kHz PWM).
Leo..
it might be ok, but it might cause an audible whine in the fan. The 25KHz figure is chosen because it is too high pitched to hear.
The fan may not start at a low duty cycle. For example it might not start at a duty cycle below 25%. But once it has started, it may be possible to reduce the duty cycle down to 10% and the fan will still run.
You should put a 10K pull-down on pin 9. This will prevent the mosfet from partly switching on while the Arduino is booting.
thank you very much
1)so again i need to change the PWM frequency of pin 9 in arduino? eg. set it to 20-30kHz?
2)then i can write a code to first start fan at high duty then give the output of PID to fan?
3)1K will remain and a 10K resistor should be used between gain and GND?
The exception being where the same voltage fans are used but they are from different makers and may have differing RPM specs.
That is possibly the only time I would want to change the frequency and then only on maybe one or two outputs to ensure they are a closer match and have a suitable start up frequency that will engage the motor.
As already suggested that once the start up has been achieved it is possible to lower the overall frequency of the PWM and still keep them rotating.
But usually at such low rotations there will be very little airflow so I prefer at that point to either keep them running at the tickover speed as I call it or OFF.
They can still stall out at the lower frequencies which is not particularly good for them.
That's why I "MAP" the PWM too so in essence it gives me a little more range control and I think it saved me from a few extra calculations.
In your case as the fans match you probably need not worry too much about matching motor starts to a frequency or simply use whatever you find kicked them in as a minimum base number.
You could always measure the TACH output before connecting to an Arduino to see if it can produce a useful signal and if so map that to a better output.
BehradInstrument:
but again not max whats the problem?my 840 MOSFET?
Could be, yes. IRF840 is not a "logic-level" MOSFET, and the 5V signal from the Arduino may not be enough to fully switch it on. IRF840 has a "Gate Threshold Voltage" which can be up to 4.0V, so the ~5V signal from the Arduino is only a little higher. Look for a MOSFET that has a logic level gate, for example IRL540. The "L" in the name often tells you it is logic level. The IRL540 has a Gate Threshold Voltage of no more than 2.0V, so the ~5V signal from the Arduino should switch it strongly on.
BehradInstrument:
i used 12k instead of 10k
Fine, the exact value is not very important. Anything from 4K7 to 22K is OK.
PaulRB:
Could be, yes. IRF840 is not a "logic-level" MOSFET, and the 5V signal from the Arduino may not be enough to fully switch it on. Look for a MOSFET that has a logic level gate, for example IRL540. The "L" in the name often tells you it is logic level.
I Found IRLZ44 in our local market
it has V_gs(th): min:2V max=4V
i think it might work
BehradInstrument:
...first the PWM frequency of mega2560 was default but it cause an audible whine in the fan so i set it to 25kHz and now its better but there is a problem even at value of analogwrite(1023) the fan is not working at max speed?
10-bit PWM @25kHz? Don't think a Mega can do that when clocked at 16Mhz.
25000*1024 = ...
"Im working on PID system"
Don't see how you are going to do that with an N-channel fet (see post#7).