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
- Temperature — degrees Celsius
- Humidity — relative humidity percentage
Installation
Via the WildlifeSystems APT repository:
sudo apt update
sudo apt install sensor-dht11Or build from source:
make
sudo make installUsage
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 onlyConfiguration
Configure sensors in /etc/ws/sensors/dht11.json:
[
{
"pin": 4,
"internal": false
}
]- pin — GPIO pin number (2–27)
- internal — whether the sensor is inside the enclosure
- sensor_id — optional custom identifier
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}
]