Circuits / Sensors
ESP32 with a BME280: temperature, pressure, humidity
An I2C sensor answers at its address on the board's SDA and SCL: begin(0x76) finds the usual board; readPressure() is in Pa, ÷ 100 is hPa; the altitude comes from the pressure

Tap a part to see its voltages and currents. It is a model, not a measurement.
What do you need?
- Development board ESP32 DevKitAliExpress Amazon
- Climate sensor (library) BME280AliExpress Amazon
- Jumper wires × 6AliExpress Amazon
- BreadboardAliExpress Amazon
The AliExpress links are affiliate links: if you buy through them ohmio.dev gets a commission, at no extra cost to you. Affiliate links
This page is a guide: the numbers come from a simulation, and real parts vary. Check your parts before you power the circuit. Safety and responsibility
How does an ESP32 read a BME280 over I2C?
The BME280 measures temperature, pressure and humidity and answers over two wires, SDA and SCL, that can be shared by several chips. This board is a 3.3 V one, so it takes the ESP32's 3V3 pin and the bus idles at 3.3 V. Each chip on the bus has an address. The sketch calls begin(0x76), the address with the board's SDO pin on GND; with SDO on VDD it is 0x77. Every second it prints, in the model at 22 °C, 45 %RH and 1013.25 hPa: T: 22.00 C P: 1013.25 hPa H: 45.00 % alt: 0.00 m. readPressure() returns pascals, so the program divides by 100 to print hPa. The altitude comes from pressure, taking 1013.25 hPa as sea level: 900 hPa prints alt: 988.67 m and 1050 hPa prints -301.57 m. If your board answers at 0x77, change begin(). Some cheap boards sold as BME280 carry a BMP280, with no humidity.
Values from the Protoboard ISO simulation: a model, not a bench measurement.
Hear about the next circuit
One email when a new circuit is out, about twice a month. Nothing else.