DIY a simple weather station using a Raspberry Pi Zero W and a DHT22 temperature/humidity sensor.
10K+
https://github.com/zachstence/zero-weather
DIY a simple weather station using a Raspberry Pi Zero W and a DHT22 temperature/humidity sensor.
All methods require a configuration file.
npm# Clone the repository
git clone https://github.com/zachstence/zero-weather.git && cd zero-weather
# Add your config
nano config/production.json
# Start the app
npm start
docker run \
--device /dev/gpiomem:/dev/gpiomem
-v /path/to/config.json:/app/config/production.json:ro \
zachstence/zero-weather
docker-composeversion: "3.8"
services:
zero-weather:
image: zachstence/zero-weather
devices:
- /dev/gpiomem:/dev/gpiomem
volumes:
- /home/zach/config.json:/app/config/production.json:ro
restart: unless-stopped
Create a config file following the format in config/default.json
{
"sensor": {
"type": 22,
"pin": 14,
"interval": 30
},
"influxdb": {
"org": "",
"bucket": "",
"token": ""
}
}
| Config | Description | Example |
|---|---|---|
sensor.type | Whether your connected sensor is a DHT11 or DHT22 sensor | 11 or 22 |
sensor.pin | The GPIO pin that your DHT sensor is connected to | 14 |
sensor.interval | The interval in seconds that the sensor should be polled.1 | 30 |
influxdb.org | The name of your InfluxDB organization | org-name |
influxdb.bucket | The name of the InfluxDB bucket to store the data in | zero-weather |
influxdb.token | An InfluxDB token with write permissions to the specified bucket | 9jPxAm8tEZSnRlw8nAsEDWZbvHCYeUetIAUrT_vj6RdHfG43RF5UKfazyZ1Z9dYu1o7prU7-kC4X8oUP-PSxTg== |
1 The DHT11 can be polled at most once every second (1Hz, sensor.interval=1). The DHT22 can be polled at most once every half-second (0.5Hz, sensor.interval=0.5).
https://grafana.com/grafana/dashboards/16035
Content type
Image
Digest
Size
137.3 MB
Last updated
about 4 years ago
docker pull zachstence/zero-weather