Reading BME280 - Arduino
By System Administrator - 08/02/2026 - 0 comments
Reading BME280 - Arduino:
Hardware required:
- BME280 Sensor board
- Arduino UNO
Wiring:
Install BME280 Libraries:
Github Page: BME280
To install the library, from Arduino IDE (2.3.x), Click on Libraries icon on the left pane.
Search for BME280 and install Bme280 by Eduard Malokhvii.
From File -> Examples -> BME280 -> Click on “TwoWire” example.
TwoWire.ino Script:
#include <Arduino.h>
#include <Bme280.h>
Bme280TwoWire sensor;
void setup() {
Serial.begin(9600);
//Wire.begin (D1, D2); //Comment this line
Wire.begin(); //Add this line
Serial.println();
sensor.begin(Bme280TwoWireAddress::Primary);
sensor.setSettings(Bme280Settings::indoor());
}
void loop() {
auto temperature = String(sensor.getTemperature()) + " °C";
auto pressure = String(sensor.getPressure() / 100.0) + " hPa";
auto humidity = String(sensor.getHumidity()) + " %";
String measurements = temperature + ", " + pressure + ", " + humidity;
Serial.println(measurements);
delay(1000);
}
Note:
Change Wire.begin(D2, D1); to Wire.begin(); in the script.
Select the board (UNO) and your com-port , Compile and upload.
Open COM port Monitor and see the logging:
Note: hPa - hectoPascals
Atmo Pressure is measured in hectoPascals (hPa), also called millibars.
Standard pressure at sea level is defined as 1013hPa.
one hPa = one millibar = one thousandth of a “bar” (1/1000)
1hPa = 1 Milli Bar (mb).

Comments
Write a comment