WEATHER STATION BY DHT11 USING ARDUINO

WEATHER STATION BY DHT11 USING ARDUINO

Today we will learn about to DHT11 sensor module . What is a  DHT11 sensor module?  How does it work? and interface with Arduino uno? Will know everything. And then build your own weather station using DHT11 sensor with arduino.

weather station by dht11 using arduino

I am already some articles published  based on Arduino projects. If you want to make projects. so you go read articles and try it.

What is DHT11 Sensor Module?

dht11 sensor module


DHT11 sensor module is a type of sensor. Which measures the temperature and humidity of the environment in single wire. It has a restive humidity sensor and NTC (Negative Temperature Coefficient) temperature sensor or Thermistor sensor and 8-bit microcontroller chip, that are providing cost effectiveness, anti-interfacing ability, excellent quality and also fast response. There is a 3 pin dht11 sensor and 4 pin dht11 sensor available in the market, so you can buy either of them. These are both same. 3 pin dht11 to 1. GND 2. VCC 3. Signal pin. And the 4 pin sensor has 1. GND 2. VCC 3. Signal pin 4. NC (no connection) pin. When you interface with arduino, only 3 pins of dht11 use GND, VCC and signal pins of dht11 sensor module. 

How does work DHT11 sensor module?

humidity sensor of dht11



8 bit microcontroller ic of dht11

The dht11 sensor model has a restive humidity sensor, and an NTC temperature sensor along with an 8-bit microcontroller. The restive humidity is two electrodes and between the electrodes is moisture holding absorption substrate. When the water vapor starts getting absorbed in the moisture holding substrate, then the starts restive conductivity between the two electrodes of the Humidity sensor. So the resistivity of the substrate starts to decrease. We can say that when the humidity increase, the resistivity of the electrode is dereased. And when the humidity is decreased, the resistivity of the electrode is increased. It means humidity  proportional to between resistivity of electrode. And due to the thermal resistor in the NTC (Negative Temperature Coefficient ) or thermistor sensor, as the temperature changes, so does the thermal resistor change. This means if the thermal resistor of the NTC temperature sensor decreases, then the temperature increases and if the thermal resistor increases, then the temperature decreases. And dht11 sensor being a 8-bit microcontroller, Value of humidity and the thermistor's value convert analog value to digital value and transmit a single output from the signal pin of dht11 sensor module. And signal pin is connected to any digital pin of arduino. And arduino collect the output data from the dht11 sensor and arduino start analyze and processes the data and  show the temperature value and humidity value on LCD module or serial monitor. That's it.

Feature of DHT11 sensor module
  • It has temperature between 0°C to 50°C.
  • It has humidity between 20 to 90 RH.
  • It has accuracy ±2.0°C.
  • It has operating voltage 3.3v to 5v.

Application of DHT11 sensor module

  • Weather Station.
  • Agriculture.
  • Automation etc.

Pin Out of DHT11 sensor module

You can see their pin names in the picture given below.
pin out of dht11



 VCC     -  Provide to 3.3v to 5v.
 GND     -  Provide to ground.   
SIGNAL   - Provide to output data in humidity and temperature.   


Interface DHT11 sensor into Arduino uno

 let's see the connection below.It is very easy to interface the dht 11 sensor with the arduino uno. You can see in the below circuit.
interface of dht11 into arduino


DHt11       -   Arduino Uno
VCC Pin     - 5V
GND Pin    - GND 
DATA Pin   - D2
                           
Here 5v dc voltage is provided from 9v battery to operate arduino and dht 11 sensor. First of all connect the plus (+)terminal of the 9v battery to the Vin (input voltage pin) pin of the arduino. And the 5v pin of the arduino is connected to the vcc pin of the dht 11 sensor. Here 5v dc voltage is provided from 5v pin of arduino, so we have directly connected to vcc pin of dht 11. After that the ground pin (GND pin) of dht 11 has been connected to the ground of arduino and minus (-) terminal of battery all together. Because everyone has a common ground, they are always connected together. Just keeping the dc voltage in mind, the required voltage of a circuit and sensor is connected according to it.Then connect any digital pin of arduino to the data pin of dht11 sensor. So here we connected the data pin of the dht11 sensor to the D2 pin of the arduino.

Code

Firstly open the Arduino IDE then goto >sketch >Include Library> Mange Libraries. Then click on and wait some minute and open the popup of Library manager then you write simpleDHT on search bar  and after few second show library and you install it . 
dht11 installing way



And after you installed library , You have to go file on Arduino IDE File>Examples>SimpleDHT>DHT11Default  and will open the code of dht11.
Code of DHT11


#include <SimpleDHT.h>

// for DHT11, 
//      VCC: 5V or 3V
//      GND: GND
//      DATA: 2

int pinDHT11 = 2;
SimpleDHT11 dht11(pinDHT11);

void setup()
 {
  Serial.begin(115200);
}

void loop() 
{
  // start working...
  Serial.println("=================================");
  Serial.println("Sample DHT11...");
  
  // read without samples.
  byte temperature = 0;
  byte humidity = 0;
  int err = SimpleDHTErrSuccess;
  if ((err = dht11.read(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
    Serial.print("Read DHT11 failed, err="); Serial.println(err);delay(1000);
    return;
  }
  
  Serial.print("Sample OK: ");
  Serial.print((int)temperature); Serial.print(" *C, "); 
  Serial.print((int)humidity); Serial.println(" H");
  
  // DHT11 sampling rate is 1HZ.
  delay(1500);
}

Post a Comment

0 Comments