Project progress

Connect and use the SGP30 and ENS160

Connect the BME688, ENS160 and SGP30 in series and conduct odour detection tests.

Enhancing Data Stability and Feature Extraction in Odour Discrimination Using Sensors

Questions regarding the project

Connect SGP30

Part.01

Connect ENS160

Part.02

Combine the code for the BME688, ENS160 and SGP30 to facilitate simultaneous data monitoring.

First testing

Are the values detected for the same object consistent across different containers? Does this affect the experimental data?

plastic bag

A 10cm-tall glass bottle

A 20cm-tall glass bottle

Conclusions of the first test

1.The lack of environmental control has resulted in unstable data:

Temperature/Humidity Gradients: The self-heating effect inherent in sensor modules (particularly the BME688), combined with minute variations in the external environment and the influence of the odour source itself (such as the evaporation of coffee liquid) on local humidity, can generate significant fluctuations in temperature and humidity within this small container.

Consequences: MOX sensor readings are highly sensitive to temperature and humidity, with minor environmental shifts causing drift in readings and preventing the establishment of a reliable baseline.

Uncontrolled Airflow: When sensors are positioned at the container opening or within the container, ambient air currents (such as room ventilation or foot traffic) can introduce or remove odour molecules at any time. This causes fluctuations in odour concentration around the sensor, resulting in varying measured concentrations for the same odour sample at different time points.

2. Inconsistent Odour Concentration:

Saturation and Overloading: Placing the sensor directly above a high-concentration odour source readily leads to sensor saturation. Once saturated, the sensor cannot distinguish higher odour concentrations, and its recovery time (‘Clean-up’ Time) becomes excessively prolonged, compromising subsequent measurements.

Source Decay: Over time, the VOC release from the odour source itself (e.g., lemon peel) naturally diminishes, or the evaporation rate of liquids (e.g., whisky, coffee) alters. This results in inconsistent sample concentrations collected at different time points.

3. System Exposure and Contamination:

External Contamination: Your entire system—including the Raspberry Pi and connecting cables—is exposed to the odour environment. When testing lemon after coffee, residual coffee odour molecules may adsorb onto the sensor module, plastic container, or even the Pi's mainboard, causing cross-contamination that compromises subsequent readings' accuracy.

Inadequate Purging: Between measurements, merely removing the sensor does not immediately disperse residual odour molecules surrounding it. This leads to baseline drift, resulting in differing “zero points” at the start of each subsequent measurement.

Solutions

1. Constructing the sampling chamber

2.The introduction of the high-precision SHT45 sensor provides temperature and humidity compensation for the ENS160 and SGP30.

3.Use of activated carbon for air purification/baseline recovery

Use the SHT45 and update the code

Prepare the experimental tools

Experimental photo

Experimental Procedure

cold coffee test video

Whiskey test video

Activated carbon adsorbs odours

Ensure the gas within the container is clean

Experimental data collection

Part.03

Issues encountered following data collection:

Data drift (significant variations in the same odour when tested at different times)

Data stabilization method

1. Employed SoftEMA (Soft Exponential Moving Average) to preserve genuine odour responses by eliminating sudden spike noise.

2. Utilised Absolute Difference to quantify the intensity of odour signal variation (amplitude of fluctuation). This reflects differences between odours in response speed, rate of concentration change, and volatility characteristics.

Data feedback after updating the code

This is a comparison chart derived from newly measured coffee data.

The comparison demonstrates that SoftEMA effectively enhances signal stability.

Meanwhile, Absolute Difference captures the dynamic characteristics of aroma (distinguishing phases of intense aroma fluctuation from periods of balanced or stable aroma).

Different gases can be distinguished by their respective Absolute Difference values.

Issues

During repeated testing of whisky, it was discovered that spirits with excessively high alcohol content cause sensor readings to remain fixed at a constant value for extended periods without fluctuation. This results in sensor saturation and cessation of responsiveness.

Solution: Replace with a wine of lower alcohol content for further testing.(Preparing for testing)

Part.04

Questions

1. Regarding the choice of container, will the operational specifications affect the numerical values?

Should the object requiring testing be placed in the sampling chamber first, left for several minutes, and then the sensor introduced? Or should the sensor be placed first to preheat the air, followed by the object requiring testing?

2.The Wekinator on the Raspberry Pi collects data in real time and feeds it to ComfyUI, but the Raspberry Pi 4 lacks sufficient memory and graphics capabilities to support such a large image generation model. How can data from the Raspberry Pi be transmitted in real time to the Wekinator running on a Mac computer?

3.Considering computational performance, which image generation model would yield better results: diffusion models, GANs, or transformers? Are there any open-source image generation models recommended for Mac systems?