The DHT11 operates on the principles of humidity and temperature sensing, combining these capabilities within a single sensor module. Its humidity sensor employs a moisture-sensitive substrate connected to a capacitor, with changes in humidity affecting the capacitor's charging or discharging time. Meanwhile, the temperature sensor utilizes a thermistor, a resistor with a predictable resistance-temperature relationship.
Integrated on a single chip, the DHT11 employs a proprietary one-wire digital communication protocol to transmit a 40-bit data stream, including both humidity and temperature information. The sensor sends a start signal, followed by the data stream, which is then decoded by external devices like microcontrollers.
Connected to the Arduino's digital pin (e.g., D2), the sensor utilizes the DHT library for simplified communication. In the setup, serial communication is initiated, and the DHT sensor is initialized. The main loop introduces a 2 second delay between readings, during which the sensor obtains humidity and temperature values. These values are then printed to the Serial Monitor for real-time monitoring. This process continues, providing continuous and accessible environmental data and in this case body data.