Temperature controlled fan using Arduino

I am constructing a temperature controlled fan using Arduino. I am using the temperature sensor(LM35) and a 5 volt minfan. The objective is for the fan to change speeds according to the what the temperature sensor reads. If the temp is cool the fan should operate at a low speed and if it is hot it should operate at high speed. I need some help on how to write my program for this particular task

I need some help on how to write my program for this particular task

Here's a start:

void setup()
{
}

void loop()
{
}

All you need to do is fill in the bit that reads the temperature sensor and sets the fan speed, and sends that value to the fan.

Depending on the fan, you may need to use a transistor between the Arduino and the fan,

My advice would be to either:

  1. use PWM (pulse width modulation). http://arduino.cc/it/Tutorial/PWM This is my preferred method, and the most simple to implement.
  2. the fan should have more than one speed setting. If it does, hack the fan by overriding the switches for these speed settings (you'll need to take some or all of the housing apart), and connect relays to these. When it is cold in the room, turn the fan off. When it is cool, turn the fan to slow. When it is hot, turn the fan on full blast.
  3. build your own fan using a motor, then control the motor speed.

This is a similar topic to yours with responses http://arduino.cc/forum/index.php?topic=101952.0

This is a similar topic to yours with responses http://arduino.cc/forum/index.php?topic=101952.0

That's one of nella400's own threads. He/She keeps on asking the same question.

hi i am making a project that when the temperature reaches 78 degrees the fan turns on and when it lowers again to 72 it turns off. any ideas how to write a program... we are new at this :/

What are you using to measure temperature? Have you managed to read it and send the result to the serial port yet?