DHT21 AM2301 Temperature & Humidity Sensor (HCSENS0026)
The DHT21 digital temperature sensor is one of the commonest from the range of DHT temperature sensors and boasts a relatively high temperature measurement accuracy of 0.5oC in 0.1oC steps with a relative humidity accuracy of +/- 3%. It has only 3 wires, including power and ground, meaning only one digital pin is required to interface it to a microcontroller. For Arduino development platforms the sensor is very well supported by the DHT library available from the Arduino Playground website.Specification:
Product Code: HCSENS0026
Power supply: 3.3-5V DC
Output signal: digital signal via single-bus
Sensing element: Polymer humidity capacitor
Measuring range: humidity 0-100%RH; temperature -40~80Celsius
Accuracy: humidity +-3%RH(Max +-5%RH); temperature <+-1Celsius
Resolution or sensitivity: humidity 0.1%RH; temperature 0.1Celsius
Repeatability: humidity +-1%RH; temperature +-0.2Celsius
Humidity hysteresis: +-0.3%RH
Long-term Stability: +-0.5%RH/year
Sensing period: Average: 2s
Dimensions size 59*27*13.5mmExample Arduino Sketch:
/* FILE: DHT21_Example
AUTHOR: Andrew Davies
This example sketch uses the DHT library available from the Arduino playground here:
Simply connect your DHT21 sensor to the Arduino digital pin 5, upload this sketch
and then open a the serial monitor window with a BAUD rate of 9600.
You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used directly for the purpose of selling products that
directly compete with Hobby Components Ltd's own range of products.
THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
#define DATA_PIN 5 // Digital pin connected the DHT21 data pin.
/* Take a reading from the sensor */
int State = DHT21.read21(DATA_PIN);
/* If reading was successful then output the results to the serial port */
if(State == DHTLIB_OK)
/* Wait a second before looping back */
Datasheet:Disclaimer: Libraries, example code, and diagrams are provided as an additional free service by Hobby Components and are not sold as part of this product. We do not provide any guarantees or warranties as to their accuracy or fitness for purpose.
Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.