Fan Control Circuit

[schematics]

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.

Perfboard
[perfboard photograph]

Some details:

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:

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.


home
Copyright © Walter C. Pelissero, all rights reserved
Last modified: Thu Jun 14 13:03:46 CEST 2012