Product Introduction #
DHT11 Temperature and humidity sensor is a sensor based on the digital temperature and humidity sensor DHT11, it is a combination of temperature and humidity sensor, it converts the physical temperature and humidity through the temperature, humidity sensor and the corresponding circuit into a digital quantity that is convenient for data acquisition equipment to read directly.
DHT11 is composed of resistive humidity sensing device and NTC coefficient temperature sensing device, and has the function of calibrating digital signal output. Using a single bus serial interface, the output data a total of 5 bytes, respectively: Humidity integer, humidity digit, temperature integer, temperature digit and checksum, where the checksum is the low 8-bit binary complement of the result of adding each byte of data. If the checksum calculation result does not match the last byte of data sent by DHT11, the data may be wrong and need to be re-obtained.
Application reference: This module can be used for weather station, temperature and humidity regulator, etc.
Parameter Specification #
Parameters | Value/Description |
Operating voltage | 3.3V~5V |
Operating temperature | -20°C~+60°C ±2°C |
Humidity range | 5~95%RH ±5%RH |
Output signal | Digital signal |
Size | 3.16cm*2.38cm |
Wiring Diagram #
Note:Expansion board is attached to esp32 controller board.
DHT11 | ESP32 |
VCC | 5V |
GND | GND |
Sign | Pin 32 |
Sample Code #
#include // Include library
DHT dht2(32, 11);
void setup(){
Serial.begin(115200);
dht2.begin();// Initialize the DHT sensor
}
void loop(){
//Read and print the temperature
Serial.print("Temperature:");
Serial.println(dht2.readTemperature());
//Read and print the humidity
Serial.print("Humidity:");
Serial.println(dht2.readHumidity());
delay(1000);
}
Note: If you are using an Arduino board, then change the pin in the program to PIN7, set the baud rate to 9600, and then connect the hardware pin to PIN7 and upload the program.
Test Result #
After uploading the code to the controller board, open the serial port monitor of the Arduino IDE, set the baud rate to 115200, and switch to scroll mode.
By placing the module in the air, you can see the measured values of temperature and humidity
Note: The module is non-contact, do not put it in water.
Related Resources #
Get One Now #
B2B Business: info@acebott.com
Official Website: ACEBOTT DHT11 Temperature and Humidity Sensor