Hacker News new | ask | show | jobs
by akoutmos 1295 days ago
Hey there! My co-authors and I actually wrote a book on this topic earlier this year. It walks you though setting up a weather station with Elixir and Nerves using a Raspberry Pi and the following sensors:

- VEML6030 light sensor - BME680 environmental sensor - SGP30 air quality sensor

After you set up the hardware side of things, you put together a very simple Elixir Phoenix REST API and persist the sensor data into Postgres (with the TimescaleDB extension).

And to wrap up the book, you learn how to create Grafana dashboards to visualize all your time-series data.

Everything is meant to be set up on your LAN and everything can be run either natively or in Docker (there is a Docker compose file in the repo).

Hope that helps!

GitHub Repo: https://github.com/akoutmos/nerves_weather_station Book: https://pragprog.com/titles/passweather/build-a-weather-stat...

2 comments

Since OP mentioned not wanting to DIY, if people are looking for weather system with incredibly rich API and no moving parts (no Raspberry PIs either), this system is fantastic for people without workshop build time:

https://weatherflow.com/tempest-weather-system/

To clarify, the OP said: "I have neither time nor workshop space to solder and assemble anything more trivial than "plug a sensor into an ESP32 and screw both into a box"."

The book is very much "plug in a sensor" style as everything is connected via Qwiic cables.

That looks like it doesn't have any local-first functionality? Their API documentation only talks about how to retrieve data from their server, even if you are just trying to get the data from your own station.
The device has an API, as does their "Hub" that reports the device to cloud. You may find tools under different names like tempestwx or etc.

That said, the point of this system is microcell climate computation, and it works best when part of the public grid of sampling points.

Does it? I couldn't find any documentation on those features, if you have links to any documentation that doesn't require going through their servers I'd love to see it since I've been looking for something just like that. Everything I have found, even for querying a single devices, requires making a request to swd.weatherflow.com via an internet connection.

EDIT: I was eventually able to find this: https://apidocs.tempestwx.com/reference/tempest-udp-broadcas...

So it is possible to get the data locally, but it seems like they are pretty strongly discouraging its use.

Having said that, there's plenty of people using this method[1]. I particularly like the work this person did presenting that data in Grafana[2].

[1] https://community.weatherflow.com/c/developers/5

[2] https://github.com/lux4rd0/weatherflow-dashboards-aio

Thanks for those links, I'll check them out!
Confused here, isn't 'indoor air quality' primarily about CO2 levels, particulate matter, VOCs, etc.? I don't see any of that in there.
Please note I replied to a comment about a book about a weather station.

Top level, I replied about CO2 levels, VOCs, etc:

https://news.ycombinator.com/item?id=33774695

This looks good, but this is an outdoor weather station. OP is asking for an indoor air quality monitory.
> This looks good, but this is an outdoor weather station. OP is asking for an indoor air quality monitory.

I replied with an indoor no-DIY suggestion and code at top level: https://news.ycombinator.com/item?id=33774695

> I actually wrote a book on this topic earlier this year. It walks you though setting up a weather station...

... and replied to this from immediately above with a similarly no-DIY weather option.

True. That said, it's still interesting to me, because an outdoor weather station is something I've also been eyeing, and also having trouble to find something that a) logs data, but b) not to a cloud.
Have you actually gotten any reliable co2 data out of the bme680?

Even with the Bosch library and their calibration the values seem rather odd at times

It's not capable of CO2 measurement, it only estimates CO2 levels based on measurements of VOCs. These estimated readings are garbage and have close to zero correlation with CO2 levels.
Unless I've got another source of VOCs around there should be at least some correlation with actual CO2 levels though? I don't have a reliable way of checking this, but the bottom end seemed well calibrated...outside air leads to a reading consistent with ambient co2
We tested a lot of VOC sensor modules and the estimated CO2 values they give is -in our experience- 80% of the time totally wrong. Also the absolute ppb values of the TVOC are most often not to be trusted.

What they are good at is detecting spikes, e.g. from cleaning liquids, desinfection etc. but I would not trust the absolute value at all.

The big sensor manufacturers recognized that and newer generations of the Sensirion sensors are now just displaying an "index" instead of absolute measurements.

Thank you for asking this question because all of my experience so far with "environmental sensors" that aren't laboratory grade has been that they are absolute garbage and only barely correlated to anything.

How are companies like Bosch allowed to pass this crap off as functional? They don't meet even basic fitness for purpose criteria.

When developing the book, I didn't have any additional meters or sensors to cross reference measurements with so I can't comment on the accuracy unfortunately. But I did notice that the changes in measurements made sense when the environment changed. I.e when I would exhale on the sensor, the measurement would rise and fall.

Another example was when I opened my window in my office. CO2 immediately dropped off (15:42 timestamp): https://twitter.com/akoutmos/status/1443233937015418891/phot...

Yeah same - there is definitely a practical cause & effect practical correlation, but also a lot of effect without obvious cause in an environment that should be relatively stable. (one person, small apt, no co2 sources)

> additional meters or sensors

I've got a CCS811 as well but no luck yet. Acquired 2nd hand so unsure if broken from shipping or I'm being stupid with code or I broke it while soldering

This reminds me how my DIY build of Luftdaten kit (PM sensor) started reporting huge particulate spikes indoors, with no obvious cause. Took me ~2 days to figure out they're being caused by our ultrasonic humidifier, and another 2 days of looking through blogs and scientific papers to finally learn that one shouldn't be putting tap water into them (as they efficiently aerosolise the minerals and contaminants dissolved in it).
Both the SGP30 and the BME680 have a big weakness that I experienced some years ago when I trying putting an air quality sensor together. They correlated the TVOC readings with the temperature. And sometimes it was bad, like a difference of just 1 or 2 degrees Celsius could double or triple the TVOC readings at the lower end of the scale (~50ppb), and add maybe ~50% at the upper end (~500ppb).

Are you seeing the same behavior?

Yeah, it's only a propietary approximation.