Get all your news in one place.
100’s of premium titles.
One app.
Start reading
Tom’s Hardware
Tom’s Hardware
Technology
Ash Hill

Raspberry Pi Weather Station Uses One Sensor, Displays Data via Web Based Dashboard

Raspberry Pi

This Raspberry Pi is truly a device for all makers. The Raspberry Pi can be a fun retro gaming device or it can be a serious scientific project, and many things in between. Maker Donsky, the mastermind behind Donskytech, has used one to create a lovely Raspberry Pi weather station project. It uses just one sensor so you don’t need much hardware to get off the ground and he also provided a very thorough tutorial to follow along with making it an excellent beginner's project.

The project takes data from a DHT22 sensor and displays information pulled from it in real-time. Users can access a web based dashboard that shows information in both text form as well as in the form of graphical charts. To access the data, all a user has to do is open a web browser and check out both the temperature and humidity in one place.

(Image credit: Donsky, Donskytech)

In order to make a web-based dashboard, the project requires a web server. This web server application runs on the Raspberry Pi so a model with wireless support is ideal. A file called "app.py" is used to generate the dashboard, via Python's Flask module which creates the HTML and handles sockets. A little Bootstrap HTML and CSS is used to format the web page, but the charts are created in real-time using Plotly.js.  The Pi is also responsible for reading the DHT22 sensor data, via "dht22_module.py", a single module that handles both temperature and humidity data.

In the demonstration project created by Donsky, a Raspberry Pi 4B 8GB module is used, however, you could get away with a Raspberry Pi Zero 2 W, even a Raspberry Pi Pico could perform this task. The temperature and humidity sensor used is a DHT22 but a DHT11 would work, as well. A breadboard isn’t necessary, you can just use jumper wires to directly connect the DHT22 to the Pi.

If you want to recreate this Raspberry Pi project, check out the official project page over at Donsky’s website where you’ll also find tons of other cool projects. 

You can find all of the code used in this project over at GitHub. Donsky also shared a video of the weather station project over at YouTube if you’d like to see it in action.

Be sure to follow him for more cool creations as well as any future updates on this one.

Sign up to read this article
Read news from 100’s of titles, curated specifically for you.
Already a member? Sign in here
Related Stories
Top stories on inkl right now
One subscription that gives you access to news from hundreds of sites
Already a member? Sign in here
Our Picks
Fourteen days free
Download the app
One app. One membership.
100+ trusted global sources.