Posts

Showing posts from February, 2021

Microbit weather station

Image
 Microbit V1 weather station Update: Feb 2021: I've published the microbit V2 version using Bluetooth (BLE) Update 7th Jan 2021 : I've found an error in my DS3231 extension, so now it is feasible to use the microbit's Bluetooth (BLE) - which means the second microbit won't be necessary. And I fixed my Google Apps Script code for the chart! This project lets you make regular hourly readings of weather measurements, store them, and upload them to a phone or computer. The date and time of each reading are also recorded. You can use the readings to plot a chart, for example, to show how the weather changed over time. Here's a set of readings over 24 hours: These are the measurements I am using for this project: Barometric air pressure Temperature Humidity You can add more "instruments" - for example, I plan to add a home-made rain gauge, as described in this blog. The weather station can be self-contained, powered from a couple of batteries perhaps. You can...

Using weather forecast data

Image
 Using weather forecast data Compare your readings with a forecast Having built a microbit-based weather station , I was keen to see how its readings compared with forecasts (in my case I used Met Office data). I quickly got bored with downloading the forecast manually, so here's a way of doing it with a Google spreadsheet and some GAS (Google Apps Script - which is really JavaScript plus some handy libraries). Here are some example charts: Accessing Met Office forecasts The first thing is to get yourself access to the Met Office forecasts, at Met Office DataPoint . Here you can register and get your own API Key - a kind of password that will be used in the URL you use to fetch the forecast data. Google Apps Script Now you can create your spreadsheet and script. If this is new to you, try this article . I'll describe my own script below. The entire code is written as one function: getTH(). It starts like this: