Reading the temperature with the Arduino is a very useful task. There are a wide variety of temperature sensors with different features that you can use in your projects. In this article, we’ve put together a compilation of 9 affordable temperature sensors compatible with the Arduino and other development boards (like ESP32 or ESP8266).
1. DHT11
The DHT11 is a digital temperature sensor that measures temperature and relative humidity.
These sensors contain a chip that does analog to digital conversion and spit out a digital signal with the temperature and humidity. This makes them very easy to use with any microcontroller, including the Arduino.
The following table shows the most relevant specifications of the DHT11 temperature sensor.
DHT11 | |
Communication protocol | one-wire |
Power supply range | 3 to 5.5 V |
Temperature range | 0 to 50 ºC +/-2 ºC |
Humidity range | 20 to 90% +/-5% |
Sampling period | 1 second |
Arduino libraries | Adafruit DHT Library Adafruit Unified Sensor Library |
Where to buy? | Check prices |
We have a dedicated guide on how to use this sensor with the Arduino:
2. DHT22
The DHT22 temperature sensor is very similar to the DHT11. It also measures temperature and humidity and the pinout is the same. It is slightly more expensive, but it is more accurate and it has a wider temperature and humidity measurement range.
The following table shows the most relevant specifications of the DHT22 temperature sensor.
DHT22 | |
Communication protocol | one-wire |
Power supply range | 3 to 6 V |
Temperature range | -40 to 80 ºC +/-0.5ºC |
Humidity range | 0 to 100% +/-2% |
Sampling period | 2 seconds |
Arduino libraries | Adafruit DHT Library Adafruit Unified Sensor Library |
Where to buy? | Check prices |
Learn how to use the DHT22 temperature sensor with the Arduino with the following tutorial:
3. LM35DZ, LM335, LM34
The LM35DZ is a linear temperature sensor that comes directly calibrated in Celsius. The analog output is directly proportional to the temperature in Celsius: 10 mV per degrees Celsius rise in temperature.
This sensor is very similar with the LM335 (calibrated in Kelvin) and with the LM34 (calibrated in Fahrenheit).
The following table shows the most relevant specifications of the LM35 temperature sensor.
LM35DZ | |
Communication protocol | analog ouput |
Power supply range | 4 to 30 V |
Temperature range | -55 to 150ºC |
Accuracy | +/-0.5ºC (at 25ºC) |
Interface with Arduino | analogRead() |
Where to buy? | Check prices LM35 LM335 LM34 |
Learn how to use the LM35DZ, LM335 or LM34 temperature sensors with the Arduino:
4. BMP180
Although the BMP180 is a barometric pressure sensor, it also measures temperature. This is very useful to include in any weather station project.
The following table shows the most relevant specifications of the BMP180 sensor when it comes to temperature reading.
BMP180 | |
Communication protocol | I2C |
Power supply range | 1.8 to 3.6V (for the chip) 3.3 to 5V for the module |
Temperature range | 0 to 65ºC |
Accuracy | +/-0.5ºC (at 25ºC) |
Interface with Arduino | Adafruit BME085 Adafruit Unified Sensor Library |
Where to buy? | Check prices |
Check the following tutorial to learn how to use the BMP180 sensor with the Arduino to measure pressure, temperature and estimate altitude:
5. TMP36
The TMP36 is an analog temperature sensor. It outputs an analog value that is proportional to the ambient temperature. It is very similar to the LM35 temperature sensor.
Check the TMP36 most relevant specifications on the following table.
TMP36 | |
Communication protocol | analog output |
Power supply range | 2.7 V to 5.5 V |
Temperature range | -40°C to +125°C |
Accuracy | +/-1ºC (at 25ºC) |
Interface with Arduino | analogRead() |
Where to buy? | view on eBay |
6. LM75
The LM75 sensor is another useful temperature sensor. It works via I2C communication, which means that it communicates with the Arduino using the SDA and SCL pins. You can find one of these sensors for approximately $2 (view on eBay).
Take a look at the following table for a summary of the LM75 sensor specifications.
LM75 | |
Communication protocol | I2C |
Power supply range | 3.0 to 5.5V |
Temperature range | -55 to 125ºC |
Accuracy | +/-2.0ºC (at -55 to 125ºC range)) |
Interface with Arduino | I2C Library for LM75 |
Where to buy? | view on eBay |
7. BME280
The BME280 is a barometric sensor that also measures temperature and humidity. It can communicate via I2C or SPI communication protocol and the BME280 module can be powered either with 3.3 or 5V.
The following table shows a summary of the BME280 sensor specifications when it comes to the temperature sensor.
Take a look at the following table for a summary of the LM75 sensor specifications.
BME280 | |
Communication protocol | I2C or SPI |
Power supply range | 1.7 to 3.6V (for the chip) 3.3 to 5V for the board |
Temperature range | -40 to 85ºC |
Accuracy | +/-0.5ºC (at 25ºC) |
Interface with Arduino | Adafruit BME280 library Adafruit Unified Sensor Library |
Where to buy? | Check prices |
Learn how to use the BME280 with the Arduino to get temperature, humidity and pressure readings:
8. DS18B20
The DS18B20 temperature sensor is a one-wire digital temperature sensor. This means that it just requires one data line (and GND) to communicate with the Arduino.
Each DS18B20 temperature sensor has a unique 64-bit serial code. This allows you to wire multiple sensors to the same data wire. So, you can get temperature from multiple sensors using just one Arduino digital pin.
The following table shows the most relevant specifications of the DS18B20 temperature sensor:
DS18B20 | |
Communication protocol | one-wire |
Power supply range | 3.0 to 5.5V |
Operating temperature range | -55ºC to +125ºC |
Accuracy | +/-0.5 ºC (between the range -10ºC to 85ºC) |
Arduino libraries | DallasTemperature OneWire |
Where to buy? | Check price on Maker Advisor |
Learn how to use the DS18B20 temperature sensor with the Arduino:
9. Waterproof DS18B20
The DS18B20 is also available in waterproof version (read the DS18B20 guide). The wires are protected with PVC which is ideal if you need to measure the temperature of liquids, or if the sensor needs to be exposed to water.
The wiring and specifications are the same as for the normal DS18B20.
Where to buy? Compare the waterproof DS18B20 temperature sensor prices on Maker Advisor.
Wrapping Up
We hope you’ve found this guide useful. We also have guides for other Arduino sensors and modules that you may like:
- Guide for I2C OLED Display with Arduino
- Complete Guide for RF 433MHz Transmitter/Receiver Module With Arduino
- Guide for Relay Module with Arduino
- Complete Guide for Ultrasonic Sensor HC-SR04 with Arduino
You may also like our Arduino resources:
- Free Arduino Projects and Tutorials
- Arduino Step-by-step Projects Course
- Android Apps for Arduino with MIT App Inventor 2 eBook
Thanks for reading.
P.S. We also recommend reading:
Hi Rui,
thank you for this list of temperature sensors.
Don’t take me wrong, but after reading this page the reader still doesn’t know which sensor to use.
It would be very helpful if you could add a comparative table, with main characteristics (operating voltage, communication process, etc), and the strong/weak points.
Like this your readers would have a pretty overview of which sensors suits the best for the project they are preparing.
This is not a critic, but a suggestion 😉
Roger
Very good to have data in this form easy to access
Thanks Jeff!
nothing about KTY 81-210 sensor
That’s a good one, thanks for the feedback!
hi rui
thanks a lot for your website
the most annoying problem is that these sensors are not reliable, i.e. you can not use them in a project and let it work for at least 6 months!
Am I not right?
I agree, but some of them are so cheap that we can’t complain…
Hi Rui, I think that DS1621 can be placed in to your list of temperature sensors. This mc not only temperature sensor, it also can be programmable thermostat and support addressing (up to 8 chips on I2C bus). I.e. we only need to set bounds and this mc will keep user defined temperature automatically.
It could definitely be on the list. Thanks for the feedback!
DS1621 is the best.
Hi Rui,
I would like to measure temperature on two spots on a diesel engine, coolant (±90°C) with a NCT or LM35 and exhaust gas (±650°C) with a Max667 and K-Type thermocouple connected to a Arduino UNO and display. Any suggestions and links please.
Regards
Danie
Hi,
I don’t have any tutorials with those exact components.
Thanks for asking,
Rui
¿No has probado el AD590? Tiene salida por corriente, 1uA/K para Vcc entre 4 y 30V.
Perfecto para hacer sonda remota. La serie de sensores de Analog Devices está muy bien.
Unfortunately I don’t speak Spanish…
Thanks for reading,
Rui
I do use the Ds18B20 one; now traying to add a sd card for recording values.
I also use that one quite often
I am using the DS18B20 quit often.
Me too! It’s definitely a great one
Hii,
Which one of the above temperature sensor is possible to use for detecting and monitoring breathing as well as more accurate !
Hello Orwa,
This comparison guide might help: https://randomnerdtutorials.com/dht11-vs-dht22-vs-lm35-vs-ds18b20-vs-bme280-vs-bmp180/
I greatly appreciate the idea that all temperature sensors were placed on this list. However, what do you guys think would best fit the requirement of high accuracy, low power consumption and long lifetime? I was worried that abdolhamed mentioned that these devices won’t be as good after 6 months or less perhaps. I’ll be using one temperature sensor with a MQ-02 gas and smoke sensor for our wireless sensor network based-fire alarm system project for our thesis. Thank you! 😀
nice information!!!!1
Thanks for compiling this info.
good idea very nice
Thanks for reading! I hope it was helpful.
I am looking to use a sensor in a project where the sensor will be on the bottom of a wooden object. Which sensor, if any, would be able to have the weight of the wood on top of it? Thank you!
Hi Liza.
I’ve never used one, but I think what you need is a load sensor like this one: sparkfun.com/products/10245
Regards,
Sara
Temperature ranges ???
I’ve just added the temperature ranges to each sensor in this post.
We also created a dedicated guide comparing different temperature sensors (DHT11 vs DHT22 vs LM35 vs DS18B20 vs BME280 vs BMP180): https://randomnerdtutorials.com/dht11-vs-dht22-vs-lm35-vs-ds18b20-vs-bme280-vs-bmp180/
Every project I’ve seen is always about low temperature sensors and never about how to utilize Type K hermocouples and RTDs utilizing the MAX31865 and MAX31855 amplifier boards. An OLED display would also be a great addition to such a project together with WIFI to a home network
I would love to build an outdoor temperature probe cabled to an indoor Arduino-based digital readout. Are any of these digital protocols capable of running over long distances? My temperature sensor would be about 10 meters away from the Arduino.
I’ve never tried that, but I don’t think that would work with any of these sensors. You might need to have two boards exchanging sensor data.
You might like reading this post comparing different temperature sensors: DHT11 vs DHT22 vs LM35 vs DS18B20 vs BME280 vs BMP180 https://randomnerdtutorials.com/dht11-vs-dht22-vs-lm35-vs-ds18b20-vs-bme280-vs-bmp180/
I have two waterproof ds1820 sensors running over cat 6 cable. The Arduino is inside and the cable runs into the greenhouse about 5 metres of cable then carries on to a place on the fence at the end of the garden that is always in the shade to get an accurate shade temp reading. This is approx a further 9-10 metres.
I upload my readings to Cayenne cloud based server with apps to view readings every 3 minutes.
This has been running stable readings for over 6 months now.
I did find that joints need a good solder connection and all screened. I doubled up two of the eight available wires for each line. (Ground,data,power)
I originally used 5volt pin on Arduino and I did find I got some failed to reads now and again usually during very cold nights. The readings also oscillated a few points.
After experimenting after reading some comments about RF interference etc. I found that it worked better on the 3.3 volt pin. The readings are much smoother and an odd failed to read a month which I filter out.
I would like to add a humidity sensor to a 1-wire setup as above anyone suggest a 1-wire compatible sensor
Can you tell me which sensor will best work in medical system in terms of accuracy and speed?