Low costs temperature & humidity sensors

The first thing you usually start when you implement environment measurements is temperature and humidity. These are not only important for the personal comfort, but also easy to measure. Most people use DHT sensors for this. They are cheap and easy to connect to an Arduino, ESP8266 or Raspberry Pi. There are also tons of software snippets and libraries around, which makes integration very easy. How do they differ? Are there alternatives?


This sensor is the smallest of the 3 DHT versions. It has a blue color and it is the smallest of the 3. It is also the cheapest. Humidity and temperature resolutions is only full degree/%.
It can be directly soldered onto a PCB or simply plugged into a breadboard, which makes it great for initial prototypes.


This one looks similar to the DHT11, but is larger and white. Its resolution is 0.1°/0.1%. It also can be directly soldered onto a PCB or plugged into a breadboard.

AM2301 (DHT21)

This is the largest version. It comes with cables. This makes solder-free prototyping a bit challenging, but if you already have soldering equipment, this shouldn’t be an issue. The bulky design and cables makes it a good choice for bigger designs. It is especially useful if your circuit uses a lot of energy and heats up its environment.


How accurate are these sensors? As the DHT11 has only 1°/1% resolution, you might expect a lower accuracy. However, don’t mistake resolution for accuracy. We could also read the data sheets. However, I recommend checking out Robert’s page. He did a lot of measurements and found out that the DHT11’s performance is similar to the DHT22.
However, I would still recommend the AM2301 or DHT22 for another reason. While the absolute accuracy might not be perfect, the increases resolution still is helpful. There isn’t a lot of visible noise on the measurement. This helps you to understand trends a bit better. Especially in modern buildings, temperature changes very slowly. Even if you turn off the heating, it might take hours until the temperature is down by a single degree. With a 0.1% temperature resolution you see these trends much better than with 1%.

Have a look at these measurements:
It is easy to see there there is a slight downward trend in the 0.1% sensor data (green line), but it is hard to figure out if there is any trend in the 1% sensor data (orange line).


I’ve read some remarks on the internet about defective sensors. For a long time I never had issues, but when I moved a prototype on a breadboard to another room, the measurements looked like this:
Screenshot 2016-08-01 09.58.35
This is clearly not correct. The new measurements show so much noise that they are basically useless. It seems that the sensor had been damaged somehow. I’m not sure, if the reason was ESD or anything else happened.


I would not recommend the DHT11 for any real-world measurements in home automation as the 1°/1% resolution is problematic. Depending on your use case, choose between the DHT21 and DHT22. Make sure you mount the sensor away from any part that dissipates heat. Otherwise your measurements will be completely wrong!

Teardown: Mi Thermometer/humidity sensor

Many people know Xiaomi for their smartphones. They are becoming more and more popular also in Europe. However, in their home market in China they sell also smarthome components. As many of these systems they use a central hub that connects to and controls sensors and actuators. One sensor that I personally found very interesting is the Mi temperature/humidity sensor. With it’s diameter of only 36mm, you can install it almost everywhere.

One thing, you will notice is that the build quality is very good. The case is plastics, but still feels very well made.

Is this sensor locked to the Xiaomi smart hub or can you use it also in DIY environments? Let’s open it and see how it works.


The device is powered by a small CR2032 cell. Let’s hope this one lasts at least a year. But let’s check the main board which will tell us more about how this thing works:


It also looks very well-designed and assembled. The main processor is a JN5169 from NXP. It is a Zigbee controller. Do you remember Zigbee? While today most new designs use Bluetooth LE, Zigbee is still there. And it works quite well, so why not use it. The only thing that makes it a bit harder to use is the fact that no PC comes with an integrated Zigbee interface. That means you need to have an additional Zigbee controller connected to your PC, Raspberry Pi or Arduino to read data from this sensor. Is it easy to integrate? We don’t know yet, but we will look into this in the future.