Arduino – DHT11 Temperature Humidity Sensor
The DHT11 Temperature and Humidity Sensor is a relatively inexpensive sensor that is easy to use
Download the Required Drivers
Sketch to Read DHT11 Sensor
and send results to the serial monitor
#include <dht.h> //include DHT11 library int temp_humid_pin = A0; //define pin used for DHT11 reading dht sensor; //define variable to reference sensor void setup() { } void loop() { delay(9000); //pause before reading sensor sensor.read11(temp_humid_pin); // read sensor Serial.print("Humidity "); Serial.println(sensor.humidity); //print to serial monitor also Serial.print("Temperature "); Serial.println(sensor.temperature); //print to serial monitor also }
Arduino – DHT11 Temperature Humidity Sensor