Temperature + humidity DHT22 with TinkerPie
The white, more accurate sibling of the DHT11.
| Type | Timing sensors |
|---|---|
| Connect to | any accessory pin |
| Gives | °C and % RH, more precise |
| Simulator | Use it on the real board |
How it works
The DHT22 (also called AM2302) works like the DHT11 but with better sensing parts, so it covers a wider range with more accuracy. It uses the same one-wire timing signal.
How to wire it
One or two signal pins on S1-S4 or P10-P13. Studio reads them with precise timing in the board firmware.
Code
In blocks: Accessories category in TinkerPie Studio. As code:
// JavaScript
sensors.dhtTemperature(Pin.S1, DhtType.DHT22)
// Arduino C++
sensors::dhtTemperature(Pin::S1, DhtType::DHT22) Good to know
- Range about -40 to 80 °C (±0.5 °C) and 0-100 % humidity (±2-5 %).
- Read it at most once every 2 seconds.
- Choose it for outdoor or more accurate weather projects.
Similar modules
Questions
Can I try the Temperature + humidity DHT22 without buying one?
You can write and check the program in TinkerPie Studio first; to see it work you need the real module connected to the board.
Can I swap a DHT11 for a DHT22 in my project?
Yes. Choose the DHT22 type in the blocks or code and read it a little more slowly (every 2 seconds).