In this article we are going to construct a simple automatic temperature regulator circuit which will turn on the fan or any other gadgets connected to it, when the ambient temperature reaches a pre-determined threshold level. We are going to utilize DHT11 sensor and arduino for this project.
By: Girish Radhakrishnan
The beauty of microcontrollers is that, we get very precise control over the peripherals which are connected to it. In this project the user just need to input the threshold temperature in the program, the microcontroller will take care of rest of the function.
There are tons of non-microcontroller based automatic temperature controller projects available around the internet, such as using comparator and transistors.
They are very simple and they do work well but, the problem arises while calibrating the threshold level using preset resistor or potentiometer.
We have a blind idea while calibrating it and the user may need to do trial and error method to find the sweet spot.
These problems are overcome by microcontrollers, the user just need to enter the temperature in Celsius in this project, so no need for calibration.
This project can be used where internal temperature of circuit need to be stabilized or saving it from overheating.
In diagram 1, we are connecting a CPU fan as output. This setup can be used to control the internal ambient temperature of an enclosed circuit.
When the threshold temperature is reached the fan turns on. When the temperature goes below threshold temperature fan turns off. So it’s basically an automated process.
In diagram 2, we connected a relay for controlling devices which runs on mains voltage such as table fan.
When the room temperature reaches the threshold temperature the fan turns on and turns off when the room cools down.
This may be the best way for saving power and this can be heaven for lazy people who wish others to switch the fan ON when they feel warm.
The Circuit Design:
This setup may be deployed for circuits which are enclosed in a box. The LED turns ON when the preset threshold level reached and also turns ON the fan.
This circuit does the similar function of previous circuit, now the fan is replaced by relay.
This circuit can control a table fan or ceiling fan or any other gadget which can cool down the ambient temperature.
The connected device turns off as soon as the temperature reached below preset threshold level.
The diagrams illustrated here are just few of many possibilities. You may customize the circuit and program for your own purpose.
NOTE 1: #Pin 7 is output.
NOTE 2: This program is only compatible with DHT11 sensor only.
Program for the above explained automatic temperature regulator circuit using Arduino:
//--------------------Program developed by R.Girish---------------------//
#define DHTxxPIN A1
int p = A0;
int n = A2;
int op = 7;
int th = 30; // set thershold tempertaure in Celsius
Serial.begin(9600); // May be removed after testing
int chk = DHT.read11(DHTxxPIN);
// you may remove these lines after testing, from here
Serial.print("Temperature(°C) = ");
Serial.print("Humidity(%) = ");
// To here
// may be removed after testing from here
// To here
//-------------------------Program developed by R.Girish---------------------//
Note: In the program
int th= 30; // set the threshold temperature in Celsius.
Replace “30” with the desired value.