Introduction: A Simple Thermostat

About: Hi, my name is Max. I'm a Computer Science student. I like making convenient devices. I know that nothing is perfect, but some things are far better than the others, for that reason I'm providing all of my pro…

In this project, I'm going to show you how to build a simple thermostat.

Supplies

1) Arduino x1
2) K0-4B display x1
3) Relay module x1
4) LM317 x1
5) DS18B20 x1
6) 20K potentiometer x1
7) 33K resistors x2
8) 20K resistors x2
9) 10K resistor x1
10) 50K resistor x1
11) 4.7K resistor x1
12) Wires

Step 1: How Does a Thermostat Work

DS18B20 measures the ambient temperature and sends the readings to Arduino. Arduino sends the value of the ambient temperature to the display, and at the same time compares this value with the desired temperature.

If the ambient temperature = desired temperature then do nothing;
If the ambient temperature at least one degree lower than the desired temperature, then turn the heater on;
If the ambient temperature at least one degree higher than the desired temperature, then turn the heater off.

Step 2: Gather the Components

Step 3: Flash Arduino

Step 4: Connect the Display

Step 5: Connect the DS18B20

Step 6: Connect the Potentiometer

Step 7: Connect the Relay Module

Relay module with one relay will be enough for this project.

Connect relay module's VCC to Arduino's 5V pin
Connect relay module's IN to Arduino's 3 pin
Connect relay module's GND to Arduino's GND

Step 8: Test the Device

Finally. Let's test it!

The ambient temperature will be displayed on the left, the desired temperature will be displayed on the right.

I've set the desired temperature to 75°F. In the first photo, you can see that the ambient temperature is 76°F. So, the heater will be turned off. In the second photo, you can see the temperature falling to 75°F, it's equal to the desired temperature. Hence, the state of the heater won't change. In the third photo, the temperature falls to 74°F, which is one degree lower than the desired temperature. Hence, the heater will turn on until the ambient temperature won't reach 76°F.

Step 9: How to Display Temperature in °C

To display the temperature in °C, simply modify these two strings. But since this display only supports the letters "F" and "P". It won't be able to display the letter "C".

Step 10: Output in °C *optional

Step 11: Connect the Heater

High voltage is dangerous. Improper wiring on that step may lead to an injury, including potentially fatal injuries or even death. Proceed at your own risk.

Automation Contest

Participated in the
Automation Contest