<-- Back to homepage

Wireless Weather Station with DHT20, BME280 & PICO W - 2026-03-28

Using a Raspberry Pi Pico W on a breadboard, a DHT20 sensor and a BME280 sensor, I have created a wireless weather station. It accurately measures temperature (℃), relative humidity (RH %) and barometric/atmospheric pressure (hPa).

I have chosen the DHT20 to measure the temperature and relative humidity (RH) as it uses the simple I2C protocol and is extremely accurate (±0.5℃, RH ±3%). It is an improved version of the previous DHT11 and DHT22 sensors. See image below:

img3

 

I chose the BME280 as it is a cheap and effective way to measure barometric pressure. I didn't use it for temperature or humidity as it is not as accurate as the DHT20. This is due to the embedded components, as well as the chip on the BME280 generating a small amount of heat potentially skewing measurements. See image below:

img4

Here is the pin layout used:

SensorSensor Pinpico w GPIO / FunctionPico W Physical Pin
DHT20VCC3.3V OUTPin 36
 GNDGNDPin 38
 SDAGP4 (I2C0 SDA)Pin 6
 SCLGP5 (I2C0 SCL)Pin 7
BME280VIN3.3V OUTPin 36
 GNDGNDPin 18
 SDAGP4 (I2C0 SDA)Pin 6
 SCLGP5 (I2C0 SCL)Pin 7

Here it is all connected on the breadboard:

img5

I then programmed the board using micropython (v1.27.0) and the Thonny IDE. I have programmed it to log the date & time (in UTC), temperature, relative humidity and barometric pressure. A log is triggered on boot and on every hour, being stored on to a csv file. To ensure the flash storage doesn't run out of space, after 10000 entries (after 416 days) it automatically starts deleting the oldest entries to make space for the new ones. Time is automatically set once connected to a WiFi network. The board also hosts a simple http server, where by going to the boards IP address, your browser downloads the csv file containing all the logged data.

The board contains bme280.py (bme280 driver), dht20.py (DHT20 driver) and main.py (programming for the logging and web server).

The entire device was then put inside a 3D printed enclosure (Part1.stl, Part2.stl). The DHT20 sensor was hot glued to a hole in the enclosure to ensure accurate ambient measurements, which was then sealed with sticky tape.

img6img7

img8

The gaps are intentional to allow airflow, ensuring accurate measurements. This is not an issue in terms of waterproofing as the location in which it was placed is sheltered.

It was then placed on the balcony, ready to start logging!

img9

THE END

<-- Back to homepage