Electronics

DHT21 AM2301 Temperature & Humidity Sensor for Arduino

Out Of Stock

1

Description

The DHT-21 is a low-cost humidity and temperature measurement device. DHT sensors are comprised of two components: a capacitive humidity sensor and a thermistor. A 3 to 5V power supply is required for the gadget. It communicates with Arduino through a single data connection. It updates slowly and should only be sampled every 2 seconds.

Package Includes:

  • 1 x DHT21/AM2301 Temperature And Humidity Sensor. 

Features:

  • Ultra-low-power.
  • No additional components.
  • Excellent long-term stability.
  • All calibration, and digital output.
  • Completely interchangeable.
  • Relative humidity and temperature measurement.

Description:

AM2301 capacitive humidity detecting digital temperature and humidity module comprise the temperature and humidity sensor's calibrated digital signal output. The use of a dedicated digital module collection technology as well as temperature and humidity sensor technology ensures the product's high dependability and long-term stability. The sensor is made up of capacitive sensor wet components and high-precision temperature measuring devices that are linked to a powerful 8-bit microprocessor. The humidity calibration chamber calibration sensor is exceptionally accurate. The calibration coefficients are called in the form of procedures, the calibration coefficients stored in the microcontroller, the sensor inside the processing of the heartbeat. Applications, including the most demanding, use a standard single-bus interface. Products for the convenience of 3-lead (single-bus interface) connections.

Principle of Work:

Microprocessor and AM2301 connection typical application circuit, Single bus communication mode, pull the SDA microprocessor I / O port is connected.
Special instructions of single-bus communication:
1. Typical application circuit recommended in the short cable length of 30 meters on the 5.1K
pull-up resistor pullup resistor according to the actual situation of lower than 30 m.
2. With a 3.3V supply voltage, cable length shall not be greater than 100cm. Otherwise, the line
the voltage drop will lead to the sensor power supply, resulting in measurement error.
3. Read the sensor minimum time interval for the 2S; read interval is less than 2S, may cause the
temperature and humidity are not allowed or communication is unsuccessful, etc.
4. Temperature and humidity values are each read out the results of the last measurement For
real-time data that need continuous reading twice, we recommend repeatedly reading sensors and each read sensor interval is greater than 2 seconds to obtain accurate data.
AM2301 device uses a simplified single-bus communication. The single bus that only one data line, the data exchange system, controlled by the data line to complete. Equipment (microprocessor) through an open-drain or tri-state port connected to the data line to allow the device not send data to release the bus, while other devices use the bus; single bus usually requires an external about 5.1kΩ pull-up resistor, so when the bus is idle, its status is high. Because they are the master-slave structure, only the host calls the
sensor, the sensor will answer, so the hosts to access the sensor must strictly follow the sequence of single bus, if there is a sequence of confusion, the sensor will not respond to the host.

Pinout of the Board:

5V(Red)
Power supply 3.5V to 5.5V
Data (Yellow)
Outputs both Temperature and Humidity through serial Data
GND (Black)
Connected to the ground of the circuit


Note
: The sensor will burn down if you connect VCC and GND in the wrong Wiring. 


Applications:

  • IoT Environmental Monitoring: An environmental monitoring process is a system that monitors or controls the quality of the environment. One can also develop an IoT temperature monitoring system using a temperature sensor. Hence, this system also employs humidity and temperature sensors like DHT21/AM2301 for highly accurate readings.
  • The Weather Station: Due to the reasonable cost of this temperature sensor, we can use this in practical weather station projects that can depict the environmental temperature and humidity which may help in various industries.

 

Circuit:

The circuit for this sensor is pretty straightforward and doesn’t require any complex parts or wiring.

  • Red cable to Arduino 3.3V or 5V pin 
  • Black cable to Arduino GND pin 
  • Yellow cable to Arduino 2 digital pin

 

Library: 

You need to install the below DHT21 library. Just download the below library and open Arduino IDE. Now go to Sketch > Include Library > Add .Zip Library.

DHT Library

. Once it’s done, you can use the code below.

Code:

#include "dht.h"
dht DHT;
//Constants
#define DHT21_PIN 2     // DHT 22  (AM2302) - what pin we're connected to

//Variables
float hum;  //Stores humidity value
float temp; //Stores temperature value

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

void loop()
{
    int chk = DHT.read21(DHT21_PIN);
    //Read data and store it to variables hum and temp
    hum = DHT.humidity;
    temp= DHT.temperature;
    //Print temp and humidity values to serial monitor
    Serial.print("Humidity: ");
    Serial.print(hum);
    Serial.print(" %, Temp: ");
    Serial.print(temp);
    Serial.println(" Celsius");
    delay(2000); //Delay 2 sec.
}

 

Technical Details:

  • Model: AM2301.
  • Supply voltage: 3.3 ~ 5.2 V DC.
  • Signal output form: Digital signal output.
  • Temperature measurement range: -40 ~ +80 ºC.
  • Temperature measurement precision: ± 0.5ºC.
  • Humidity range: 10%~90%RH.
  • Humidity measurement precision: ±3%RH.
  • 59 x 27 x 13mm

Resources:

Tutorial1

Datasheet

 

Comparisons:

The DHT21 sensor is the replacement for the DHT11 and DHT22 modules, and it is available as a sensor or a module. The sensor's performance is the same in either case. The Sensor will have 4 pins. The only difference between the sensor and the module is that the module includes a filtering capacitor and a pull-up resistor, whereas the sensor requires you to use them externally if necessary. The module is slightly more expensive than the DHT11, but it has a larger measuring range and superior precision. if you want to use the more basic sensor in your beginner project or something easy to code we recommend starting with LM35.