Build a Weather Station with Elixir and Nerves (PragProg)

Here’s some shops in Canada where you can get the items:

Name Manufacturer code Price $CAD # in Stock Sep1/2021 Link
DigiKey
Qwiic pHAT 2.0 DEV-15945 $10.09 31 https://www.digikey.ca/en/products/detail/sparkfun-electronics/dev-15945/11570526
VEML6030 Light Sensor SEN-15436 $7.62 81 https://www.digikey.ca/en/products/detail/sparkfun-electronics/sen-15436/10295818
SGP30 Air Quality Sensor SEN-16531 $28.71 0 https://www.digikey.ca/en/products/detail/sparkfun-electronics/SEN-16531/12350214
BME680 Environmental Sensor SEN-16466 $28.56 78 https://www.digikey.ca/en/products/detail/sparkfun-electronics/sen-16466/12340133
Qwiic Cables 50mm PRT-14426 $1.30 254 https://www.digikey.ca/en/products/detail/sparkfun-electronics/PRT-14426/7652739
Elmwood electronics
Qwiic pHAT 2.0 DEV-15945 $8.99 0 https://elmwoodelectronics.ca/products/sparkfun-qwiic-phat-v2-0-for-raspberry-pi
VEML6030 Light Sensor SEN-15436 0 https://elmwoodelectronics.ca/products/sparkfun-ambient-light-sensor-veml6030-qwiic
SGP30 Air Quality Sensor SEN-16531
BME680 Environmental Sensor SEN-16466 $49.99 1 https://elmwoodelectronics.ca/products/sparkfun-environmental-sensor-breakout-bme680-qwiic
Qwiic Cables 50mm PRT-14426 $1.99 22 https://elmwoodelectronics.ca/products/14426
Mouser.ca
Qwiic pHAT 2.0 DEV-15945 0 https://www.mouser.ca/ProductDetail/SparkFun/DEV-15945?qs=%2Fha2pyFadugFtrtw75XPm6d%252BOK3nT6WsTC65gouUFcU%3D
VEML6030 Light Sensor SEN-15436 $7.25 12 https://www.mouser.ca/ProductDetail/SparkFun/SEN-16531?qs=%2Fha2pyFadugWWj5EV4N5RsqXsHdg2dluq1RY%2FOHTSA0%3D
SGP30 Air Quality Sensor SEN-16531 $27.60 136 https://www.mouser.ca/ProductDetail/SparkFun/SEN-16531?qs=%2Fha2pyFadugWWj5EV4N5RsqXsHdg2dluq1RY%2FOHTSA0%3D
BME680 Environmental Sensor SEN-16466 $27.53 234 https://www.mouser.ca/ProductDetail/SparkFun/SEN-16466?qs=%2Fha2pyFaduin%2FIAN5Myj7kC56X3AzTTim614WK%252BK%2FMg%3D
Qwiic Cables 50mm PRT-14426 $1.31 346
5 Likes

I can’t find any of the sensors except raspberry pi in India anyone knows where I can get it or some other alternative I could use.

1 Like

check digikey india: https://www.digikey.in/en/products/detail/sparkfun-electronics/SEN-16466/12340133?s=N4IgTCBcDaIMoFEByBaAjANgCwYyAugL5A

2 Likes

I have these sensors hats for Raspberry 4, I think it works right?

As long as the same ICs are used it should work, but it doesn’t look like it.

I think that’s still an I2C bus based board, so although the register addresses and sensor outputs will be different, the general approach should be the same. I’m sure with the boards’ data sheets in hand it would be possible to follow the book with appropriate modifications. It would probably make it an even better learning exercise, depending on how much appetite (and/or time) you have available

1 Like

sure everything is possible. But it won’t work out of the box.

1 Like

Yes, you are sure, I got the data sheets and the boards are I2C.

Thanks

:partying_face: Beta 2 of the book has just landed :partying_face:

Feel free to check it out at: Build a Weather Station with Elixir and Nerves: Visualize Your Sensor Data with Phoenix and Grafana by Alexander Koutmos, Bruce A. Tate, Frank Hunleth

The updates for this beta include the addition of chapter 4 and chapter 5 as well as addressing some errata. Chapter 4 goes over how to publish data from your Nerves device to a Phoenix API that you will be writing. The Phoenix API is backed by TimescaleDB so you can store and query all that time-series goodness :wink:. Chapter 5 goes over how to set up Grafana and how to visualize your time-series data that is stored in TimescaleDB. By the end of the book you’ll be able to build a (near) real-time weather dashboard like so:

Be sure to check it out and feel free to reach out with any feedback! Happy hacking :slight_smile:.

7 Likes

OK, my weather station is complete. I have to say, that this book and the project was the most entertaining one in a few years probably. :slight_smile:

The only question now is what case to use for the RPI and the sensors? Anybody has a tip?

And I want to have the current data accessible via HomeKit. Is GitHub - mtrudel/hap: A HomeKit Accessory Protocol (HAP) Implementation for Elixir the way to go?

2 Likes

I would also love to know what people have done for cases for this thing. I’m all thumbs when it comes to real world building as I expect many of you reading this book will be also. What would a case for this weather station need? Can I put the whole thing in a Tupperware and call it a day? Would that block the light sensor too much?

I loved building this and following along in the short book format.

1 Like

I’m interested in case building but to let it live outside.
My end goal would be to have small solar panels within the case so it could charge small batteries and power itself.
It would have to be impermeable as well.

Work has been keeping me away from this project but I’ll get to it, eventually.

If anyone advance in this subject, please share your learnings.

I am still looking for rp zero wh in us area but no luck

Every once in a while I see an RPi Zero WH at Microcenter, but they do seem to be in short supply. If you don’t mind soldering, both the regular RPi Zero and RPi Zero 2 work. If you use the RPi Zero 2, use MIX_TARGET=rpi3a instead of MIX_TARGET=rpi0. In case you’re wondering, the RPi Zero 2 is really similar to a Raspberry Pi 3A except for its shape and size.

The other Raspberry Pis will also work for the book with modifications to the MIX_TARGET lines. The nice thing about the Pi Zeros are that one USB cable can provide power and networking. This other Pis take a couple more steps to set up the first time (mostly if you need WiFi), but are totally doable.

One last note: the Raspberry Pi 4 can also be run with power/networking over one USB C cable if your computer can power it. It uses quite a bit more power than the Pi Zeros, but it does seem to work for many of us.

Hope this helps!

4 Likes

Glad that you enjoyed the book and the project! That’s a mighty slick looking dashboard :slight_smile:.

As for a case…to be honest I didn’t find anything that I really liked or that fit all the parts. So I just leave it out on my desk on top of some anti-static bags. I haven’t explored the HomeKit route…but that does look really interesting and it seems like a natural next step for the project :wink:

1 Like

I used this solderless kit on my raspberry and it worked perfectly GPIO Hammer Headers - Solderless Raspberry Pi Connectors [Male + Female + Installation Jig] : ID 3413 : $6.50 : Adafruit Industries, Unique & fun DIY electronics and kits.

I’m trying to figure out which sensors I can get my hands on, to get this project done. A few questions I have:

  • The VEML6030 sensor board seems to be unavailable. Is a VEML7700 based sensor board a good alternative?
  • Is the SGP40 based sensor board a logic follow up (without much modifications) for the indicated SGP30 sensor?
  • a general question: some sensor boards are based on the same IC, but come from different manufacturers (for example, there are SGP sensor boards from adafruits and from sparkfun, with the same sensor). Are those easily interchanged without any modification to the software? Or are those boards also different to read out in software?

Noob questions, I’m sure, but I’m curious anyway :slight_smile:

seems to be available here: https://www.digikey.de/en/products/detail/vishay-semiconductor-opto-division/VEML6030-SB/8573326

If its just the IC it’ll work. But the connectors may be different. Post a link and I can tell you what to do.

That sensor you’re referring to doesn’t seem to have a qwiic connector. I think that VEML6030 sensor isn’t much used anymore.

connector is not that big an issue. changing the IC is way harder.