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
Qwiic pHAT 2.0 DEV-15945 $10.09 31
VEML6030 Light Sensor SEN-15436 $7.62 81
SGP30 Air Quality Sensor SEN-16531 $28.71 0
BME680 Environmental Sensor SEN-16466 $28.56 78
Qwiic Cables 50mm PRT-14426 $1.30 254
Elmwood electronics
Qwiic pHAT 2.0 DEV-15945 $8.99 0
VEML6030 Light Sensor SEN-15436 0
SGP30 Air Quality Sensor SEN-16531
BME680 Environmental Sensor SEN-16466 $49.99 1
Qwiic Cables 50mm PRT-14426 $1.99 22
Qwiic pHAT 2.0 DEV-15945 0
VEML6030 Light Sensor SEN-15436 $7.25 12
SGP30 Air Quality Sensor SEN-16531 $27.60 136
BME680 Environmental Sensor SEN-16466 $27.53 234
Qwiic Cables 50mm PRT-14426 $1.31 346

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:


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.


: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:.


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?


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!


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:

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.