DHT22 Temperature and Humidity Sensor on the RevPi

Topics about the Software of Revolution Pi
Post Reply
Posts: 6
Joined: 19 Jun 2024, 11:01

DHT22 Temperature and Humidity Sensor on the RevPi

Post by jfelgueiras »


I am learning how to use the Revolution Pi hardware.

I currently have a RevPi Core SE, connected to a DIO and an AIO modules.

I am trying to find out how to connect it and have it communicate to a DHT22 temperature and humidity sensor:

So far, the closest thing I've found are these tutorials:

An example code in python is provided at:
https://github.com/adafruit/Adafruit_Ci ... pletest.py

It instantiates a class adafruit_dht.DHT22, which requires one of the Raspberry Pi's GPIO pins to be provided, using the "board" library.

Excerpt from the example code:

Code: Select all

import time
import board
import adafruit_dht

# Initial the dht device, with data pin connected to:
dhtDevice = adafruit_dht.DHT22(board.D18)

# you can pass DHT22 use_pulseio=False if you wouldn't like to use pulseio.
# This may be necessary on a Linux single board computer like the Raspberry Pi,
# but it will not work in CircuitPython.
# dhtDevice = adafruit_dht.DHT22(board.D18, use_pulseio=False)
So, at this stage, I'm wondering if it is possible to use the DHT22 at all with the Rev Pi. Can one of the pins in the DIO module be accessed or instantiated in such a way that is compatible with the python libraries (specifically, the board library)?

The DHT22 operates on a supply voltage of 3.3 to 5 V. Can the DIO module read digital signals below the minimum rated voltage of 12 V?

Any clarifications or insights on how to use this kind of sensor would be appreciated.
User avatar
Posts: 2047
Joined: 15 Dec 2016, 13:19

Re: DHT22 Temperature and Humidity Sensor on the RevPi

Post by dirk »

Hi jfelgueiras, welcome to the Revolution Pi community! Thanks for your good description of your plan with the steps and references to the things you've investigated so far and the unanswered questions that result, that's wonderful.

This is precisely where the revolutionary lies in the Revolution Pi - process image instead of GPIO pins.

Have a look at the following tutorial created with attention to detail, then it will become clear how you can access the I/Os of your RevPi hardware with Python:
Revolution Pi Python Introduction

The DIO module does not support TTL levels but 24V.

You can check the specifications of your sensor using the technical data sheets. Analog inputs are supported by the RevPi MIO and RevPi AIO modules.

There is also a helpful tutorial here for you
Measuring analog data with the RevPi AIO module
Posts: 6
Joined: 19 Jun 2024, 11:01

Re: DHT22 Temperature and Humidity Sensor on the RevPi

Post by jfelgueiras »

Thank you, Dirk, for your reply,

Having looked at the alternatives I had available for the RevPi Core, the best solution I found was to resort to the USB ports as they provide a lot of flexibility.

The Adafruit SHT45 Trinkey (https://www.adafruit.com/product/5896) so far seems to be the best alternative for my project, as it is small, sufficiently accurate and very cost effetive.

Other alternatives for DIY sensors could involve using a USB to RS485 converter or a USB to single-wire protocol converter, but the added cost of having a converter plus the sensor with the appropriate protocol does not seem to justify it unless there are no better alternatives.

Leaving this information here in case someone with the same questions as I had comes by this post.
Post Reply