DEV Community

Cover image for A Home Weather Monitoring System Built Without AI
Fernando Fornieles
Fernando Fornieles

Posted on

A Home Weather Monitoring System Built Without AI

Coding without using AI may seem revolutionary nowadays but what I wanted was simply to learn Python and enjoy the act of coding with my own hands.

So I built a Home Weather Monitoring System with the following components:

  • A weather station
  • A software to read the sensor lectures
  • A web application to view the Weather Data

A diagram describing the components of the weather system: a weather station, a sensor reader and a web application

The Weather Station

I wanted something easy to build, so I recycled an old Raspberry Pi to attach a Pimoroni's Weather HAT to it. This board has sensors to measure temperature, pressure, humidity and luminosity and a little screen to display the weather data.

A photo of the weather station installed on the Pi

For reading the sensors and display the info on the screen, Pimoroni provides a Python library and some examples of how to use it. It is really easy and a good starting point to experiment.

The Sensor Reader Software

Once the Weather HAT is installed and having played with the Python library, it's time to write the software to do what you need.

In my case I wanted to display the reading on the screen to see them directly. The other thing I wanted was to send the weather data to a web application in order to check the current values from anywhere and keep a history of the data.

But since it is more comfortable for me to code on my PC instead of doing it directly on the Pi, I had to create a mock for the sensor reader and the screen.

This was a good opportunity to achieve my goal of learning Python more in depth by creating interfaces and applying design patterns :-)

The Weather Data Web Application

As mentioned above, I wanted a web application to store the weather history and show the current weather values from anywhere.

To build this I choose PHP and Symfony as a framework. As I have experience with both, the challenge was to see how fast I can implement this web application using only the productivity tools provided by the framework and its bundles.

The web application has the following components:
-An API endpoint to receive the weather data, secured by a JWT token
-A front page to show the current data as well as some statistics and evolution graphs
-A private backoffice to manage the weather data, secured by a username and password.

A diagram showing the component of the weather data web application

This is the first article of a series where I will share, for those that may find this interesting, my learnings and how I enjoy building my personal Home Weather Monitoring System.

Top comments (0)