
Choosing the right Temperature Sensor for the ESP32 Project
There are plenty of different temperature sensors, some also include humidity, pressure, other sensors, uses I2C or SPI. Choosing the best sensor for ESP32.
Today we are going to go through the most popular ESP32-compatible temperature sensors, exploring a range of options to suit your specific needs. From basic temperature sensing with popular sensors like the DHT11 to more advanced solutions offering precision, we are going to through different temperature sensors compatible with ESP32, in groups from most popular to less popular sensors. We are going to review the following ESP32 Temperature sensors:
- BME / BMP Series
- AHT Series
- DHT Series
- DS18B20 Series
- SHT Series
- TMP Series
- Other Popular Temperature Sensors
BME / BMP Series #
BME and BMP sensors are manufactured by Bosch Sensortec. The "BME" in their names stands for "Bosch Sensortec Environmental.", while the "BMP" stands for "Bosch Sensortec Pressure.".
BME Series sensors usually come with temperature and atmospheric pressure sensors, while BMP models also include a humidity sensor. Also, some sensors come with a gas sensor.
Bosch Sensortec is a division of Bosch, a multinational engineering and technology company headquartered in Germany. Bosch Sensortec specializes in the development and production of sensors and sensor solutions for various applications, including automotive, consumer electronics, industrial, and IoT (Internet of Things).
The BME and BMP sensors offer high accuracy and reliability and provide valuable insights into air pollution and indoor environmental conditions, making them suitable for a wide range of applications, from weather monitoring to indoor air quality assessment.
BMP085 / BMP180 #
BMP085 / BMP180 Sensor
BMP280 / BME280 #
BMP280 / BME280 Sensor
BMP388 / BMP390 #
BMP388 / BMP390 Sensor
BMP581 #
BMP581 Sensor
BME680 #
BME680 Sensor
AHT Series #
The AHT series comprises digital temperature and humidity sensors manufactured by Aosong Electronics Co., Ltd., also known as AOSONG.
These sensors offer reliable and accurate measurements of temperature and humidity, making them suitable for a wide range of applications in both industrial and consumer electronics. They are known for their ease of use, low power consumption, and competitive pricing, making them popular choices for environmental sensing and climate control systems.
The AHT series sensors typically use the I2C (Inter-Integrated Circuit) communication protocol for interfacing with microcontrollers or other devices.
AHT10 #
AHT10 Sensor
AHT20 #
AHT20 Sensor
AHT21 #
AHT21 Sensor
DHT Series #
The DHT series sensors are commonly manufactured by various companies, but one of the prominent manufacturers is the same as for the AHT Series, the Aosong Electronics Co., Ltd., also known as AOSONG.
These sensors are popular due to their simplicity, affordability, and ease of use. It can be used with practically any controller, not only the ones that have I2C or SPI protocols, such as ESP32, as it is controlled with a single-wire digital interface. These sensors provide a convenient way to measure temperature and humidity. However, it's important to note that while they offer cost-effective solutions, they do not provide the same level of accuracy and reliability as more advanced sensors.
DHT11 #
DHT11 Sensor
DHT12 #
DHT12 Sensor
DHT21 #
DHT21 Sensor
DHT22 #
DHT22 Sensor
Dallas Series #
The DS18B20 series consists of digital temperature sensors manufactured by Maxim Integrated. Uses the 1-Wire protocol for communication therefore is suitable for a wide range of microcontrollers.
DS18B20 #
DS18B20 Sensor
SHT Series #
SHT Series consists of several groups of digital temperature sensors. The SHT3x-D, SHT4x, and SHTCx series refer to various models of digital temperature and humidity sensors manufactured by Sensirion. The SHT series sensors typically offer higher accuracy in temperature and humidity measurements compared to the AHT and DHT series sensors. Sensirion's SHT series sensors often have lower power consumption compared to the AHT and DHT series sensors. However, all these improvements come at a higher price and, therefore are a less popular choice for hobbyist projects.
SHT3X-D Series #
The SHT3x-D Series offers reliable temperature and humidity sensing with good accuracy. It provides temperature accuracy typically around ±0.3°C and humidity accuracy around ±2% RH. These sensors are compact, supporting both I2C and SPI interfaces for communication. Suitable for a wide range of applications where moderate accuracy and reliability are required.
SHT30-D #
SHT30-D Sensor
SHT31-D #
SHT31-D Sensor
SHT35-D #
SHT35-D Sensor
SHT4x Series #
Building upon the capabilities of the SHT3x-D Series, the SHT4x Series provides enhanced accuracy and performance. With improved temperature accuracy typically around ±0.2°C and humidity accuracy around ±1.5% RH, these sensors offer superior reliability. They maintain a similar compact form factor and support both I2C and SPI interfaces. Ideal for applications demanding higher accuracy and precision in temperature and humidity measurements.
SHT40 #
SHT40 Sensor
SHT41 #
SHT41 Sensor
SHTCx Series #
The SHTCx Series represents the latest advancements in temperature and humidity sensing technology. These sensors offer additional features and improvements compared to their predecessors. With further enhanced accuracy and possibly lower power consumption, they cater to applications requiring superior performance. Some models may also feature smaller form factors, making them suitable for space-constrained applications.
SHTC1 #
SHTC1 Sensor
SHTC3 #
SHTC3 Sensor
TMP Series #
The TMP series sensors are a range of temperature sensors produced by Texas Instruments (TI), a leading semiconductor company. These sensors are designed to measure temperature accurately and are available in various formats, including analog and digital, with different levels of accuracy, resolution, and interface options.
TMP36 #
TMP36 Sensor
TMP102 #
TMP102 Sensor
TMP117 #
TMP117 Sensor
Other Popular Temperature Sensors #
Apart from the already discussed groups of temperature sensors, compatible with ESP32, there are a lot of other sensors, from different manufacturers. They are less popular than the ones we have discussed above but still are very popular and highly available on the market. They can also easily be used with ESPHome.
DPS310 #
DPS310 Sensor
HDC1080 #
HDC1080 Sensor
MCP9808 #
MCP9808 Sensor
MLX90614 #
MLX90614 Sensor
MPL3115A2 #
MPL3115A2 Sensor
MS5611 #
MS5611 Sensor
HTU21D #
HTU21D Sensor
Comparison #
To easily choose a suitable temperature sensor, you can find below a comparison table of all mentioned temperature sensors with specified communication protocol, if the sensor includes pressure, humidity or other sensors.
| Sensor | Communication Protocol | Temperature Sensor | Pressure Sensor | Humidity Sensor | Other Sensor |
|---|---|---|---|---|---|
| BMP085/BMP180 | I2C or SPI | Yes | Yes | No | No |
| BMP280/BME280 | I2C or SPI | Yes | Yes | BME280 Only | No |
| BMP388/BMP390 | I2C or SPI | Yes | Yes | No | No |
| BMP581 | I2C or SPI | Yes | Yes | No | No |
| BME680 | I2C or SPI | Yes | Yes | Yes | Gas |
| AHT10 | I2C | Yes | No | Yes | No |
| AHT20 | I2C | Yes | No | Yes | No |
| AHT21 | I2C | Yes | No | Yes | No |
| DHT11 | Single-wire | Yes | No | Yes | No |
| DHT12 | Single-wire | Yes | No | Yes | No |
| DHT21 | Single-wire | Yes | No | Yes | No |
| DHT22 | Single-wire | Yes | No | Yes | No |
| DS18B20 | Single-Wire | Yes | No | No | No |
| SHT30-D | I2C or SPI | Yes | No | Yes | No |
| SHT31-D | I2C or SPI | Yes | No | Yes | No |
| SHT35-D | I2C or SPI | Yes | No | Yes | No |
| SHT40 | I2C or SPI | Yes | No | Yes | No |
| SHT41 | I2C or SPI | Yes | No | Yes | No |
| SHTC1 | I2C | Yes | No | Yes | No |
| SHTC3 | I2C | Yes | No | Yes | No |
| TMP36 | Analog | Yes | No | No | No |
| TMP102 | I2C | Yes | No | No | No |
| TMP117 | I2C, SMBus | Yes | No | No | No |
| DPS310 | I2C | Yes | Yes | No | No |
| HDC1080 | I2C | Yes | No | Yes | No |
| MCP9808 | I2C | Yes | No | No | No |
| MLX90614 | I2C | Yes | No | No | No |
| MPL3115A2 | I2C | Yes | Yes | No | No |
| MS5611 | I2C | Yes | Yes | No | No |
| HTU21D | I2C | Yes | Yes | No | No |
Internal Temperature Sensor #
Since we are talking about ESP32 temperature sensors, we must mention the Internal ESP32 Temperature Sensor. It measures the chip's temperature itself (think like CPU), instead of the environment. These sensors are included in most of the ESP32 versions. You can find more information in our post "Measuring ESP32 capabilities with Inbuilt Temperature Sensor".
Conclusion #
Throughout this guide, we've explored a variety of ESP32-compatible temperature sensors, from the beginner-friendly DHT11 to more advanced solutions like the BME680 and DS18B20.
No matter the complexity of your project or the level of precision required, there's a temperature sensor compatible with the ESP32 to suit your needs. By understanding the features and capabilities of each sensor, you can make informed decisions about which one best fits your requirements.





























