An Arduino firmware, Raspberry PI application and indi-driver for a device to measure rain and cloud cover for an astronomical observatory. Cloud cover is determined by measuring the difference between ambient temperature and sky temperature.
Outside
Inside
The device offers an HTTP interface to GET current conditions. See below for the full API
Example request to /weather
{
"outsideTemp": 2.75,
"skyTemp": -21.77,
"readingTimestamp":
"2018-03-25 18:02:46",
"rain": false
}
Clouds are detected using an Melexis MLX90614 sensor to measure IR radiation from the sky.
Rain is detected using an RG-11 rain sensor
An Indi Driver for observatory automation is also included.
The device and driver is currently used in Ballyhoura Observatory
-
1 Flash the ino file to an arduino nano.
-
2 Wiring diagram (in progress)
-
3 Clone this repo to raspberry pi then add a line to /etc/rc.local to start the weather micro service on startup
# start the weatherstation
/home/pi/code/github/cloud-rain-monitor/device/rpi/web/weatherMicroService.py &
-
URL
/weather/current
-
Method:
GET
-
Success Response:
- Code: 200
Content:{"outsideTemp": 2.75, "skyTemp": -21.77, "readingTimestamp": "2018-03-25 18:02:46", "rain": false}
- Code: 200
Returns history for the previous 24 hours
-
URL
/weather/history
-
Method:
GET
-
Success Response:
- Code: 200
Content:[{"outsideTemp": 2.75, "skyTemp": -21.77, "readingTimestamp": "2018-03-25 18:02:46", "rain": false}, {"outsideTemp": 2.75, "skyTemp": -21.77, "readingTimestamp": "2018-03-25 18:02:46", "rain": false}....]
- Code: 200
Returns an image weather chart
-
URL
/weather/chart/
-
Method:
GET
-
URL Params
Required:
<chart>
Valid values are 'cloud.png' and 'temperature.png'
-
Sample Call:
-
Success Response: