avaldebe / PyPMS

Data acquisition and logging for Air Quality Sensors with UART interface
https://avaldebe.github.io/PyPMS/
MIT License
29 stars 8 forks source link

Support the BME680 sensor on a MCU680 module #5

Closed avaldebe closed 4 years ago

avaldebe commented 4 years ago

BME680 sensor

The BME680 sensor from Bosh 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:

MCU680 module

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.

Serial communication

Under factory settings, the serial protocol is UART 9600 8N1 (3.3V/5V TTL). The alternative 115200 BAUD rate will not be not supported.

Commands

Message format

Under the factory settings, the module provides 7 values packed on a 20 bit message. The following hexdump (xxd -g1 -c20) shows one message per line

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..............

to do