Make Your Own Temperature Controller with an Arduino

2022-06-25 07:55:55 By : Mr. John Zhu

Raise the perfect bread, brew beautiful beer, and rear happy chicks with an Arduino temperature controller.

Raise the perfect bread, brew beautiful beer, and rear happy chicks with an Arduino temperature controller. This is particularly useful if you live in a less than reliable climate where directions to keep something at a set temperature aren't particularly helpful. If you are looking for an expensive solution to temperature control, then an Arduino is the way to go.

In this article, we'll show you how to make your own Arduino temperature controller.

Not everybody has an air conditioner, and raising the thermostat for the whole house isn't practical for just making one loaf of bread. Even when kept inside, baby chicks can die if the temperature drops at night; and getting them to hatch in the first place requires an even stricter temperature range. If you are making bread or perhaps raising chicks, avoid purchasing expensive equipment by making a temperature controller with an Arduino and household bits.

The same is also true for keeping items cool. It can be wasteful to power a whole fridge just for making yogurt – but with a temperature controller, the principle is the same. Instead of activating a heating element, you'll be activating the plug on a mini-fridge or other cooling element, like a Peltier thermoelectric cooler from Spark Fun, but of course, the logic will be reversed.

This is an Arduino project that requires some knowledge of electronics. If you've never worked with Arduino before, you can check out our article explaining what is Arduino and what can you do with it? Otherwise, let's start with what you will need:

The last item has been left deliberately vague. If you have an incandescent bulb (the kind that gets hot, not an energy-saving bulb), or a hot lamp for sporting injuries, this will probably be the easiest to set up.

A heating band is used in this tutorial. It's basically a band of rubber that gets warm when electricity is passed through, and it's used on carboys and kegs for initial fermentation stages in wine or beer making. Technically, this can be a fire risk when not wound around something, so we advise not to use this unless you are familiar with this material. You can also buy heating pads for the same purpose.

For safety reasons, RC plugs are being used to switch AC devices.

Let's start by wiring up and testing the temperature sensor. You can find detailed information about this sensor on Adafruit.

With the flat side toward you and legs face down, the TMP36 temperature sensor is wired up in the order: +, signal, and GND. The + goes to the 3.3V output from Arduino; you also need another line going from the +3.3V to the AREF pin. This will tell the Arduino to use 3.3V for analog input reference instead of 5V. Connect the signal pin of the sensor to A1. In previous attempts, TMP36 was used directly on the 5V line; it works, but unfortunately, when paired with a relay there was a power drop whenever the relay was activated, resulting in readings that highly fluctuated.

For this project we used an old network cable as a signal cable, this is very useful to have around as there are eight wires inside. The cable is quite thin, however, so be sure to strengthen the other end with solder where it'll be screwed into a terminal block.

The formula in the code is correct if you're using the TMP36 sensor; you should be able to find a code sample for other sensors if your model differs. This sample code is from Adafruit, load it up and open the Serial console to examine the output.

If possible, you can compare your readings with a thermometer to check the accuracy. Readings not right?

To control the heating element, we've used a couple of RC plug sockets and have taken apart the controller. Only the ground and control pin needs to be connected. The code has been modified to include the relevant libraries which you can download from GitHub.

At this point, you can remove all references to Fahrenheit and continue working with Celsius only if you prefer. Next, define the desired temperature you want to maintain, and add in a simple control structure like so:

There's nothing complex here that you won't understand, it's simply comparing the current temperature reading to the desired one, and turning on the switch if it's lower; otherwise, turn it off.

The complete code can be copied via Pastebin, though you will need to adjust this if you're using a relay (it's not hard). Here's the complete wiring diagram used:

Tape the sensor inside the box you're using, and place the heating element wherever is appropriate. Set the desired temperature, and turn it all on. If you keep your PC connected for now, you can use the Serial console to observe changes as your box heats up.

Finally, what would this project be without testing our Arduino based temperature controller? Try whipping up a batch of ready-mixed dough and splitting it into two loaves. Put one loaf inside the box and one outside on a bench to see how the results compare. Our tests showed that the loaf inside the box with the temperature control turned out slightly larger.

Wondering what else you can use a temperature sensor for? Check out these projects:

From precision baking to fermentation stations, an Arduino temperature controller is incredibly handy in a number of different applications. Once you've made this project, you'll be ready to apply this setup to future projects to give you complete control over your experiments!

Garling loves exploring creative uses for technology. With a background in music, she spent many years hacking computers to make weird and wonderful sounds. When not making music, she writes about the best DIY electronic projects.

Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!