Skip to content

A Python class designed for reading data from a DHT11/DHT22 sensor via GPIO, providing humidity and temperature values.

License

Notifications You must be signed in to change notification settings

gabormojzes/raspberrypi-dht-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi DHT11/DHT22 Reader

This project has been tested on a Raspberry Pi 5, with both Ubuntu Server version 23.10 (64-bit) and Raspberry Pi OS (64-bit) (Debian version: 12) operating systems.

Python version used: 3.11.6
gpiod version used: 2.1.3, available at https://pypi.org/project/gpiod/

How to use

git clone https://github.com/gabormojzes/raspberrypi-dht-reader.git
cd raspberrypi-dht-reader
python3 -m venv venv
source venv/bin/activate

pip install gpiod
python run.py DHT22 /dev/gpiochip4 4 2

Command format

python run.py <dht_type> <chip_path> <line_offset> <sensor_reading_delay>

Sample output

Humidity: 60.1% Temperature: 22.4°C 72.3°F

About

A Python class designed for reading data from a DHT11/DHT22 sensor via GPIO, providing humidity and temperature values.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages