«

»

Jul 29 2012

AVR microcontroller based PWM fan controllers

So this is a bit of a continuation on my 555 timer based PWM controllers, but now using microcontrollers and MOSFETs instead of 555 ICs and transistors. I made 2 versions, one with switches for speeding up and down and the other with a potentiometer like the previous controllers. I used ATtiny25 controllers running at 31.25KHz (8MHz internal RC / 256 prescaler) with a 3.3V supply, the MOSFETs I used are STP36NF06L with 0.045Rds and 2.5Vgs max, perfect for 3.3V, the MOSFETs only generate ~180mW of heat at 2A ((0.045Rds * (2A * 2)) = 0.18W) so no heatsink needed, you can barely feel them getting warm.

In the schematics change R1 from 100R to 150R if you use a 5V supply to keep the current under 40mA (remember, MOSFET gates need to be charged and discharged and doing this without a resistor is going to send large currents though the uC), the zener diodes D1 and D2 are for ESD protection and need to be rated somewhere between a few volts above the uC supply voltage and below the max gate voltage for the MOSFET, usually 20V, I used 12V zeners, they can be removed if you think you don’t need them, some MOSFETs have them built in. D2 is not actually needed even if you do want ESD protection since we aren’t using any negative voltages at the MOSFET gate.
The STP36NF06L MOSFETs can easily switch ~8A as they are in the circuits, but some heatsinking will be needed and a 5V supply is recommended, wiring up 2 MOSFETs in parallel will reduce total heat generated (make sure they’re both on the same heatsink), but don’t forget appropriate gate resistors like a 56R which then splits to two 150R which go to the gates, max gate current will then be ~39mA. The potentiometer can be almost any value, but too high will cause the microcontroller ADC to return incorrect readings and too low will cause excessive current drain, I used 22K since it was on special offer for £0.17 instead of £0.43, but anywhere between 4.7K and 22K will be fine.

Downloads

LATEST
Download
fanController_20120803.zip (179.94 kB)
Source code, EAGLE schematic and board layout files
Downloaded 317 times
MD5: A862B6D96A8FCF6A0CE9C9DF90B749EB

OLD
Download
fanController_20120802.zip (179.69 kB)
Source code, EAGLE schematic and board layout files
Downloaded 89 times
MD5: 680379F31E75CB81A86E62E2B5727786

OLD
Download
fanController_20120729.zip (179.02 kB)
Source code, EAGLE schematic and board layout files
Downloaded 76 times
MD5: C0BDAD5FBF993473E65380AFB7F87193

4 comments

Skip to comment form

  1. Sparky3489

    Invalid data in file fanController_analogue.sch!
    Invalid data in file fanController_analogue.brd!

    Invalid data in file fanController_digital.sch!
    Invalid data in file fanController_digital.brd!

    I’m running Eagle Version 5.4.0 for Windows Professional Edition

    Any ideas why the files seem to be corrupt?

    1. Zak Kemble

      Hey, the board and schematic were made in 6.2.0 Light Edition, 6 and newer save files in a different way which earlier versions don’t support.

  2. serjio

    Could you please be more specific, what’s the rated voltage/current of the fans, and what’s the supply voltage of the device?

    1. Zak Kemble

      Its designed for PC fans which are normally 12V, the current will depend on the fan, normal PC fans usually take less than 0.5A, but I was using a server fan taking up to 3A. The MOSFET should be able to switch 8A before it gets too hot without a heatsink. The minimum voltage for the controller part is 3.5V since it goes to a 3.3V LDO regulator.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>