This is very simple but useful circuit to control the fan based on the temperature. The operation of the circuit is that the fan will switch on automatically if the temperature is more than set point, and off if the temperature is less than the set point. The set point can be varied easily by pot (P1 in this circuit).
Here we are using LM35 to measure temperature, output of sensor is given to a simple amplifier (gain of 2.5) and then the amplified output is fed to a comparator. The comparator compares the sensor reading with the set point, the output of comparator will be high if sensor signal is higher than the set point. if the sensor signal is less than the setpoint then the output of comparator output will be low.
The comparator output can be used to drive a relay circuit through which we can control Fan as we did here, Not only fan you can connect any AC load that has dependency on temperature. For example you connect heater but you need to invert the output for that.
You can even measure temperature using this circuit. Connect positive terminal of multimeter to point T1 in the circuit and negative terminal to common ground.
Temperature= (Voltage reading in millivolts)/25 ºC