Overview

The DHT11 is a widely available, low-cost sensor that measures temperature and relative humidity. In biodiversity monitoring, these two variables are among the most important drivers of species activity — influencing when insects emerge, when amphibians vocalise, and how quickly vegetation responds to seasonal change.

sensor-dht11 is a lightweight C implementation that reads DHT11 sensors via GPIO on the Raspberry Pi. It uses real-time scheduling (SCHED_FIFO) for reliable bit-banging and outputs JSON compatible with the WildlifeSystems sensor-control framework.

Measurements

Installation

Via the WildlifeSystems APT repository:

sudo apt update sudo apt install sensor-dht11

Or build from source:

make sudo make install

Usage

sensor-dht11 # read all sensors sensor-dht11 temperature # temperature only sensor-dht11 humidity # humidity only sensor-dht11 internal # internal sensors only sensor-dht11 external # external sensors only

Configuration

Configure sensors in /etc/ws/sensors/dht11.json:

[ { "pin": 4, "internal": false } ]

Example Output

[ {"sensor":"dht11_temperature","measures":"temperature","unit":"Celsius","value":23.0,"internal":false}, {"sensor":"dht11_humidity","measures":"humidity","unit":"percentage","value":45.0,"internal":false} ]

Source Code

sensor-dht11 on GitHub →