The Difference Between DS18B20 and DHT11/DHT22 Sensors

Byamber

The Difference Between DS18B20 and DHT11/DHT22 Sensors


DS18B20 Temperature sensor

Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES ここでご購入を!

Single wire, also known as 1-Wire bus, is a peripheral serial expansion bus introduced by the American company Dallas.

I2C bus is a simple, bidirectional, two-wire synchronous serial bus developed by Philips. It only requires two wires to transmit information between devices connected to the bus.

In microcontrollers, SPI, I2C, and single wire (1-Wire) are types of buses.

What is a bus?

A bus is a common connection line for a computer, through which all peripheral devices can be connected to the computer. It serves as a channel for information transmission and can accommodate multiple peripheral components.

There are many types of buses, such as chip-level buses like SPI, I2C, and single wire (1-Wire), which facilitate connections between CPUs and other peripheral chips over short distances. They often transmit data in serial mode, meaning data is transmitted bit by bit, which helps in saving the number of transmission lines.

SPI: Requires 3 lines – one clock line, one data receive line, and one data transmit line.
I2C: Requires 2 lines – one clock line and one data line.
Single wire: Uses a single data line for communication, as seen in DS18B20 digital temperature sensors.
Additionally, there are communication standards like RS-232 for computer-to-computer or microcontroller data communication, as well as industrial field buses like RS-485 and CAN for long-distance communication, with distances reaching up to 1000 meters.

The Difference Between DS18B20 and DHT11/DHT22 Sensors

Principle: The DS18B20 utilizes a digital temperature sensor, employing a single-wire interface to acquire temperature values by measuring the resistance associated with temperature inside the sensor. Conversely, the DHT11/DHT22 is a digital temperature and humidity sensor capable of simultaneously measuring temperature and humidity, and outputting data through a single-wire interface.

Output Format: The DS18B20 sensor outputs temperature values in digital format, facilitating direct retrieval of specific temperature values. Meanwhile, the DHT11/DHT22 sensor outputs temperature and humidity values in digital format, necessitating data packet parsing to derive specific temperature and humidity values.

  1. Communication Protocol: Both DS18B20 and DHT11/DHT22 employ a single-wire communication protocol.
  2. Measurement Range: The DS18B20 has a measurement range of -55°C to +125°C with an accuracy of ±0.5°C; the DHT11 has a measurement range of 0-50°C with an accuracy of ±2°C, and the DHT22 has a measurement range of -40°C to 80°C with an accuracy of ±0.5°C.
  3. Accuracy Error: The temperature accuracy of the DS18B20 can reach ±0.5°C; the temperature accuracy of the DHT11 is ±2°C, with humidity accuracy of ±5%RH; the temperature accuracy of the DHT22 is ±0.5°C, with humidity accuracy of ±2%RH.
  4. Supply Voltage: The supply voltage for DS18B20 ranges from 3V to 5.5V, while for DHT11/DHT22, it ranges from 3.3V to 5V.
  5. Package Form: The DS18B20 generally employs TO-92 or stainless steel tube packaging, whereas the DHT11/DHT22 typically utilizes 4-pin DIP or 3-pin SMD packaging.
  6. Product Size: The DS18B20 dimensions are 3mm x 5mm or 4520 mm, while the DHT11/DHT22 is larger with dimensions of 12mm x 15.5mm x 5.5mm.

In conclusion, the choice of sensor depends on the specific application scenario. If lower temperature measurement or higher measurement accuracy is required, then DS18B20 is more suitable. For simple single-wire communication and a measurement range between 0-50°C, DHT11 is preferable. If more precise measurement is needed, within a temperature range of -40°C to 80°C, DHT22 can be chosen.

Comparison Between DHT11 and DS18B20

Advantages of DHT11:

  1. Cost-effective and relatively inexpensive.
  2. Offers higher accuracy.
  3. Comes with complete module packaging, making it easy to use.

Disadvantages of DHT11:

  1. Slower reading speed, with a 2-second cycle requiring a waiting period during reading.
  2. Limited to analog readings only, lacking support for digital signal output.
  3. Poor model stability, susceptible to interference.

Advantages of DS18B20:

  1. Provides digital signal output, ensuring high precision.
  2. Compact size facilitates easy installation.
  3. Offers excellent signal stability, less prone to interference.

Disadvantages of DS18B20:

  1. Relatively higher price compared to DHT11.
  2. Slower reading speed, requiring some time to complete readings.
  3. Module packaging is not as comprehensive, necessitating the use of external circuits for operation.

About the Author

amber administrator

You must be logged in to post a comment