Objective:
To measure the amount of temperature and moisture content present in the atmosphere
Components Required
- Arduino Uno
- Temperature & Moisture Sensor (DHT-11)
Connection Diagram
Program
#include <DHT.h>
#define DHTtype DHT11
DHT dht(DHTpin, DHTtype);
uint8_t temperature, humid, DHTpin=5;
void setup()
{
Serial.begin(9600);
pinMode(DHTpin,INPUT);
dht.begin();
lcd.begin();
}
void loop()
{
temperature = dht.readTemperature();
humid= dht.readHumidity();
Serial.print(“Temperature Value is :”);
Serial.print(temperature);
Serial.print(“Humidity Value is :”);
Serial.print(humid);
Serial.println(“ppm”);
}
Working
The Temperature sensor is nothing but a thermistor whose resistance changes in accordance with the temperature. The change in resistance varies the amount of current flow through it and there by the voltage also.
Output
Room Temperature : 28 C
Moisture Content : 30 ppm
Note : Install DHT11.h Library