Open-source weather station for astronomy
Python 0.7%
HTML 0.1%
Other 99.2%
2 1 0

Clone this repository

https://tangled.org/astroaure.bsky.social/AstroWeatherStation
git@tangled.org:astroaure.bsky.social/AstroWeatherStation

For self-hosted knots, clone URLs may differ based on your setup.

README.md

AstroWeatherStation#

AstroWeatherStation is an open-source weather station that aims at providing a low-cost (~100€) alternative to commercial ones. It also offers full flexibility to how your data are stored and accessed, as well as the possibility to add whatever sensor you want.

To leave a telescope outside permanently (under a dome, or with a waterproof telescope), one needs a weather station to observe the environmental conditions. This allows the telescope to be put in a safe mode if they are dangerous (e.g. rain or dew), or simply to know if observation is possible (absence of clouds).

Annotated picture of AstroWeatherStation. It is a white box with multiple sensors (rain, luminosity, temperature&humidity and thermal camera) and a USB-C power port.

Features#

AstroWeatherStation hosts multiple different sensors:

  • DHT22: Temperature and humidity sensor
  • MH-RD: Rain sensor
  • MLX90640 110deg: IR Thermal camera (for cloud detection)
  • TSL2591: Luminosity sensor (for start/end of observation at dawn/dusk and darkness of night measurement)

It uses the Grove ecosystem to easily connect sensors without any soldering. Sensors that don't use this ecosystem (like the TSL2591 and the MH-RD sensors) can still be connected by using the appropriate adapter cables. AstroWeatherStation uses an ESP32 controller with the Grove Shield and the Grove I2C hub which provides plenty of ports to connect sensors (digital, analog, I2C, UART).

Hardware#

Component Quantity Price Description
XIAO ESP32-C6 board 1 5.30€ Controller
Grove Shield 1 3.90€ Shield for the ESP32 board
Grove I2C Hub 1 1.50€ Additional I2C ports
DHT22 sensor 1 7.00€ Temperature & humidity sensor
MLX90640 110deg 1 43.00€ IR Thermal camera
MH-RD sensor 1 1.90€ Rain sensor
TSL2591 sensor 1 7.50€ Luminosity sensor
CHD7310WH enclosure 1 25.40€ Waterproof enclosure
Grove cable 3 1.70€ Sensor connection
Grove-Jumper cable 1 3.00€ MH-RD sensor connection
Grove-Qwiic cable 1 2.00€ TSL2591 sensor connection
USB-C cable 1 2.80€ Power cable
Stevenson screen 4 3D printed Rain-proof ventilation for inside sensors
MLX90640 support 1 3D printed Support for the MLX90640 thermal camera
TSL2591 support 1 3D printed Support for the TSL2591 sensor
Base plate 1 Laser cut Base plate to hold the electronics

Code#

ESP32#

The weather station is controlled by an ESP32 board (XIAO ESP32-C6 model). The code, written in MicroPython, for it can be found in this folder. It hosts:

RaspberryPi#

The weather station publishes its sensor values to an HTML page on the WiFi network to which it is connected. The log_astroweatherstation.py program recovers the sensor values from this page and sends them to an InfluxDB database to store them. From there, they can be plotted in Grafana for example. This code also saves the IR thermal camera data as an image and in a log file for post-processing.

  • To install InfluxDB and Grafana on a RaspberryPi, follow this tutorial.

  • To run the logging code on your RaspberryPi every minute to log the weather station data, you can use the crontab -e command and add the following line, where <PATH-TO-FILE> should be changed with the absolute path to the Python file:

    */1 * * * * /usr/bin/python3 <PATH-TO-FILE>/log_astroweatherstation.py &
    

References#