uThing::VOC

image

Description

uThing::VOC™ is an easy-to-use, Open-Source USB air-quality sensor dongle that integrates the Bosch BME680™ MEMS sensor.

The gas sensor within the BME680 detects a range of gases to measure the Indoor Air Quality Index (IAQ).

Gases that can be detected include Volatile Organic Compounds (VOC) from paints (such as formaldehyde), lacquers, paint strippers, cleaning supplies, furnishings, office equipment, glues, adhesives and alcohol.

These are the sensor data outputs generated by the dongle:

Output data points:

  • Estimated Ambient Temperature [°C]
  • Relative Humidity [% RH]
  • Sensor raw resistance [Ω]
  • Atmospheric pressure [hPa]
  • Air Quality Index (IAQ) [0-500]
  • IAQ accuracy [0-3]
  • Equivalent CO2 ("eCO2") [p.p.m.]
  • Equivalent "breathVOC"

The integrated STM32F072CB MCU (ARM Cortex®-M0) from STMicroelectronics captures raw data from the integrated sensors over the I2C port and uses Bosch's proprietary Air-Quality calculation algorithms (BSEC) to obtain the final values. These values are then output over a simple Virtual Serial Comm (VCP) on the USB connector in the configured format (JSON, CSV or human-readable).

Block diagram

The figure below shows a block diagram of the board:

image

An LDO regulator is used to convert the USB 5V power into 3.3V, used to power the MCU and BME680 sensor. Two LEDs are used to display the status of the sampling process. The PCB exposes a series of pins from the MCU into solderable pads. These pads can be used to expand the board functionalities by using either the USB or SWD ports to program a custom firmware image.

Detail of the main components and exposed pads:

image
image
The LEDs are used to indicate different measurement status.

Check this section for more details about the hardware.

Output formats

As in all the uThing™ devices. The board outputs all the calculated sensor data in JSON format by default. JSON allows a seamesless integration with a multitude of backend and frontend applications.

During an initial evaluation, a more "human-friendly" format can be easily configured (which includes the output units for an initial understanding of the generated data).

For applications where a simple mean for data-logging is needed, the board can be configured to output the data in CSV format (comma separated values).

Here it's an example of the three output formats:

1
Temperature: 24.70 C, Pressure: 1019.38 hPa, Humidity: 45.12 rH, Gas resistance: 599759 ohms, IAQ: 27.1, IAQ Accuracy: 3, CO2equivalent: 507.1, Breath VOC equivalent:  0.51
1
{"temperature": 24.68, "pressure": 1019.38, "humidity": 45.64, "gasResistance": 597617, "IAQ": 28.3, "iaqAccuracy": 3, "eqCO2": 511.21, "eqBreathVOC": 0.52}
1
2
#Columns: [temperature], [pressure], [humitidy], [gasResistance], [IAQ], [accuracy], [eqCO2], [eqBreathVOC]
24.65, 1019.42, 46.23, 597617, 26.9, 2, 506.7, 0.51,

This section details the sensor output and data formats.

Configuration

The device supports 2 main ways of configuration:

  • Interactive: with a terminal connected to the VCP, simple one-character commands change the behaviour of the device (changing output format, reporting frequency, etc.)
  • JSON objects: to keep consistency with the JSON output formats, JSON objects can be sent to the device to query and modify the configuration (turn-on/off leds, calibrate temperature offset, etc.)

For a detailed description of the configuration options check this section

Compatibility

The device can be used with any USB capable host (laptop, embedded PCs, gateways, Android devices, etc.).

The firmware running in the STM32F072 MCU integrates a standard USB-CDC (Communication Device Class).

USB-CDC (VCP)

The USB CDC is a generic composite class that can include more than one interface such as a custom control interface, data interface, audio, or mass storage related interfaces.

In particular, this application uses the CDC-ACM (Abstract Control Mode) to emulate a serial port. This implementation is also known as USB VCP (Virtual Communications Port).

The USB VCP interface is supported “out-of-the-box” in Linux, MacOS and Windows systems without the need of any extra driver installation since this driver comes integrated by default in those operating systems.