Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

BME280 temperature, pressure and humidity sensor with Raspberry Pi

I have written a small procedure to read the Bosch BME280 sensor through the Raspberry Pi. The sensor reading is performed via I2C bus interface.

 

The procedure performs the following steps:

0. Opens the I2C channel.

1. Reads the BME280 Calibration Coefficients. First reads the Calibration Registers, than converts the Registers to Raw Calibration Coefficients.

2. Initializes the BME280 device for operation in 'Normal mode'. The normal mode is a perpetual cycling of measurements and inactive periods.

3. Cyclically reads the data registers from the BME280 device and converts them in calibrated Pressure, Temperature and Humidity measures.

4. Closes the I2C channel.

 

The VI routine named RPi_I2C_BME280_read_example.vi contains an example of the reading procedure of the BME280 sensor through the I2C bus.

 

The RPi_I2C_BME280_read_example.vi block diagram

RPi_i2c_BME280_read_Example.png

 

 

If someone is interested the code is available on github at:

https://github.com/Asperfi/Raspberry-Pi_BME280

 

 

For my work I took inspiration from the following sources:

Message 1 of 2
(195 Views)

Thank you very much, very useful and great work. The code can be easily adapted for use with an Arduino instead of a Raspberry.

0 Kudos
Message 2 of 2
(101 Views)