If you’re going to use your Arduino UNO to its fullest potential, then you’ll need to pair it with one or more extra components. After all, an Arduino that’s incapable of interacting with the world around it isn’t much fun!
Components in an electronic circuit can be divided into three categories:
+ Input devices, like buttons, switches, and sensors.
+ Processors, such as standalone microcontrollers and single-board computers like the Arduino, ESP and Raspberry Pi.
+ Outputs (or actuators), which convert voltages into sound waves or lights that we can sense.
In this post, we’ll focus on the first part of this chain. All input devices can be classed as sensors. These are components whose output (usually an analog voltage) changes according to a given property of the surrounding environment. This change might be anything from a change in the temperature to gravity, to electromagnetic charge. Sensors are incredibly useful devices. Without them, electrical circuitry just wouldn’t make much sense!
You’ll find it easy to incorporate sensors into your projects using an Arduino, particularly if they’re built into a breakout board. But with so many types of sensors to choose from, deciding which to use may not be so simple. In this blog post, we tried to cover two of the temperature Arduino sensors(DHT11 and DHT22) we sell– but bear in mind that these sensors can also be used with other microcontrollers.
These Arduino sensors come in shapes and sizes. Here, we’ll examine the two different types of temperature sensors in detail and try to determine how (and why) we might implement each into our circuit designs. We’ll also talk about where they can be used, what their advantages and drawbacks are, and hopefully, provide you with a little bit of inspiration for your project. Let’s begin!
Temperature sensors
A temperature sensor, as you can probably guess, detects changes in ambient temperature. They’re a key component in any device that relies on this information, like an automated gardening system that opens or closes a window in a greenhouse depending on the temperature inside. You’ll often find temperature and humidity sensors bundled within the same breakout board.
Temperature sensors
DHT22 DHT11
Thermistors
All conductive material becomes less conductive when exposed to heat. A thermistor exploits this phenomenon in a controlled way and allows a circuit to figure out the ambient temperature by recording the resistance. Thermistors come in two sorts: negative temperature coefficient (NTC) and positive temperature coefficient (PTC). The former offers less resistance as the temperature rises; the latter offers more. By choosing the right one, you’ll be able to keep your circuit simple.
Our NodeMCU-powered smart-thermistor incorporates the DHT22, which uses a thermistor to measure temperature, and another embedded sensor to measure humidity. The two sensors are connected internally to a microcontroller which outputs a digital signal along a single wire. This extra stuff slows the circuit down a little, with samples being taken every two seconds – but for our purposes, this wasn’t a problem.
Applications for temperature sensors
So where are these technologies applied? The same principles apply to your oven – built-in temperature sensors inside the compartment constantly check to see whether the temperature is above or below the desired level. If things are too warm or too cold, it will adjust the power going to the heating elements. Similar arrangements exist in other appliances where temperature needs to be controlled – including fridges, air-conditioning units, the nozzle on your 3D printer, the tip of your soldering iron and the CPU on your computer.
How to Choose a Temperature Sensor
Accuracy
Of the components we’ve mentioned, a thermistor is by far the most accurate.
Range
In a thermocouple, the actual sensor is shielded, leaving only the metal arms to which it’s attached exposed to higher temperatures. As such, it’s a great choice for high-temperature situations.
Interface (analog/digital)
Pretty much all temperature sensors put out an analog current; you’ll need to use an ADC to turn their outputs into a useable digital value.
Response Time
If you’re measuring very rapid changes in temperature, then you need an accordingly fast response time. In this respect, thermistors and thermocouples come out on top; they’re able to respond within just a few hundred milliseconds, while an RTD might take ten times longer or more.
Conclusion
Hopefully, by now you’ve got an idea of the sorts of temperature Arduino sensors we have available and what they do. There’s plenty more detail to get into, and there’s plenty of information out there on the sensors we’ve mentioned.