Pete Coles
Published

SB Components Micro RP2040 interfacing with BME280 breakout

Extracting Humidity, pressure, and temperature sensor data, generated by BME280 controlled by the master Micro RP2040 board.

BeginnerProtip125
SB Components Micro RP2040 interfacing with BME280 breakout

Things used in this project

Hardware components

Micro RP2040
SB Components Micro RP2040
×1
BME280 Breakout - Temperature, Pressure, Humidity Sensor
SB Components BME280 Breakout - Temperature, Pressure, Humidity Sensor
×1

Software apps and online services

Thonny IDE

Story

Read more

Code

BME280 Code

MicroPython
from machine import Pin, I2C
import time
import bme280  # Library for BME280 sensor

# I2C pins on Raspberry Pi Pico
i2c = I2C(1,scl=Pin(27),sda=Pin(26))  # Pin 3 = SCL (GP1), Pin 2 = SDA (GP0)
# BME280 I2C address (check your sensor's address with an I2C scanner)
bme280_address = 0x76

# Initialize the BME280 sensor
bme = bme280.BME280(i2c=i2c, address=bme280_address)

while True:
    # Read the sensor data
    print(bme.sensor_data)
    time.sleep(1)

Credits

Pete Coles
4 projects • 0 followers
YouTube Content Creator Robotics Enthusiast
Contact

Comments

Please log in or sign up to comment.