RHT03 (DHT22) Humidity and Temperature Sensor Hookup Guide

Pages
Contributors: bboyho
Favorited Favorite 4

Introduction

Measure relative humidity and temperature with the RHT03 (a.k.a DHT22) low cost sensor on a single wire digital interface connected to an Arduino!

Humidity and Temperature Sensor - RHT03

SEN-10167
33 Retired

Required Materials

To follow along with this tutorial, you will need the following materials. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary.

Suggested Reading

If you aren’t familiar with the following concepts, we recommend checking out these tutorials before continuing.

Installing an Arduino Library

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

What is an Arduino?

What is this 'Arduino' thing anyway? This tutorials dives into what an Arduino is and along with Arduino projects and widgets.

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

How to Install FTDI Drivers

How to install drivers for the FTDI Basic on Windows, Mac OS X, and Linux.

Hardware Overview

Pinout

The pins of the RHT03 (DHT22) are labeled in the image below.

Annotated RHT03

Pin RHT03 (DHT22) Notes
1 VCC Input Voltage between 3.3-6V DC
2 DAT Data Output
3 N/C Not Connected
4 GND Ground

Hardware Hookup

Connect the RHT03 to your Arduino as shown below. Since we are using a 5V Arduino, we will be using 5V to power the sensor. If you are using a 3.3V Arduino, you will need to connect it to a 3.3V pin for your respective development board.

Fritzing Diagram of Circuit

Library Installation

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide.

We’ve written an Arduino library to make reading the RHT03 a breeze. You will need to manually install the RHT03 Arduino library from the GitHub repository by downloading a *.zip. Once downloaded, click Sketch > Include Library > Add .ZIP Library... to have the Arduino IDE unzip the library into it's respective folder.

Arduino Example

After installing the library, open the example from the Arduino IDE by clicking File > Examples > SparkFun RHT03 Arduino Library > RHT03-Example-Serial. Select the board that you are using (if you are using the RedBoard with the ATmega328P, select Arduino/Genuino Uno) and COM port that the board enumerated on and hit upload.

Arduino IDE with Upload Button Highlighted

Open the serial monitor at 9600 baud to view the output. You should see the relative humidity and temperature in °F and °C. Try blowing some air at the sensor. The sensor should react to the water vapor contained in the exhaled air.

Example Output Relative Humidity and Temeprature

More Examples

Looking for more examples? Check out the following tutorials to read the sensor with other development boards!

ESP8266

If you are using the ESP8266 with the RHT03 (DHT22), try checking out experiment 1 of the Internet of Things Experiment Guide to capture temperature and humidity data from a sensor and post it to our ThingSpeak channel.

ESP8266 Thing Example
ESP8266 Example

Particle Photon

If you are using the Particle Photon with the RHT03 (DHT22), try checking out experiment 6 of the SparkFun Inventor's Kit for Photon Experiment Guide to read the serial data with a photocell.

Particle Photon Example
Particle Photon Example

Resources & Going Further

Now that you've successfully got your RHT03 up and running, it's time to incorporate it into your own project! For more information, check out the resources below:

Looking for more examples that monitor the environment? Check out the following tutorials.

MPL3115A2 Pressure Sensor Hookup Guide

Getting started with the MPL3115A2 Pressure Sensor.

Si7021 Humidity and Temperature Sensor Hookup Guide

The Si7021 humidity and temperature sensor is an easy to use, digital, low-cost sensor to aid you in all your environment sensing needs.

MAX30105 Particle and Pulse Ox Sensor Hookup Guide

The SparkFun MAX30105 Particle Sensor is a flexible and powerful sensor enabling sensing of distance, heart rate, particle detection, even the blinking of an eye. Get ready. Set. Shine!

Spectral Triad (AS7265x) Hookup Guide

Learn how to wield the power of 18 channels of UV to NIR spectroscopy with AS72651 (UV), AS72652 (VIS), and AS72653 (NIR) sensors!