Skip to content

4.1.1. BME280 LCD Environmental Monitor

Description This project teaches multi-device I2C bus sharing, screen layout formatting, and sensor data presentation. These skills are fundamental to weather station displays, HVAC climate controllers, and portable environmental diagnostic tools.
Use case This project connects to real-world industrial and IoT applications such as: weather stations, climate-control systems, and environmental monitoring devices. It demonstrates how multiple sensors and displays can share one communication bus efficiently.

Components (Things You will need)

Arduino Uno Arduino USB Cable Bread Board Jumper Wires BME Sensor LCD Display

Building the circuit

Things Needed:

  • Arduino Uno = 1
  • Arduino USB cable = 1
  • Breadboard = 1
  • Jumper Wires
  • BME Sensor
  • LCD Display

Mounting the component on the breadboard and wiring the circuit

Step 1: Place the Components

Place the BME280 sensor and I²C LCD display on the breadboard.

Step 2: Connect the BME280 Power and Ground

Connect the VCC pin of the BME280 sensor to the 3.3V pin on the Arduino Uno board using a jumper wire. Then, connect the GND pin to GND.

Step 3: Connect the BME280 I²C Pins

Connect the SDA pin of the BME280 sensor to A4 (SDA) on the Arduino Uno board. Then, connect the SCL pin to A5 (SCL).

Step 4: Connect the I²C LCD Power and Ground

Connect the VCC pin of the I²C LCD display to 5V on the Arduino Uno board and the GND pin to GND using jumper wires.

Step 5: Connect the I²C LCD Pins

Connect the SDA pin of the I²C LCD display to A4 (SDA) and the SCL pin to A5 (SCL) on the Arduino Uno board.

Step 6: Perform a Final Check

Check all power, signal, and ground connections against the Circuit Connections table and wiring diagram. Ensure that all components share a common ground and that the BME280 is connected to 3.3V and the I²C LCD display is connected to 5V before powering the circuit.

Components on breadboard

Make sure to connect the Arduino USB cable to the Arduino board.

PROGRAMMING

Step 1: Open your Arduino IDE. See how to set up here: Getting Started.

Step 2: Write the complete program implementing the system logic with appropriate pin definitions, setup configuration, and the main control loop.

// Project 62: BME280 LCD Environmental Monitor
#include <Wire.h>
#include <Adafruit_BME280.h>
#include <LiquidCrystal_I2C.h>

Adafruit_BME280 bme;
LiquidCrystal_I2C lcd(0x27, 16, 2);

unsigned long lastUpdate = 0;
const long interval = 2000;

void setup() {
  Wire.begin();
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("BME280 Station");
  lcd.setCursor(0, 1);
  lcd.print("Initializing...");
  delay(1500);

  if (!bme.begin(0x76)) {
    lcd.clear();
    lcd.print("BME280 Error!");
    while (1);
  }
  lcd.clear();
}

void loop() {
  if (millis() - lastUpdate >= interval) {
    lastUpdate = millis();
    float temp = bme.readTemperature();
    float hum = bme.readHumidity();
    float pres = bme.readPressure() / 100.0F;

    lcd.setCursor(0, 0);
    lcd.print("T:"); lcd.print(temp, 1); lcd.print("C H:"); lcd.print(hum, 0); lcd.print("%");
    lcd.setCursor(0, 1);
    lcd.print("P:"); lcd.print(pres, 1); lcd.print(" hPa    ");
  }
}

Step 3: Save your code. See the Getting Started section

Step 4: Select the arduino board and port See the Getting Started section:Selecting Arduino Board Type and Uploading your code.

Step 5: Upload your code. See the Getting Started section:Selecting Arduino Board Type and Uploading your code

CONCLUSION

The screen shows initialization text for 1.5 seconds, then presents continuous live temperature, humidity, and atmospheric pressure.