Introduction: Temperature and Humidity Sensor(dht11) Interface With Arduino
Temperature sensor have wide range of application it’s used at many place some place it’s work as feedback system. There is multiple types of temperature sensor are available in the market with different specifications some temperature sensor used laser technique to measuring temperature this type of temperature sensor read the temperature sensor from far away but in this tutorial we will use only dht11 sensor to measure surrounding temperatures and humidity.
Step 1: Components Required:
- Arduino Uno
- dht11 sensor
Step 2: Connections:
Arduino Pin A0 ------->dht11 data pin
dht11 sensor: dht11 are used to measure surrounding temperature and humidity.Sensor Comes into 4 Pin package out of which only three pins will be used.
1.Operating Voltage :3.3v to 5v
2.Operating Current: 0.3mA
3.Temperature range: 0°C to 50°C
4.Humidity Range: 20% to 90%
Step 3: Source Code:
Use following link to download library of dht11 : https://www.arduinolibraries.info/libraries/dht-se...
click here to get the code
Serial.print("current humidity = ");
Serial.print("current temperature = ");
dht.h is the library that provides extra functions to minimize the line of code and makes the code simple and easy to understand.
pinMode(A0,OUTPUT) pinMode function are used to set direction of the pin whether INPUT or OUTPUT.
Serial.begin(9600) Serial.begin is function it's allow the communication between Arduino and Computer and 9600 is the baud rate that means speed of data transferring between Arduino and Computer in a second 9600 bits data can transferred.
DHT.read11(A0) read11 function used to read data from Sensor.
Serial.print(DHT.humidity) DHT.humidity function used to read humidity and that data will be send to Computer.
Serial.print(DHT.temperature) DHT.temperature function used to read temperature and that data will be send to Computer.
Step 4: Applications:
1.Local weather station.
2.Humidity and Temperature Measurement