Skip to content

Bosch Sensortec sensors

BME680

The BME680 sensor from Bosch Sensortec measures relative humidity, barometric pressure, ambient temperature and gas (VOC). The open source driver provides raw measurements, such as the resistance of the gas sensing element.

The heater element of gas sensor affects the temperature and humidity measurements. Compensated temperature and humidity measurements are available trough a closed source integration library (BSEC). The BSEC provides three air quality estimates derived from raw measurements:

  • index of air quality (IAQ, 0-500);
  • CO2 equivalent (eCO2, ppm);
  • breath VOC (bVOC), ppm).

Info

For easy of use BSEC is also provided as an Arduino library, which can be installed using the platformio library manager as follows:

pio lib install "BSEC Software Library"

The GY-MCU680v1 is a chinese module with an STM32F051K8 mirocontroller (μC) and 3.3V low-dropout regulator (LDO). The μC acts as UART bridge, providing BSEC outputs from the BME680 sensor.

The μC and sensor operate at 3.3V, but the module can be interfaced at 5V as UART pins on the STM32F051K8 are 5V tolerant. The module also breaks out the BME680 I2C pins, which are not 5V tolerant.

Protocol

Under factory settings, the serial protocol is UART 9600 8N1 3.3V/5V TTL.

Note

The alternative 115200 BAUD rate is not supported.

Command Description message
active_mode continuous operation A5 56 02 FD
passive_mode single-shot operation A5 56 01 FC
passive_read request last measurement A5 56 01 FC
sleep sleep mode
wake wake up from sleep mode

Under the factory settings, the module provides 7 values packed on a 20 bit message.

The MCU680 can be further configured with the following commands:

Description message note
select output A5 55 XX YY
XX |= 0x01 temperature
XX |= 0x02 relative humidity
XX |= 0x04 atmospheric pressure
XX |= 0x08 IAQ accuracy
XX |= 0x10 gas resistance
XX |= 0x20 altitude estimate
YY = (0xA5 + 0x55 + XX) % 0x100 message checksum
output all data A5 55 3F 39 factory setting
115200 BAUD rate A5 58 01 FE not supported
9600 BAUD rate A5 58 02 FF factory setting
save settings A5 5A 01 00 save current settings to flash and reset
reset settings A5 5A 02 01 restore factory settings

MCU680

About the MCU680 sensor (-m MCU680)

pms -m MCU680 info
Bosh Sensortec BME680 sensor observations

time                                    measurement time [seconds since epoch]
temp                                    temperature [°C]
rhum                                    relative humidity [%]
pres                                    atmospheric pressure [hPa]
IAQ_acc                                 IAQ accuracy flag
IAQ                                     index of air quality [0--500]
gas                                     gas resistance [kΩ]
alt                                     altitude estimate [m above sea level]

String formats: atm, bme (default), bsec, csv and header

Read 10 samples (-n 10), one sample every 10 seconds (-i 10)

pms -m MCU680 -n 10 -i 10 serial
2020-09-27 17:20:52: Temp. 24.3 °C, Rel.Hum. 27.6 %, Press 1012.57 hPa, 40.7 kΩ
2020-09-27 17:21:02: Temp. 24.2 °C, Rel.Hum. 27.6 %, Press 1012.53 hPa, 42.1 kΩ
2020-09-27 17:21:12: Temp. 24.2 °C, Rel.Hum. 27.6 %, Press 1012.53 hPa, 43.8 kΩ
2020-09-27 17:21:22: Temp. 24.2 °C, Rel.Hum. 27.6 %, Press 1012.55 hPa, 45.1 kΩ
2020-09-27 17:21:32: Temp. 24.2 °C, Rel.Hum. 27.6 %, Press 1012.55 hPa, 46.4 kΩ
2020-09-27 17:21:42: Temp. 24.2 °C, Rel.Hum. 27.7 %, Press 1012.51 hPa, 47.6 kΩ
2020-09-27 17:21:52: Temp. 24.1 °C, Rel.Hum. 27.7 %, Press 1012.51 hPa, 49.0 kΩ
2020-09-27 17:22:02: Temp. 24.1 °C, Rel.Hum. 27.7 %, Press 1012.51 hPa, 50.0 kΩ
2020-09-27 17:22:12: Temp. 24.1 °C, Rel.Hum. 27.7 %, Press 1012.53 hPa, 51.4 kΩ
2020-09-27 17:22:22: Temp. 24.1 °C, Rel.Hum. 27.7 %, Press 1012.51 hPa, 52.4 kΩ

Print on CSV format (-f csv)

pms -m MCU680 -n 10 -i 10 serial -f csv
time, temp, rhum, pres, IAQ_acc, IAQ, gas, alt
1601220052, 24.3, 27.6, 1012.57, 1, 25, 40.7, 5
1601220062, 24.2, 27.6, 1012.53, 1, 25, 42.1, 5
1601220072, 24.2, 27.6, 1012.53, 1, 25, 43.8, 5
1601220082, 24.2, 27.6, 1012.55, 1, 25, 45.1, 5
1601220092, 24.2, 27.6, 1012.55, 1, 25, 46.4, 5
1601220102, 24.2, 27.7, 1012.51, 1, 25, 47.6, 6
1601220112, 24.1, 27.7, 1012.51, 1, 25, 49.0, 6
1601220122, 24.1, 27.7, 1012.51, 1, 25, 50.0, 6
1601220132, 24.1, 27.7, 1012.53, 1, 25, 51.4, 5
1601220142, 24.1, 27.7, 1012.51, 1, 25, 52.4, 6

Print on hexdump format (-f hexdump)

pms -m MCU680 -n 10 -i 10 serial -f hexdump
00000000: 5a 5a 3f 0f 09 7d 0a c4 01 8b 89 00 19 00 00 9e f2 00 05 19  ZZ?..}..............
00000014: 5a 5a 3f 0f 09 79 0a c5 01 8b 85 00 19 00 00 a4 83 00 05 a9  ZZ?..y..............
00000028: 5a 5a 3f 0f 09 76 0a c8 01 8b 85 00 19 00 00 ab 32 00 05 5f  ZZ?..v..........2.._
0000003c: 5a 5a 3f 0f 09 74 0a c8 01 8b 87 00 19 00 00 b0 27 00 05 59  ZZ?..t..........'..Y
00000050: 5a 5a 3f 0f 09 72 0a c9 01 8b 87 00 19 00 00 b5 33 00 05 69  ZZ?..r..........3..i
00000064: 5a 5a 3f 0f 09 70 0a d0 01 8b 83 00 19 00 00 ba 05 00 06 42  ZZ?..p.............B
00000078: 5a 5a 3f 0f 09 6f 0a d2 01 8b 83 00 19 00 00 bf 71 00 06 b4  ZZ?..o..........q...
0000008c: 5a 5a 3f 0f 09 6e 0a d0 01 8b 83 00 19 00 00 c3 6e 00 06 b2  ZZ?..n..........n...
000000a0: 5a 5a 3f 0f 09 6c 0a cf 01 8b 85 00 19 00 00 c8 ee 00 05 35  ZZ?..l.............5
000000b4: 5a 5a 3f 0f 09 6a 0a d0 01 8b 83 00 19 00 00 cc b0 00 06 f9  ZZ?..j..............