The best temperature and humidity sensor for ESPHome

Disclosure: This post contains affiliate links. If you click through and make a purchase, I will earn a commission, at no additional cost to you. Read my full disclosure here.

This article will cover the best available temperature and humidity sensors you can buy for your ESPHome projects. Not only that, I will also be telling you why you should not be using certain sensors that are frequently recommended in other articles.

Long was the rein of the DHT11 temperature and humidity sensor as a main component in ESPHome and other DIY projects. But is it time makers started considering newer and potentially better sensors? How does the cheap DHT11 hold up against the more modern competition? Read on to find out.

The DHT11 temperature and humidity sensor has many issues

The DHT11 is a very basic and ultra-low-cost temperature and humidity sensor. It uses a capacitive humidity sensor and a thermal resistor (thermistor) to measure the temperature, and a very basic chip converts the analogue signal in to a digital one. A thermistor's resistance changes ever so slightly with temperature. However, that change is miniscule and difficult to measure.

The DHT11's thermistor leads to inaccuracy

You will find the DHT11 used in a myriad of online guides. But the DHT11 has some serious issues. Foremost is its accuracy due to the use of a thermistor. For the temperature, it can be up to ±2 °C out. It doesn't read like much, but being in a home that is 18 °C and one that is 20 °C is a big difference.

Additionally, the DHT11 only has a resolution of 1 °C (meaning it can only tell the temperature in whole numbers and not fractions). The DHT11 doesn’t do much better when sensing the relative humidity, where it can be up to ±5% off the actual relative humidity.

The DHT11 is unreliable

The next major issue is reliability. It is not recommended that you place the DHT11 sensor in a humid environment. This makes them pretty useless for use in bathrooms or in the room you have your clothes drying rack, which are of course the rooms where you will most likely want to keep an eye on the relative humidity.

The DHT11 might be cheap, but if you have to frequently replace it, a slightly pricier but more reliable option will turn out to be cheaper eventually and lead to less waste being generating.

Verdict: Don't use the DHT11 for anything besides tests with ESPHome

The answer to whether you should be using the DHT11 in your future ESPHome projects is a definite no. It isn’t accurate or reliable and should only be used for testing purposes. I say that because they are still cheaper than most of the competition. If you're building a project that might kill your sensor, you might want to use the cheapest one available for testing purposes. After all, the low cost is still an advantage in certain situations.

The DHT11 temperature and humidity sensor, which is no longer recommended for use with ESPHome.
The DHT11 is immediately recognizable

What about the DHT22?

The DHT22 is the DHT11’s successor. It generally costs slightly more than the DHT11, but can definitely still be considered a low-cost option. It is more accurate than the DHT11, coming in with a temperature accuracy of ±0.5 °C and relative humidity accuracy of ±2-5%. Additionally, the DHT22 has a higher resolution than the DHT11 at 0.1% for the relative humidity and 0.1 °C for the temperature, making it much more useful for ESPHome projects.

The DHT22 does appear to be a viable alternative to the DHT11 on paper, but it still uses a thermistor to measure the temperature, which, as explained earlier, is difficult to measure. Once we compare the DHT22 to other available sensors, specifically the BME280, you will see why I don't recommend it either.

A quick search online, using your search engine of choice, will bring up many reports of DHT22 sensors breaking after only being used for a short period of time. It appears that it too suffers from poor reliability, just like its predecessor, the DHT11, does.

BME280: The best temperature and humidity sensor for ESPHome

The BME280 is an incredibly accurate temperature and humidity sensor. As an added bonus, you get a third sensor measuring pressure in the same package. That sensor could be used to predict thunderstorms if that tickles your fancy. The BME280 is extremely fast to react to changes and has a temperature resolution of 0.01 °C, a relative humidity resolution of 0.008%, and a pressure resolution of 0.18 Pa.

You will find a BME280 board priced roughly the same as the DHT22. Considering that, you have absolutely no reason to use a DHT22 over this sensor. With the BME280, you get a more reliable, more accurate, and more feature-rich sensor compared to the DHT11 and DHT22.

One thing you want to consider when using the BME280 in ESPHome projects is self-heating. This occurs when the sensor is frequently being used to measure the temperature and humidity. As with any electronic device, the BME280 sensor isn't perfectly efficient and does produce a bit of heat as a by-product. Because of the high accuracy, the temperature sensor can pick up those changes caused by the board itself. Make sure you don’t read the values too often to avoid this issue. If you keep it above 30 seconds, you should be fine.

BME680: Taking ESPHome projects one step further

If you want to take your projects one step further, you have the option of going with the almighty BME680. What makes this sensor so special? Besides measuring temperature, humidity, and atmospheric pressure, it can also measure gas resistance.

Gas resistance might not sound noteworthy until you find out what you can do with it. Using a rather complex formula, you can calculate the Indoor Air Quality (IAQ) of the room the sensor is located in. Just keep in mind, that the BME680 doesn't measure the concentration of particulates in the air. To get PM 2.5 and PM 10.0 readings, you will need a laser dust detection sensor such as the SDS011.

Alternatives to the BME280 for ESPHome projects

Were the BME280 to be sold out in your local hardware store, you might want to consider the following options. This selection includes further digital sensors with a relatively high accuracy, from well-known manufacturers, such as Sensirion.

Sensirion STS3X and SHTCX

Sensirion has a reputation for making very reliable and accurate sensors. The only reason these weren't considered as the best replacement for the DHT11 and DHT22 is the fact that they aren't used as frequently, and thus you will find fewer examples of projects using them online. You will also find these sensors available at fewer stores.

The Sensirion STS3X line of sensors will only measure the temperature, so I'd definitely recommend the Sensirion SHTC3 (the newest sensor in the SHTC line) over them.

HDC1080 temperature and humidity sensor

The HDC1080 is another accurate I2C digital humidity sensor. The humidity output has a typical accuracy of ±4% and the temperature output has a typical accuracy of ±0.2 °C. As with the Sensirion sensors, the HDC1080 might be hard to come by, though for a different reason. Adafruit, the popular manufacturer of breakout boards, isn't making them any more.

MCP9808 temperature sensor

Another cheap and accurate alternative to the BME280 is the MCP9808 temperature and humidity sensor. The MCP9808 has an impressive accuracy of ±0.25 °C and resolution of 0.0625 °C, and as with the other recommendations in this article, is an I2C digital temperature sensor. As the title suggests, the MCP9808 sensor can only measure the temperature and not the humidity.

A portrait photo oif Liam Alexander Colman, the author, creator, and owner of Home Assistant Guide wearing a suit.

About Liam Alexander Colman

is an experienced Home Assistant user who has been utilizing the platform for a variety of projects over an extended period. His journey began with a Raspberry Pi, which quickly grew to three Raspberry Pis and eventually a full-fledged server. Liam's current operating system of choice is Unraid, with Home Assistant comfortably running in a Docker container.
With a deep understanding of the intricacies of Home Assistant, Liam has an impressive setup, consisting of various Zigbee devices, and seamless integrations with existing products such as his Android TV box. For those interested in learning more about Liam's experience with Home Assistant, he shares his insights on how he first started using the platform and his subsequent journey.


  1. Thanks for your overview, however I can’t agree what you say about DHT22 vs. BME280. You say they cost roughly the same, but at Amazon in germany I get a box of 5 DHT22 for the price of one BME280…

    • AliExpress my friend 😉

      Here in Switzerland, it’s the only option for many of the parts I use. I can’t claim to have had a bad experience yet. Judging by the rating of many BME280 on Amazon, they are actually BMP280s being falsely advertised.


Leave a comment

Share to...