Wiring guide

How to wire a BMP280 to a Raspberry Pi Pico

To wire a BMP280 to a Raspberry Pi Pico, connect VIN to 3V3(OUT), GND to GND, SCL to GP5 (physical pin 7) and SDA to GP4 (physical pin 6). The Raspberry Pi Pico and the BMP280 are both 3.3 V parts, so this is the simplest wiring there is: no regulator and no level shifter. The sketch below uses the Adafruit BMP280 (Adafruit_BMP280.h) library. It prints the temperature, the pressure and an altitude estimate.

  • 3.3 V logic
  • Library: Adafruit_BMP280.h
  • 4 wires
Raspberry Pi Pico · BMP280live0.000 s 0.00x
Click to open it in the editor
The circuit itself, running on the simulator with the sketch below. Press what can be pressed; click anything else to open it in the editor.
Pin to pin

BMP280 to Raspberry Pi Pico wiring table

Every wire in the circuit above, with the part’s pin names and the board’s own labels. The wire colors are the ones the circuit uses; on a real bench any colors work.

BMP280 pinRaspberry Pi Pico pinWire colorWhy
VIN3V3(OUT)redThe BMP280 chip is a 3.3 V part; many breakouts have no regulator.
GNDGNDblueCommon ground.
SCLGP5 (physical pin 7)cyanI2C clock.
SDAGP4 (physical pin 6)violetI2C data.
Voltage

Power and logic levels for BMP280 and Raspberry Pi Pico

Logic level

The Raspberry Pi Pico’s GPIO pins are 3.3 V logic and are not 5 V tolerant. Nothing wired to a pin may go above 3.3 V.

Supply

The BMP280 takes 3.3 V from 3V3(OUT). That pin is the Raspberry Pi Pico’s own regulated 3.3 V output.

This pair

On the Pico, Wire.begin() puts SDA on GP4 and SCL on GP5, physical pins 6 and 7. The Raspberry Pi Pico and the BMP280 are both 3.3 V parts, so this is the simplest wiring there is: no regulator and no level shifter.

Pins to leave alone

The numbers in the code are GP numbers, not the physical pin numbers printed beside the header: GP15 is pin 20. GP23 to GP25 are used on the board itself, and GP25 is the LED.

The sketch

The working code for the Raspberry Pi Pico

Library: Adafruit BMP280 (Adafruit_BMP280.h). This is the sketch the circuit above runs.

BMP280 on Raspberry Pi Pico I2C
#include <Wire.h>
#include <Adafruit_BMP280.h>

Adafruit_BMP280 bmp;   // on I2C: SDA GP4 (physical pin 6), SCL GP5 (physical pin 7)

void setup() {
  Serial.begin(115200);
  if (!bmp.begin(0x76)) {
    Serial.println("No BMP280 at 0x76");
    for (;;) {}
  }
  Serial.println("BMP280 found");
}

void loop() {
  Serial.print("Temperature: ");
  Serial.print(bmp.readTemperature(), 1);
  Serial.print(" C  Pressure: ");
  Serial.print(bmp.readPressure() / 100.0F, 1);
  Serial.print(" hPa  Altitude: ");
  Serial.print(bmp.readAltitude(1013.25), 0);
  Serial.println(" m");
  delay(1000);
}
Output

What you should see

Open the serial monitor at 115200 baud. The sketch prints BMP280 found and then a line with the temperature in degrees C, the pressure in hectopascals and the altitude. The sensor starts at 22 degrees C and about 1013 hPa.

If it prints that no sensor was found, the address is the first thing to check: this circuit answers at 0x76, and some breakouts use 0x77.

The serial monitor prints this, recorded from the circuit above left at its defaults:

BMP280 found
Temperature: 22.0 C  Pressure: 1013.3 hPa  Altitude: -0 m
Pitfalls

Common mistakes wiring a BMP280 to a Raspberry Pi Pico

The wrong address

Adafruit’s own board answers at 0x77, the cheap purple ones at 0x76, and bmp.begin() with no argument tries 0x77. If it fails, try the other address before suspecting the wiring.

Powering it from VBUS (5 V from USB)

A breakout without a regulator is a bare 3.3 V chip: 5 V on VIN can kill it. Use 3V3, which on this board is also the right level for I2C.

Confusing it with a BME280

The BME280 looks the same and adds humidity. A BMP280 reports a chip ID of 0x58, a BME280 0x60, and each library refuses the other. If begin() fails at both addresses, check which chip you have.

Build your own BMP280 project

Open this circuit in the editor, change the wiring or the code, and keep your version in a free account.