Codey OnlineArduino & ESP32 component library › Bosch BME280 5V 3-in-1 sensor Temperature Humidity and Air Pressure
Bosch BME280 5V 3-in-1 sensor Temperature Humidity and Air Pressure
Sensors

Bosch BME280 5V 3-in-1 sensor Temperature Humidity and Air Pressure

The Bosch BME280 is a digital environmental sensor that measures temperature, relative humidity, and barometric pressure. It typically communicates with microcontrollers over I2C . Use it to build weather/air-quality projects by connecting the sensor’s data interface to your Arduino/ESP32.

Width: 11.6 mm

Pinout — Bosch BME280 5V 3-in-1 sensor Temperature Humidity and Air Pressure

Pin Signal Description
VIN power Module power input, typically 3.3–5V for the BME280 breakout.
GND ground Ground reference for power and I2C signals.
SCL SCL I2C clock line from the microcontroller to the BME280.
SDA SDA I2C data line between the microcontroller and the BME280.

Example wiring diagram — Bosch BME280 5V 3-in-1 sensor Temperature Humidity and Air Pressure

From To Wire
board:5V x1:VIN red
board:GND x1:GND black
board:SCL x1:SCL green
board:SDA x1:SDA blue

Example Arduino code — Bosch BME280 5V 3-in-1 sensor Temperature Humidity and Air Pressure

This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

Adafruit_BME280 bme;

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ;
  }

  Serial.println("BME280 sensor example");

  if (!bme.begin(0x76)) {
    Serial.println("Could not find a valid BME280 sensor at 0x76. Check wiring.");
    while (1) {
      delay(10);
    }
  }

  Serial.println("BME280 initialized successfully.");
}

void loop() {
  float temperature = bme.readTemperature();
  float humidity = bme.readHumidity();
  float pressure = bme.readPressure() / 100.0F;

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");

  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.println(" %");

  Serial.print("Pressure: ");
  Serial.print(pressure);
  Serial.println(" hPa");

  Serial.println("---");
  delay(2000);
}

Related components

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

2.4 inch OLED Display I2C 3.3V

2.4 inch OLED Display I2C 3.3V

3.5 inch TFT LCD Shield

3.5 inch TFT LCD Shield

50kg Load Cell Weight Sensor

50kg Load Cell Weight Sensor

Build your Arduino or ESP32 project with AI

Describe what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.

Start for free