Source: https://mokxi.com/parts/bme280
Updated: 2026-11-10

Part

# Pressure, humidity and temperature, BME280

Temperature, humidity and air pressure as raw counts, and the datasheet sums that turn them into weather.

See every part

- 4 pins
- 4 settings
- In 3 projects
- In 1 lesson

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Pressure, humidity and temperature, BME280 in brief

What it is, and every setting the properties panel gives it.

The BME280 is Bosch’s pressure, humidity and temperature sensor, almost always bought on the purple GY-BME280 breakout with four pins: VIN, GND, SCL and SDA. The module has its own regulator and pull-ups, so VIN takes 3.3 or 5 V; on an Uno SDA and SCL go to A4 and A5, and on an ESP32 DevKit to GPIO 21 and 22. Its address is 0x76 on most purple boards, which is the part’s default, or 0x77 with the strap, where Adafruit’s library looks first. Mokxi models the register map from the datasheet: chip id 0x60 at 0xD0, raw twenty-bit counts plus the factory calibration a driver has to apply, sleep at power-up, forced and normal modes, measurement times from 8 ms at 1x oversampling to 113 ms at 16x, and the IIR filter. The temperature, pressure and humidity sliders are worked backwards into counts, so a correct driver reads them back. The classic mistake is begin() failing at the wrong address; in a hand-written driver it is humidity set in ctrl_hum, which only takes effect at the next ctrl_meas write. Noise, SPI mode and the humidity sensor’s slow response are not modeled.

Family

Sensors

Pins

4

address

118

temperature

22

pressure

1013.25

humidity

50

Pins

## 4 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

VIN

Supply. The module has its own regulator, so 3.3 V or 5 V.

GND

Ground.

SCL

I2C clock. The module carries the pull-ups.

SDA

I2C data.

How to use it

## How to use the BME280 with an Arduino or ESP32

Four wires: VIN to 3.3 V or 5 V, GND to GND, and SDA and SCL to the board’s I2C pins. The project here runs on an ESP32-C3, whose I2C pins are GPIO 8 for SDA and GPIO 9 for SCL, and puts a BME280 at 0x76 and a BMP280 at 0x77 on the same two wires: the address strap is what lets them share. The chip id at 0xD0 tells them apart, 0x60 for the BME280 and 0x58 for the BMP280.

With Adafruit_BME280, give begin() the address. Most purple boards are at 0x76 and the library looks at 0x77 unless told, so a bare begin() fails on them; it also fails on a BMP280, which has no humidity. The project instead runs the datasheet’s integer formulas itself, temperature first, because pressure and humidity both need its t_fine. Drag a pressure slider and the altitude moves about 100 m for every 12 hPa.

Part pin

Board pin

VIN

3.3 V (3V3)

GND

GND

SDA

GPIO 8

SCL

GPIO 9

On an Uno the module goes to A4 and A5 at 5 V, and on a classic ESP32 DevKit to GPIO 21 and 22; its regulator takes either supply.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

The Adafruit library, at the purple board’s address

How it is modeled

## What is true about the Pressure, humidity and temperature, BME280, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

The register map and the reset values: asleep at power-up, data registers at
0x80000 and 0x8000 until something is measured, im_update set for the 2 ms the
chip spends copying its coefficients. Forced mode takes one measurement and goes
back to sleep; normal mode measures, waits the standby time, and repeats. A
measurement takes the datasheet's typical time, from 8 ms at 1x oversampling to
113 ms at 16x, with measuring set while it runs.

ctrl_hum only takes effect at the next write to ctrl_meas , and humidity
oversampling left at 0 means no humidity at all: the register reads its reset value.
Both are straight from the datasheet and both catch people.

Resolution follows oversampling, 16 bits at 1x up to 20 at 16x, and the IIR filter
blends each result into the last, so a slider moved with the filter on is followed
smoothly rather than in a jump.

### Not modeled

Noise. A real reading wanders by a few pascals and a few hundredths of a degree,
which is what oversampling and the filter are for; here more samples change only the
time and the number of bits. The drivers use Bosch's 32-bit pressure formula, since
the smaller boards have no 64-bit multiply, and it reads a few pascals off the 64-bit
one. SPI mode, and so CSB and SDO as pins, are not modeled: this is the I2C
module. The humidity sensor's slow response to a change in the air is not modeled.

From BME280 and BMP280 pressure sensors, in full.

Projects

## See the Pressure, humidity and temperature, BME280 in a project

3 built-in projects use it. Each opens in the editor, already wired.

Lessons

## Where it turns up in a lesson

One lesson places it in its own circuit.

### Learn articles

1 lesson

- ESP32 I2C Pins: SDA 21, SCL 22, and Custom Pins

Boards

## The boards it is shown on

Each of these 2 boards has a built-in project with the Pressure, humidity and temperature, BME280 in it.

- ESP32-C3-DevKitM-1
- Arduino Uno R3

Boards

## The Pressure, humidity and temperature, BME280 on each board

The pins, the voltage and the code change from board to board. Each page has that board’s wiring and a circuit you can run.

- Arduino Uno and BME280
- ESP32 and BME280
- Arduino Nano and BME280

Libraries

## Arduino libraries for the Pressure, humidity and temperature, BME280

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

- BME280
- i2cdetect

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Pressure, humidity and temperature, BME280

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
