Controlling two 12V fans is what this little project is about.
An ATtiny45 monitors an NTC and starts a fan once a certain temperature is reached. PWM varies the fan speed according to the temperature. When the top speed is reached, a second fan is started and its speed is changed according to the temperature, just like the first.
There are two potentiometers, one to set the minimum temperature threshold for the first fan, the other one to set the temperature range. That is, how much hotter than the threshold temperature it must get, before both fans are run at top speed. In other words, the fan1 is started at the temperature set by pot1 and fan2 is started at pot1+pot2.
Some details:
SWAP_FANS
that you can define
to zero.
CMA_WINDOW
) .
It is possible to use the circuit with just one fan, but if you don't intend to ever use the second header, you may want to get rid of one MOSFET (and related components), and you'll get a more compact board.
At the beginning of the source file there are some constants you may want to fiddle with. Especially:
FAN[12]_MIN_DC
, the minimum duty cycle, which is
different for every fan
SPINUP
, the larger the fan, the longer the
spin-up phase required
MIN_TEMP
, that depends on the use you'll make
of this device
As you may have guessed from the picture above, my prototype employs a 7805 voltage regulator in TO-220 packaging, which is oversized for the job, and two MOSFETs that could easily drive industrial motors. Those were the parts I had at hand. You are free to use more reasonably sized components and waste less room on your board.
The
source code
is on GitHub. You'll also need
avr-gcc,
avrdude
and, of course, an ISP programmer. If C programming is not your cup
of tea, you may try to upload a
pre-compiled image I had laying around.
Just make upload
and good luck.