This smart person used a Raspberry Pi to make an electronic nose – Geek review

Mendoza's odor gas sensor, made with a Raspberry Pi 3
Luis Rodriguez Mendoza

People use Raspberry Pis to make lots of creative and unique gadgets, but this one could take the cake. Or rather, smell it. Creator Luis Rodriguez Mendoza was inspired by dogs trained to sniff at the airport, so he wondered if low-cost gas sensors could do the same thing.

We see a huge variety of sensors, such as those that can detect noise, temperature, humidity or light, used every day for a variety of tasks, but gas sensors are far less common. The use of sensors to actively “smell” scents in the near environment, rather than just passively detecting a scent, is even less common.

Mendoza said that “the aim of the project is to demonstrate that low-cost sensors can be reliable in detecting odors and that they can eventually be used in clinical settings.” It used only four types of gas sensors to perform extensive testing and model training.

“The tests were performed using samples of brewed beer and coffee,” he said when asked about his testing process. “A K-Nearest Neighbors (KNN) algorithm was used in MATLAB to create a classification model that was used to predict the aromas of beer and coffee and was validated using 10-fold (k-fold) cross-validation. .. 98 percent classification accuracy was achieved in the testing process.

“Each sample was taken, on average, for 15 minutes at one-second intervals, yielding over 900 sample reads per test, and the data was exported to CSV files. For classification purposes, an additional column was manually added to label the sample (e.g. coffee, beer, air). The three datasets were imported and combined in MATLAB. This data was used to create a closer k-neighbor model, k was selected to be 5, this was determined by trial and error. A 10-fold cross-validation was used to validate the model, and a Principal Component Analysis (PCA) was used as an exploratory technique to verify the model and results, similar to the work shown in past research.

Principal component analysis chart from Mendoza test data
Luis Rodriguez Mendoza

“A test dataset was collected by taking 17 new samples of two-minute reads at one-second intervals to evaluate the classification model. Each sample was independent of each other (only air, beer or coffee were measured at a time) and were manually tagged accordingly, resulting in over 2500 measurements. This data was imported, combined, and rearranged randomly in MATLAB. Using the classification model created from the training dataset, the test data was classified and the classification model results represent 97.7% accuracy. “

The high overall accuracy produced by the individual test subjects is truly impressive. Mendoza used a Raspberry Pi 3 for testing and said he first learned about the device in late 2020 at one of his college courses. “I quickly realized how easy, efficient and capable Raspberry Pi boards are,” he said.

through The MagPi


Please enter your comment!
Please enter your name here