Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » BME280 & Arduino Based Simple Weather Station
Arduino Projects

BME280 & Arduino Based Simple Weather Station

Mamtaz AlamBy Mamtaz AlamUpdated:November 30, 20221 Comment6 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
BME280 Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

In this tutorial, we learn how to make a Simple Weather station using Arduino & BME280 Barometric Pressure Sensor that can give real-time information of Atmospheric Pressure, Temperature & Humidity. Using BME280 we can even measure the altitude above sea level.


Overview

BME280 is fairly simple to use, pre-calibrated and don’t require extra components. You can simply start measuring relative humidity, temperature, barometric pressure & approx. altitude in no time. So here we will simply interface BME280 Barometric Pressure Sensor with Arduino and display all the measured parameters like temperature, pressure, humidity and altitude in 20×4 LCD Display. You can also add Anemometer to the project to measure the wind speed.



A weather station is a device that collects data related to the weather & environment using different sensors. There are two types of weather station, one which is having own sensors and the second type of weather station is where we pull data from the weather station servers using IoT Processor. In this tutorial, we will go for the first one, i.e. we will design our own weather station just by using only one sensor BME280.

You can check some more projects related to BME280:
1. ESP8266 & BME280 Based Mini Weather Station
2. ESP32 & BME280 Based Mini Weather Station


Bill of Materials

Following are the components required for making BME280 weather Station. All the components can be purchased from Amazon via the links given below.

S.N.Components QuantityPurchase Links
1Arduino Nano Board1Amazon | AliExpress
2BME280 Sensor1Amazon | AliExpress
320x4 LCD Display1Amazon | AliExpress
4Potentiometer 10K1Amazon | AliExpress
5Connecting Wires10Amazon | AliExpress
6Breadboard1Amazon | AliExpress

BME280 Pressure, Temperature & Humidity Sensor

Bosch BME280 Humidity, Temperature & Pressure Sensor is an integrated environmental sensor which is very small-sized with low power consumption.This BME280 Atmospheric Sensor Breakout is the easy way to measure barometric pressure, humidity, and temperature readings all without taking up too much space. Basically, anything you need to know about atmospheric conditions you can find out from this tiny breakout.

BME280 Chip

This module uses an environmental sensor manufactured by Bosch with temperature, barometric pressure sensor that is the next generation upgrade to the popular BMP085/BMP180/BMP183 Sensor. This sensor is great for all sorts of weather sensing and can even be used in both I2C and SPI! This precision sensor from Bosch is the best low-cost, precision sensing solution for measuring barometric pressure with ±1 hPa absolute accuraccy, and temperature with ±1.0°C accuracy. Because pressure changes with altitude, and the pressure measurements are so good, you can also use it as an altimeter with ±1 meter accuracy. To learn more about this sensor, check BME280 Datasheet.

Features of BME280

  1. Interface: I2C & SPI
  2. Supply Voltage: 1.71V to 3.6V
  3. Temperature Range: -40 to +85°C
  4. Humidity Range: 0% to 100% rel. humidity
  5. Pressure Range: 300hPa to 1100hPa
  6. Humidity sensor and pressure sensor can be independently enabled/disabled

Applications

  1. Context awareness, e.g. skin detection, room change detection
  2. Health monitoring/well-being
  3. Home automation control
  4. Control heating, ventilation, air conditioning (HVAC)
  5. Internet of things
  6. GPS enhancement & Indoor/Outdoor navigation
  7. Weather forecast
  8. Vertical velocity indication (rise/sink speed)

BME280 Pinout

The BME280 I2C interface uses the following pins:
1. VCC: 1.71V to 3.6V
2. GND: Connect to GND
3. SCL: serial clock (SCK)
4. SDA: Serial data (SDI)
5. CSB: Must be connected to VDDIO to select I2C interface.
6. SDO: The I2C address decides the pin. If SDO connects to GND(0), the address is 0x76, if it connects to VDDIO(1), the address is 0x77. In this module, we have connected it to VDDIO, so the address should be 0x77.



I2C Interface

The module features a simple two-wire I2C interface which can be easily interfaced with any microcontroller I2C Pins. The default I2C address of the BME280 module is 0x76 and can be changed to 0x77 easily.

There are two different BME280 available in the market whose I2C address can be changed. For the module below if you remove a connection from SDO to GND, the address will change to 0x77.

There is another module available in the market which has only 4 pins. To change its I2C address Locate the solder jumper besides chip.

BME280 I2C Address Change

By default, the middle copper pad is connected to the left pad. So you need to scratch the connection between the middle and the left copper pad to disconnect them. Then you can add a solder blob between the middle and the right copper pad to join them. It allows you to set the I2C address 0x77.

BME280-I2C-Address



Interfacing BME280 with Arduino & 20×4 LCD Display

The BME280 Barometric Pressure Sensor is interfaced with Arduino to make a simple Weather Station. Connect the SDA SCL pins of BME280 to Arduino I2C Pins, i.e. A5 & A4 Pins.

Interface BME280 with Arduino

Connect the pins 1, 5, 16 of LCD to GND & Pin 2, 15 as 5V VCC. Connect the LCD pin 4, 6, 11, 12, 13, 14 to Arduino 12, 11, 5, 4, 3, 2 Pins. Use 10K Potentiometer at Pin 3 of LCD to adjust the contrast.


Source Code/Program

The Source Code/Program for Interfacing BME280 with Arduino & LCD Display is given below. You can copy this code and upload it to your Arduino Board.

But before that you need to install two libraries, i.e BME280 Library & Adafruit Unified Sensor Library. For this you can simply go to the library manager nd install these two libraries:

Adafruit Unified Sensor Library

BME280 Library

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
 
#define SEALEVELPRESSURE_HPA (1013.25)
byte degree[8] =
              {
                0b00011,
                0b00011,
                0b00000,
                0b00000,
                0b00000,
                0b00000,
                0b00000,
                0b00000
              };
 
Adafruit_BME280 bme;
 
void setup() {
  Serial.begin(9600);
  lcd.begin(20, 4);
  lcd.createChar(1, degree);
 
  if (!bme.begin(0x76)) {
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
    while (1);
  }
}
 
void loop() {
  Serial.print("Temperature = ");
  Serial.print(bme.readTemperature());
  Serial.println("*C");
 
  Serial.print("Humidity = ");
  Serial.print(bme.readHumidity());
  Serial.println("%");
 
  Serial.print("Pressure = ");
  Serial.print(bme.readPressure() / 100.0F);
  Serial.println("hPa");
 
  Serial.print("Approx. Altitude = ");
  Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
  Serial.println("m");
 
  lcd.setCursor(0, 0);
  lcd.print("Temperature: ");
  lcd.print(bme.readTemperature());
  lcd.write(1);
  lcd.print("C");
 
  lcd.setCursor(0, 1);
  lcd.print("Humidity: ");
  lcd.print(bme.readHumidity());
  lcd.print("%");
 
  lcd.setCursor(0, 2);
  lcd.print("Pressure: ");
  lcd.print(bme.readPressure() / 100.0F);
  lcd.print("hPa");
 
  lcd.setCursor(0, 3);
  lcd.print("Altitude: ");
  lcd.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
  lcd.print("m");
 
  Serial.println();
  delay(1000);
  lcd.clear();
}


Code Explanation

1
2
3
4
5
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

The sketch starts with including 4 libraries, i.e Wire.h, Adafruit_Sensor.h, Adafruit_BME280.h & LiquidCrystal.h.

1
2
3
4
5
6
7
8
9
10
11
12
13
#define SEALEVELPRESSURE_HPA (1013.25)
byte degree[8] =
              {
                0b00011,
                0b00011,
                0b00000,
                0b00000,
                0b00000,
                0b00000,
                0b00000,
                0b00000
              };
Adafruit_BME280 bme;

Next, we define SEALEVELPRESSURE_HPA variable to calculate the altitude and create an object of Adafruit_BME280 library. The byte degree[8] is used to print the degree Symbol in 20×4 LCD.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Serial.print("Temperature = ");
  Serial.print(bme.readTemperature());
  Serial.println("*C");
 
  Serial.print("Humidity = ");
  Serial.print(bme.readHumidity());
  Serial.println("%");
 
  Serial.print("Pressure = ");
  Serial.print(bme.readPressure() / 100.0F);
  Serial.println("hPa");
 
  Serial.print("Approx. Altitude = ");
  Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
  Serial.println("m");
 
  lcd.setCursor(0, 0);
  lcd.print("Temperature: ");
  lcd.print(bme.readTemperature());
  lcd.write(1);
  lcd.print("C");
 
  lcd.setCursor(0, 1);
  lcd.print("Humidity: ");
  lcd.print(bme.readHumidity());
  lcd.print("%");
 
  lcd.setCursor(0, 2);
  lcd.print("Pressure: ");
  lcd.print(bme.readPressure() / 100.0F);
  lcd.print("hPa");
 
  lcd.setCursor(0, 3);
  lcd.print("Altitude: ");
  lcd.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
  lcd.print("m");

In looping section of the code, we use following functions to read temperature, relative humidity & barometric pressure from the BME280 module.

readTemperature() function returns the temperature from the sensor.

readPressure() function returns the barometric pressure from the sensor.

readAltitude(SEALEVELPRESSURE_HPA) function calculates the altitude.

readHumidity() function returns the relative humidity from the sensor.




Video Tutorial

BME280 Weather Station | With Arduino, ESP8266 & ESP32
Watch this video on YouTube.

There is an upgraded version of BME280 Sensor called BME680 Sensor, that can also measure Index of Air Quality (IAQ) & can be used to measure Air Quality as well.

And if you are looking for the BME280 alternative then you can use MS5611 Sensor which can also measure temperature, pressure and altitude.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleTEMT6000 Ambient Light Sensor & Arduino – Measure Illuminance & Light Intensity
Next Article ESP32 & BME280 Based Mini Weather Station

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 1 Comment

1 Comment

  1. Łukasz Lech on January 17, 2020 4:17 AM

    I encourage you to read website http://www.simplyclime.pl. Enables connection of the weather station with the mobile application.

    Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 21, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • Half Wave Rectifier Basics, Circuit, Working & Applications
    Half Wave Rectifier Basics, Circuit, Working & Applications
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.