Re: Q. Making a FAN controller
I'm glad you picked up on the ability to monitor multiple fans. My original code sample had names like TicksSinceEvalRpm_0 and parameterized subroutines for each attribute, such as GetFanValue_Register(iFanIndex), but I thought it was too complicated for a quick post. Get one fan working and then move to N fans.
As for the fans, I'm not sure what you mean by the yellow wire. For the big four-pin molex connectors that goto hard drives and such, the blacks are ground, the red is +5v, and the yellow is +12V. No PWM is present from the PSU. For a fan connected to the motherboard, the typical 3-wire connection has power, ground and tach sensor. The power may be pulsed, and the tachometer signal may only be valid when power is on. This complicates your design, of course. Alternatively, you can use an LC (inductor plus capacitor) filter on the square wave output of you PWM controlled power to change it to flat DC current. Then, the tachometer value would be valid as long as the voltage is enough to power the fan (5-7V usually?). Or, you could only watch RPM while the power is on (with a brief delay after powerup to let the fan innards settle down).
It gets complicated when doing PWM. I think this is why some fans have four-pin connections, to allow the fan innards to stay continuously "on" while the motor is pulsed. This way, the tach sensor is always valid.
|