Visualizing Smells in a Room with an AI-Powered Nose and Light Painting

See how Chris Hill built a wearable device that allows users to see the scents around them with simple components and a camera.

The sense of smell

Our ability to sense thousands of smells is incredible, as it allows us to pick up on the strong scent of something like cologne all the way to very subtle smells. But Chris Hill wanted to take this concept even further by creating a system that could translate both the intensity of certain smells and where they're located into a visible map.

Components

To accomplish this, Hill based his circuit off of Shawn Hymel's AI Nose project, which incorporates various gas sensors into a sensor fusion input for a machine learning model. Hill selected the Grove Multichannel Gas Sensor module, which uses a MEMS gas sensor to measure the concentrations of carbon monoxide, nitrogen dioxide, ethyl alcohol, and volatile organic compounds (VOCs), such as essential oils and solvents, all sent over the I2C bus. The data is fed into a Seeed Studio Wio Terminal due to its powerful processor, suite of connectivity options, and built-in TFT screen at the top.

Gathering scent data

After connecting the gas sensor to the Wio Terminal, Hill loaded a simple sketch onto the board, which takes periodic measurements from the module and outputs the results over serial. While this process is running, the host computer executes a Python script that reads the incoming data, parses it, and then appends each line to a CSV file with the name of the desired class. The files were then scaled in a Google Colab notebook by a second Python script before being uploaded to a new Edge Impulse project.

Training a model

The impulse for this AI nose project involves taking the time-series data from the many CSV files, breaking it up into sections, flattening the various sensor values into a single axis, and then passing those features to both a Keras classification neural network and an anomaly detection algorithm. The trained model was then able to successfully differentiate between Creed cologne, eucalyptus oil, and the ambient room's smell with impressive accuracy, whereas the anomaly detection model would recognize any new or unusual smells.

Assembly

In order to mount the Wio Terminal onto a wrist compression glove, Hill designed several 3D-printed custom parts that hold the device in-place. The top cover also has a secondary function, as it contains a cutout for the screen that reshapes it into a circle rather than a rectangle. Power is provided by an external portable battery bank, which is held in-place by an armband. Last of all, Hill 3D-printed a plastic nose that fits over the gas sensor, thus letting him wave it around the room to pick up any stray scents.

Visualizing smells

With everything now set up, Hill embarked on the final step of creating scent maps. Nose in-hand, he gently swept it over a box containing a sample of cologne that had been left to diffuse its volatile organic compounds into the surrounding air. Any change in the smell's intensity would change both the color and brightness of the screen, therefore causing the pattern of light to vary over time. And all of this was picked up by a DSLR set to a long exposure time, creating a series of captivating light paintings. To read more about this project, you can view Hill's write-up.

Evan Rust
IoT, web, and embedded systems enthusiast. Contact me for product reviews or custom project requests.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles