Skip to content

Latest commit

 

History

History
143 lines (103 loc) · 5.81 KB

mcu680.md

File metadata and controls

143 lines (103 loc) · 5.81 KB

Bosch Sensortec sensors

BME680

=== "sensor"

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][library],
    which can be installed using the [platformio library manager][platformio] as follows:

    ```bash
    pio lib install "BSEC Software Library"
    ```

=== "module"

The [GY-MCU680v1][banggood] 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.

=== "commands"

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

=== "MCU680"

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

=== "extra config"

The [MCU680] can be further configured with the following commands:

| Description      | `message`                                  | note                                     |
| ---------------- | ------------------------------------------ | ---------------------------------------- |
| select output    | `A5 55 XX YY`                              |                                          |
|                  | `#!python XX |= 0x01`                      | temperature                              |
|                  | `#!python XX |= 0x02`                      | relative humidity                        |
|                  | `#!python XX |= 0x04`                      | atmospheric pressure                     |
|                  | `#!python XX |= 0x08`                      | IAQ accuracy                             |
|                  | `#!python XX |= 0x10`                      | gas resistance                           |
|                  | `#!python XX |= 0x20`                      | altitude estimate                        |
|                  | `#!python YY = (0xA5 + 0x55 + XX) % 0x100` | message checksum                         |
| output all data  | `A5 55 3F 39`                              | factory setting                          |
| 115200 BAUD rate | `A5 58 01 FE`                              | :material-alert: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

=== "info"

About the MCU680 sensor (`-m MCU680`)

``` bash
pms -m MCU680 info
```

``` man
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
```

=== "serial"

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

``` bash
pms -m MCU680 -n 10 -i 10 serial
```

``` csv
--8<-- "MCU680.txt"
```

=== "csv"

Print on CSV format (`-f csv)`

``` bash
pms -m MCU680 -n 10 -i 10 serial -f csv
```

``` csv
--8<-- "MCU680.csv"
```

=== "hexdump"

Print on hexdump format (`-f hexdump`)

``` bash
pms -m MCU680 -n 10 -i 10 serial -f hexdump
```

``` hexdump
--8<-- "MCU680.hexdump"
```