常用温湿度传感器比较

SensorDHT11DHT22 (AM2302)LM35DS18B20BME280BMP180
MeasuresTemperature
Humidity
Temperature
Humidity
TemperatureTemperatureTemperature
Humidity
Pressure
Temperature
Pressure
Communication
protocol
One-wireOne-wireAnalogOne-wireI2C
SPI
I2C
Supply
voltage
3 to 5.5V DC3 to 6V DC4 to 30 V DC3 to 5.5V DC1.7 to 3.6V (for the chip) 3.3 to 5V for the board1.8 to 3.6V (for the chip) 3.3 to 5V for the board
Temperature
range
0 to 50ºC-40 to 80ºC-55 to 150ºC-55 to 125ºC-40 to 85ºC0 to 65ºC
Accuracy+/- 2ºC (at 0 to 50ºC)+/- 0.5ºC (at -40 to 80ºC)+/-0.5ºC (at 25ºC)+/-0.5ºC (at -10 to 85ºC)+/-0.5ºC (at 25ºC)+/-0.5ºC (at 25ºC)
Support
(Arduino IDE)
Adafruit DHT Library

Adafruit Unified Sensor Library
Adafruit DHT Library

Adafruit Unified Sensor Library
analogRead()DallasTemperature

OneWire
Adafruit BME280 library

Adafruit Unified Sensor Library
Adafruit BME085

Adafruit Unified Sensor Library
Support
(MicroPython)
dht module (included in MicroPython firmware)dht module (included in MicroPython firmware)from machine import ADC
ADC().read
ds18b20 module (included in MicroPython firmware)BME280 Adafruit LibraryBMP180 module