Skip to main content

Quick Start

This board reads temperature, relative humidity and pressure over I2C. Connect it, install the library, and run its example to see all the readings on your computer. Both an Arduino library and a MicroPython module exist for this board, so pick the tab that matches your controller.

You program the controller connected to this breakout. The breakout itself is not flashed.

1. Connect the breakout board​

Plug a Qwiic cable into either Qwiic connector on the board and into the matching connector on your controller. No soldering needed, and the second Qwiic connector stays free for chaining another Qwiic board.

ControllerEnvironmental Sensor BME280 Breakout
Qwiic connectorEither Qwiic connector
Top-down view of the board with a four-pin connector on the left edge and on the right edge, and the GND, VCC, SDA and SCL holes along the bottom edge
Either Qwiic connector works

Without Qwiic: breadboard wiring​

If your controller has no Qwiic connector, solder the included header pins and wire the board to its I2C pins instead:

ControllerEnvironmental Sensor BME280 Breakout
I2C data (SDA)SDA
I2C clock (SCL)SCL
3.3 V or 5 VVCC
GNDGND

The header works with both 3.3 V and 5 V controllers: a regulator on the board makes 3.3 V for the sensor, and a level shifter translates the two I2C lines.

2. Install the library​

Open the Arduino IDE Library Manager, search for BME280, and install Soldered's BME280 and BME680 library. You can also download it from the source below.

🔗Soldered BME280 and BME680 Arduino library

Verified Arduino library at commit 64eae4d

→

Tip: downloading from GitHub. On the library's GitHub page, click the green Code button and choose Download ZIP, then add it in Arduino IDE with Sketch → Include Library → Add .ZIP Library....

3. Run the first example​

This is BME280_Read_All_Values.ino, the library's own example for this board. It prints every reading the sensor offers, first one value at a time and then all of them from a single measurement, once a second.

Select Board
BME280_Read_All_Values.ino
#include "BME280-SOLDERED.h"

// Declare your sensors here
BME280 bme280;

void setup()
{
// Initialize the sensors
Serial.begin(115200);

// Initialize the sensors
bme280.begin();
}

void loop() // Temperature is not factory calibrated, you can add offset to it
{
float offset = 0; // offset in °C

Serial.println("Reading one by one: ");

float temperature = bme280.readTemperature() + offset;
Serial.print("Temperature: ");
Serial.println(temperature);

float humidity = bme280.readHumidity();
Serial.print("Humidity: ");
Serial.println(humidity);

float pressure = bme280.readPressure();
Serial.print("Pressure: ");
Serial.println(pressure);

float altitude = bme280.readAltitude();
Serial.print("Altitude: ");
Serial.println(altitude);

delay(1000);

Serial.println("\nReading all at once: ");

float temperature2, humidity2, pressure2;
bme280.readSensorData(temperature2, humidity2, pressure2);

Serial.print("Temperature: " + String(temperature2 + offset) + " C");
Serial.println();

Serial.print("Humidity: " + String(humidity2) + " %");
Serial.println();

Serial.print("Pressure: " + String(pressure2) + " hPa");
Serial.println();

// We need to caluclate altitude from pressure and sea level pressure
float altitude2 = bme280.calculateAltitude(pressure2);

Serial.print("Altitude: " + String(altitude2) + " m");
Serial.println();
Serial.println();
}

4. Check the result​

Open the Serial Monitor at 115200 baud. About once a second you see a block like this:

Serial MonitorAutoscrollShow timestampNewline115200 baud
Message (Enter to send message to the board)
Reading one by one:
Temperature: 23.30
Humidity: 46.00
Pressure: 1002.40
Altitude: 90.73

Reading all at once:
Temperature: 23.30 C
Humidity: 46.00 %
Pressure: 1002.38 hPa
Altitude: 90.90 m

The first four lines print the bare numbers, the second four add their units, and the block repeats about once a second. The labels are the example's own, so the shape is exact. The numbers are an illustrative sample for Osijek, Croatia: about 23 °C, 46 % relative humidity and 1002.4 hPa. Against the library's 1013.25 hPa reference that pressure works out to about 90 m, close to Osijek's own elevation. Your readings depend on your room and the weather.

5. If it does not work​

Continue with Troubleshooting and retry this smallest example after each change.