10-25-2021 12:34 PM
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
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:
11-05-2021 03:53 PM
Thank you very much, very useful and great work. The code can be easily adapted for use with an Arduino instead of a Raspberry.
03-20-2022 10:51 AM
Hello,
I would also use the BME280 with Arduino, but I am struggling with the code. Could you share an example with me?
03-20-2022 02:27 PM
See files as example for read BME280 sensor with Arduino.