Sign inSign up

zachstence/zero-weather

By zachstence

Updated about 4 years ago

DIY a simple weather station using a Raspberry Pi Zero W and a DHT22 temperature/humidity sensor.

Image
0

10K+

zachstence/zero-weather repository overview

zero-weather

https://github.com/zachstence/zero-weather

DIY a simple weather station using a Raspberry Pi Zero W and a DHT22 temperature/humidity sensor.

license mit
docker pulls docker size
wakatime

Table of Contents

Usage

All methods require a configuration file.

Run using 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
Run using Docker
docker run \
    --device /dev/gpiomem:/dev/gpiomem
    -v /path/to/config.json:/app/config/production.json:ro \
    zachstence/zero-weather
Run using docker-compose
version: "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

Config

Create a config file following the format in config/default.json

{
    "sensor": {
        "type": 22,
        "pin": 14,
        "interval": 30
    },
    "influxdb": {
        "org": "",
        "bucket": "",
        "token": ""
    }
}
ConfigDescriptionExample
sensor.typeWhether your connected sensor is a DHT11 or DHT22 sensor11 or 22
sensor.pinThe GPIO pin that your DHT sensor is connected to14
sensor.intervalThe interval in seconds that the sensor should be polled.130
influxdb.orgThe name of your InfluxDB organizationorg-name
influxdb.bucketThe name of the InfluxDB bucket to store the data inzero-weather
influxdb.tokenAn InfluxDB token with write permissions to the specified bucket9jPxAm8tEZSnRlw8nAsEDWZbvHCYeUetIAUrT_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).

Grafana Dashboard

https://grafana.com/grafana/dashboards/16035

Future Features

  • Accept file for Influx token to enable better security (Docker secrets)

Tag summary

Content type

Image

Digest

Size

137.3 MB

Last updated

about 4 years ago

docker pull zachstence/zero-weather