Create a weather forecasting station using a Feather S2 and an OLED

At the moment, I am waiting for the second version of my PCB for the PicoPicorder. In a departure from my regular making, I decided to buy a Feather S2 from Pimoroni. This is a Feather-format board with built-in WiFI that comes with CircuitPython pre-installed (although I believe you can install MicroPython if you want to – but in the end, I stuck with CircuitPython). If you want to know more about the Feather S2, take a look at this website.

But what to do with it?

My step-daughter has recently started a (very) local waitressing job whilst waiting to find her dream job (we hope!). Until today, this was all very outside-based, due to COVID restrictions in the UK. WIth today’s slight relaxation of restrictions, she’ll be indoors some of the time, but they’re (very sensibly) keeping the outside area. I decided, therefore, that she needed a way of knowing what the weather was going to be like for upcoming shifts.

I also bought a FeatherWing OLED at the same time so decided to use that as the readout for a weather forecasting station. I decided that I didn’t just want to sandwich the two together (because that would give me quite a tall profile and I wanted something flatter. This meant either a PCB or a piece of stripboard. I will be going for the latter eventually, but first of all I decided to breadboard the two boards (as you can see in the image above). This involved soldering male headers to both boards, which was fairly easy (once I’d got used to my new varifocals!)

After sorting out the circuit, I wrote some code that would allow me to:

  • Select a location to forecast the weather for (because I wanted it to be multi-user, so added in my parents’ home town and the in-laws’ home town). (Button A on the OLED).
  • Retrieve a forecast from the OpenWeatherMap.org API (which I’d previously signed up for, on their Free tier). (Button B).
  • Display the current weather and the next 5 forecast weather readings. (Button C).

All my code is on GitHub if you’d like to take a look. Feel free to re-use and adapt if you’d like to. The API returns JSON, and there’s some conversion functions in there to get the data into a more manageable (smaller) packet. There’s probably a more efficient way to use the displayio library, but I wanted to get the code done in a day. I learned loads about Python, loops especially, doing this!

Here is a video demo of the device as it currently is on the breadboard. As you can imagine, it won’t take much to convert this to a stripboard version! I will then add a 3D printed box to put it in.

Let me know what you think of the project – and if you can think of any additional bells and whistles I can add!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.