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.
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:
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!