Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

StatuscolourYellowtitleDRAFT

Table of Contents

Introduction

...

DHT22

NodeMCU DEVKIT 1.0.jpg

NodeMCU

Wiring


The most basic DHT humidity and temperature sensor comes in two variants with different levels of accuracy.


DHT-11DHT-22
Humidity range20%-80%RH (±5%RH)0%-100%RH (±2%RH)
Temperature range0-50°C (±2°C)-40-80°C (±0.5°C)
Measurement time1s per sample2s per sample

Setup

To program the NodeMCU, we are going to use Arduino's IDE. It's the easiest way to get up and running with the DHT22.

First, you'll have to set up your machine (Device Setup Instructions). These instructions take you through installing the IDE, ESP8266 and the required libraries.

In addition to this, you'll have to install DHT sensor library to read the sensor, we are going to use Adafruit's DHT22 library, and Adafruit Unified Sensor Driver

Install Adafruit's DHT22 library using Library Manager:

Image Modified

Next, install Adafruit Unified Sensor Driver

Image Modified

Code / Firmware

...