Sensors: BME680
Contents
BME680
Bosch Sensortec c routines
Download the drivers
git clone https://github.com/BoschSensortec/BME680_driver.git git clone https://github.com/twartzek/bme680-raspberry.git
Copy or move the raspberry pi code to the BME69-680_+driver directory.
cp bme680-raspberry/* BME680_driver/
Compile
gcc bme680_main.c bme680.c -o bme680
Wiring Adafruit
Note that this pin out is only for the Hive Interface boards ver 1.0. The wiring will be slightly different for the ver 0.3 boards and earlier.
H2 I2C Bus ver 1.0 | Adafruit break out board | |
---|---|---|
Pin | Signal | BME680 |
1 | +3.3 | VIN |
2 | I2C | SDI |
3 | I2C | SCK |
4 | NC | |
5 | Ground | GND |
Test
./bme680 **** BME680 start measurements **** 2018-07-05 13:27:40 T: 25.14 degC, P: 942.12 hPa, H: 74.29 %rH, G: 8029 Ohms 2018-07-05 13:27:43 T: 25.13 degC, P: 942.12 hPa, H: 74.29 %rH, G: 9043 Ohms 2018-07-05 13:27:46 T: 25.11 degC, P: 942.10 hPa, H: 74.38 %rH, G: 9976 Ohms **** Measurement finished ****
Oops! Looks like we have a problem with the temperature readings going to zero. Notice that the pressure reading shifts about 60 hPa and rH shifts about 4% when the temperature goes to zero. Maybe try the SPI interface?
No. Seems to be a timing problem in reading the temperature sensor. It works fine on a Pi B+. I think the other sensors shift because the temperature is used to compensate them.
These bad reading were run on a Pi3B+:
**** BME680 start measurements **** 2018-07-05 14:28:38 T: 23.37 degC, P: 942.85 hPa, H: 84.02 %rH, G: 186746 Ohms 2018-07-05 14:28:41 T: 23.37 degC, P: 942.87 hPa, H: 84.05 %rH, G: 211715 Ohms 2018-07-05 14:28:44 T: 23.37 degC, P: 942.85 hPa, H: 84.06 %rH, G: 223194 Ohms **** Measurement finished **** **** BME680 start measurements **** 2018-07-05 14:28:53 T: 0.00 degC, P: 905.57 hPa, H: 80.40 %rH, G: 186007 Ohms 2018-07-05 14:28:56 T: 0.00 degC, P: 905.57 hPa, H: 80.41 %rH, G: 212125 Ohms 2018-07-05 14:28:59 T: 0.00 degC, P: 905.57 hPa, H: 80.41 %rH, G: 223043 Ohms **** Measurement finished **** **** BME680 start measurements **** 2018-07-05 14:29:08 T: 0.00 degC, P: 905.59 hPa, H: 80.46 %rH, G: 185797 Ohms 2018-07-05 14:29:11 T: 0.00 degC, P: 905.61 hPa, H: 80.45 %rH, G: 212261 Ohms 2018-07-05 14:29:14 T: 0.00 degC, P: 905.61 hPa, H: 80.43 %rH, G: 223497 Ohms **** Measurement finished **** **** BME680 start measurements **** 2018-07-05 14:29:23 T: 23.35 degC, P: 942.87 hPa, H: 84.19 %rH, G: 186640 Ohms 2018-07-05 14:29:26 T: 23.35 degC, P: 942.87 hPa, H: 84.20 %rH, G: 213361 Ohms 2018-07-05 14:29:29 T: 23.35 degC, P: 942.87 hPa, H: 84.18 %rH, G: 223497 Ohms **** Measurement finished **** **** BME680 start measurements **** 2018-07-05 14:29:39 T: 23.35 degC, P: 942.87 hPa, H: 84.23 %rH, G: 186428 Ohms 2018-07-05 14:29:42 T: 23.36 degC, P: 942.87 hPa, H: 84.19 %rH, G: 213361 Ohms 2018-07-05 14:29:45 T: 23.36 degC, P: 942.89 hPa, H: 84.03 %rH, G: 223043 Ohms **** Measurement finished **** **** BME680 start measurements **** 2018-07-05 14:29:54 T: 0.00 degC, P: 905.55 hPa, H: 80.39 %rH, G: 186640 Ohms 2018-07-05 14:29:57 T: 0.00 degC, P: 905.55 hPa, H: 80.46 %rH, G: 211715 Ohms 2018-07-05 14:30:00 T: 0.00 degC, P: 905.53 hPa, H: 80.49 %rH, G: 224105 Ohms **** Measurement finished ****
These reading were run on a Pi B+:
2018-07-06 18:46:01 T: 22.71 degC, P: 939.45 hPa, H: 87.01 %rH, G: 30935 Ohms 2018-07-06 18:51:02 T: 22.70 degC, P: 939.40 hPa, H: 87.06 %rH, G: 31165 Ohms 2018-07-06 18:56:03 T: 22.70 degC, P: 939.32 hPa, H: 87.12 %rH, G: 31469 Ohms 2018-07-06 19:01:03 T: 22.69 degC, P: 939.30 hPa, H: 86.99 %rH, G: 31398 Ohms 2018-07-06 19:06:04 T: 22.69 degC, P: 939.26 hPa, H: 87.11 %rH, G: 31493 Ohms 2018-07-06 19:11:04 T: 22.68 degC, P: 939.12 hPa, H: 87.02 %rH, G: 31446 Ohms
PiMoroni Python driver
Install
curl https://get.pimoroni.com/bme680 | bash
Test
cd /home/pi/Pimoroni/bme680/examples cp read-all.py bme689.py vi bme689.py