This is the another application of a comparator. This can save the power and we don't need to switch ON and OFF the ceiling FAN manually. here we can set the threshold voltage to our desired value. The ceiling fan will be switched ON when the temperature increases the threshold value. We are using LM35 sensor to sense the room temperature. The sensitivity of this LM35 sensor is 10mv/ 'C. I want that fan to be switched on when the temperature increases more than 27'C. so set my threshold voltage to
Vthreshold = 27'C x 10mv = 270mv = 0.27V
here the room temperature is 26'c so the output voltage is < 0.27V ; Fan off
to see the output
when the temperature increases to 27'c or more, the output voltage of LM35 will increases to more than 0.27V. so that opamp output will goes to +Vsat=+5v. This will switch ON the transistor and so relay connects. This will switch ON the ceiling fan.
here the temperature is 28'c so the output voltage >0.27v; fan ON LM35 sensor