Introduction: PWM Fan Controller
You can see the PWM Fan Controller project here.
The heart of the PWM Fan Controller is a PIC 12F675 microcontroller. This microcontroller is reading the analog output of a LM35 temperature sensor using a ADC (analog to digital converter) . The resulting digital value is converted to a temperature and a fan is powered proportionally to how hot the sensor is. The sensor is mounted against the hard drive chassis so it is measuring the actual drive temperature and not just the air temperature inside the housing.
Step 1: PWM Fan Controller - Parts
We have most of the items available in the online store.
* Pre-programmed PWM Fan microcontroller
* 0.1 uF Bypass Capacitor
* Blue LED
* 330 Ohm Resistor
* NPN Transistor
* Perfboard
* LM35 Temperature Sensor
Step 2: PWM Fan Controller - LM35 Sensor Overview
Step 3: PWM Fan Controller - Reading Data With the Microcontroller
The analog input has a range of 0 to 5 volts and the digital resolution is 10 bits. This means that the 0 to 5 volt range will be represented by a number from 0 to 1023 in the microcontroller. If we divide 5 volts by 1024 we get the number of volts per digital increment. In this case it is 0.004883 volts per increment. So if the voltage was 1 volt on the microcontroller pin we would expect to have a reading of around 204 as the digital number (1/0.004883).
To convert the digital value to a degrees Celsius number we need to do a bit of math. If we take the digital result and multiply it by 49 then divide it by 100 we will get a result that is very close to the correct result. The calculation looks a bit weird since we are working with integer math. With integer math the information after the decimal is lost. For example 25/3 would be 8 (not 8.333).
Here is a full example. If we have a temperature of 15 degrees Celsius the voltage out of the LM35 would be around 10mV * 15 = 0.15V we know that each 0.004883 volts is one count for the digital side of the ADC therefore 0.15V / 0.004883 V = 30.73 this would provide a value of simple 30. Finally if we use the formula 30 * 49 / 100 = 14.7 but it would be stored as 14.
13 Comments
3 years ago
Hi,
I live in Brazil. How can I buy some PI12F675 programmed? The links are all broken,
73,
Fernando - Call sign PU2PLL - Brazil
9 years ago on Introduction
is this also possible for a commercial desk fan??? I want to make use of lm35 as temperature sensor to vary the speed of an AC MOTOR...
can you possibly help me?
12 years ago on Introduction
this is great, i do have a hard disk double fan cooler that runs at full speed regardless of the temperature, with your design, it would be controlled according to the temperature..thanks for your contribution..
12 years ago on Introduction
So how do i modify it for 12v usage ?
Reply 12 years ago on Introduction
In this circuit the fan is operating from 12 volts but the controller is running from 5 volts. If you want to operate it from a 12 volt power supply you would need to make the 5 volt supply using some electronics. Do a Google search for 7805 voltage regulator and you will find many examples on how to convert 12 volts DC into a nicely regulated 5 volt DC output.
Reply 12 years ago on Introduction
Oh , the 7805 , okay , i know everything else :)
13 years ago on Introduction
Thanks for explaining so clearly how to assemble this project. ^_^.. Greetings from Chile.
Reply 12 years ago on Introduction
Thanks!
Reply 13 years ago on Introduction
Thanks. :)
12 years ago on Introduction
thanks a lot , I would like the schematic diagram if possible
I didn't find it here
Reply 12 years ago on Introduction
Hi Jimyopkins,
Click on the first link in the article and you will see the schematic. I didn't post it here since the Instructables resolution would make it non-readable.
13 years ago on Introduction
This is great! Having a complete kit available for users who don't want to source their own is a good idea. We appreciate that you included the parts list; you might think about moving it up to the beginning (intro or before Step 1), but that's not critical. Rated and channel-featured.
Reply 13 years ago on Introduction
Thanks for the tip. You are right it flows much better this way.