Simple weather station (LCD + MQTT)

Raspberry Pi weather station with BMP280 sensor

Similar projects worth following
This is just a simple weather station with off-the-shelf components, consisting in essence of a BMP280 temperature-and-pressure-sensor and an LCD (Liquid Crystal Display). Either component is connected to the I2C bus, i.e. Pin 2 (SDA) and 3 (SCL) of a Raspberry Pi (here 3 model B+).


It is not tricky to assemble the parts (because the trick with the I2C is that you can just connect all SDA (Serial DAta) pins together and all SCL (Serial CLock) pins together and it usually works). Just make sure that you have the python libraries in the right directory and the I2C is enabled on your Raspberry Pi (the I2C Master). 

Default addresses of the I2C Slaves (an I2C Master doesn't have an address):

0x27 = LCD

0x29 = TSL2591 sensor (optional, see project log)

0x77 = BMP280 sensor

Of course you need a power supply as well. Display is supplied with 5V (USB VBUS). BMP280 is supplied with 3,3V (VCC), Pins SDO and CSB of the sensor are connected with VCC (here a soldered connection).

BMP280 tends to overshot (temperature) if it's exposed to direct sun radiation, so I would recommend to mount it at a rather shadowy place. The atmospheric pressure measurement is very delicate and accurate, as far as I can tell (please note: 1 atm = 1000 mbar = 1000hPa = 100000 N/m²).

You can run an MQTT script simultaneously on your RasPi (for remote control).


1. A sporadic "(...) OSError: [Errno 121] Remote I/O error" might suggest a problem with the I2C wiring.

2. A "frozen" display also suggests a I2C problem in all likelihood (type in "i2cdetect -y 1" on the shell for an ad-hoc test).

3. White bars in the first line of the display (default indicators) after the system had been working for a while suggest a problem with the power supply (VBUS or wiring)


Optional brightness sensor.

Adobe Portable Document Format - 1.89 MB - 10/22/2021 at 11:26


Adobe Portable Document Format - 885.90 kB - 09/07/2021 at 04:41



The temperature-and-pressure sensor.

Adobe Portable Document Format - 236.61 kB - 09/07/2021 at 04:41


  • 1 × Raspberry Pi
  • 1 × BMP280 sensor
  • 1 × Display (LCD)
  • 1 × Wiring and connectors
  • 1 × TSL2591 sensor

View project log

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates