Raspberry Pi and Arduino Powered AI Weather Station Predicts Air Quality

Kutluhan Aktar's AI weather station
(Image credit: Kutluhan Aktar)

We’ve seen home-made weather stations (opens in new tab) before, but one running a neural network that can predict the air quality based on the local ozone concentration is a novelty. That, however, is precisely what prolific maker and self-taught full-stack developer Kutluhan Aktar (opens in new tab) has made, as featured on Hackster (opens in new tab)

Essentially, Aktar set out to build a low-cost weather station that would forecast air quality levels, and as ground-level ozone can cause breathing difficulties, set off asthma attacks, ozone concentration should be added to the forecast data to build up a picture of local air quality.

Ground-level ozone forms when emissions from vehicle exhausts and industrial plants react in the presence of sunlight, so its presence is a useful marker that its precursors are floating around too. 

Using a weather station and ozone detector on his balcony, Aktar was able to collect a data set using an Arduino Nano (opens in new tab) 33 board and send it (opens in new tab) via Bluetooth to a Raspberry Pi 4 (opens in new tab) set up indoors. This was used in conjunction with the local air quality index to train a TensorFlow Kera H5-based artificial neural network so that it could make predictions of outside air quality from just the weather and ozone data. 

The neural network was then converted to a C array using an application Aktar developed himself in Python. This file can run on the Nano itself, which sits inside the 3D-printed weather station body alongside the ozone sensor and anemometer from DFRobot, who also provided the OLED and IPS displays. Pressure and temperature sensing comes from a BMP180 sensor pack.

The weather station’s screen displays either all the data it is collecting - ozone concentration, wind speed, temperature, atmospheric pressure and its altitude - or a graphic showing its prediction of the air quality as Good, Moderate, or Unhealthy. Aktar hopes the device will help improve environmental conditions and reduce the incidence of respiratory diseases.

If you want to make your own, there's a wealth of information at the Hackster site, including code, schematics, and a full list of parts. Aktar’s YouTube channel (opens in new tab) is also well worth checking out, especially for the LIDAR-equipped litter detection robot (opens in new tab).

Ian Evenden
Freelance News Writer

Ian Evenden is a UK-based news writer for Tom’s Hardware US. He’ll write about anything, but stories about Raspberry Pi and DIY robots seem to find their way to him.