Datasheet

DHT CircuitPython Code
Adafruit CircuitPython Module Install
To use the DHT sensor with your Adafruit CircuitPython board you'll need to install
the Adafruit_CircuitPython_DHT (https://adafru.it/Beq) module on your board.
First make sure you are running the latest version of Adafruit CircuitPython (https://adafru.it/Amd) for your board. In
particular for Gemma M0, Trinket M0, and M0 basic boards you must be running CircuitPython 2.1.0 or higher to have
access to the necessary pulseio module!
Next you'll need to install the necessary libraries to use the hardware--carefully follow the steps to find and install these
libraries from Adafruit's CircuitPython library bundle (https://adafru.it/zdx). Our introduction guide has a great page on
how to install the library bundle (https://adafru.it/ABU) for both express and non-express boards.
Remember for non-express boards like the, you'll need to manually install the necessary libraries from the bundle:
adafruit_dht.mpy
You can also download the adafruit_dht.mpy from its releases page on Github (https://adafru.it/Ber).
Before continuing make sure your board's lib folder or root filesystem has the adafruit_dht.mpy module copied over.
Wiring
DHT wiring is very simple:
The left-most pin is power. We recommend powering from 5V (sometimes 3V is not enough) - this is OK even if
you are using 3.3V logic
The second pin is data. Connect a 10K pullup resistor from this pin to 3.3V. If you are using a DHT11 it's required.
If you're using a DHT22 or AM2302 you can sometimes leave this off
Skip the third pin
The right-most pin is ground
For the DATA pin you must pick a pin that has PWM support (pulseio) - Check the board's guide for what pins
have timers available
© Adafruit Industries https://learn.adafruit.com/adafruit-gemma-m0 Page 133 of 186