Introduction

Have you ever heard about dogs smelling cancer, or about the women who could smell parkinsons I thought this was awesome. And I realized that I have never seem an artificial smelling machine device that is meant for biochemicals. So I decided that I was going to make it. And it was going to look like my nose.
MIT has done some work with artificial sensors. Specificially Leo has pointed me towards Nick Lal who has done a talk about artifical sensing recently. For the actual act of biosensing I was thinking about using low power machine learning, meaning have a pretrained ML model on the device with some type of sensor.
In order to get the smell to the sensor I was thing of either using some fan system or I found some really cool videos of ionic thrusters. These devices use electricity to blow and push air. It is usually used at a very high voltage and used for like jet engines but in this case I would use it to blow air towards my sensor.
Some problems I foresee coming across is the actual act of training some sensor/finding a sensor appropriate for my device. Another problem I see is that I will make the device too good and make millions of dollars from it.

Making gas sensor holder

The form-factor of the holder for the sensors is important because it not only needs to get the gas and spread it across the different sesnors, but it also needs to deal with the heat of the sensors. I started by making a holder for a single sensor which incorporated screw holes. I think this was a good start but the issue is now to incorporate the 6 sensors I am going to be using and also the fan I am going to use for the gas. I see a problem because 3D printing a case might be hard because of the way 3D printing works with extrusions being the gas sensor.

Edge Impulse

I am going to use this website as a guide for how to take my data and get a model as an output. I am going to be using a regression model rather than a classification model. A regression model gives a number/percentage out rather than a word. Classification outputs words. I want to focus on biochemicals. So I believe at first I want to choose 1 biochemical and see the differences in smell of the concentration of that biochemical.

Designing a Holder

In the final product I wanted to put it in a device that looks like my nose. But for the trainings I wanted to make something that could hold all of the sensors I would be using, and have a fan blowing away to create a vaccuum that would pull smells. For this I jsut printed a hexagon because I am using 6 sensors with a space on top for a fan.
When planning out the CAD in my head, I was so happy to find that I was able to model it in my head quickly so that when I went to fusion it did not take me that long to make a file that I could 3D print. This is a huge step from where I was in the beginning of the semester and even from week 5 where I feel like I made my best model ever.

Coffee vs. Cinnamon

After printing the case, and putting all 6 sensors in their positions I was ready to try using the nose. After plugging in all of the wire, which was a hastle. I realized it would be smart to print a small board that I could plug all the wires into and then have a space to connect to any board. As I continue to make different devboard.
I wanted to start the training on something easy. So I chose two smells that I knew were far apart coffee and cinnamon. On Shawn Hymel's Website he had used coffee and it had trained very well on it, meaning it was able to differentiate it easily. I believe this is because it is such a strong smell. I chose cinnamon because it had a distinctly strong smell as well. I wrote a script to get the data from all the sensors output in a format that when running another script at the same time, I would be able to get a CSV file for every output. I set my senor to be doing 4 senses a second and recorder for 4 seconds. I recorded for 2-3 minutes each different smell, this was based off of my conversation with Noah Duetch. After the output of those files. I used Shawn Hymel's python code, which I want to commendere and adjust to make my own, in order to process the data. Once the data was processed, I then went to edge impulse to start training the model. The I was able to choose how I wanted to create my model. I started by putting that I want to process the data more by flattening it. Then I chose I wanted to make a classification model, with anamoly detection with three outputs, background, coffee, and cinnamon. I then started uploading the processed data. The way the model works is that it splits up the data into the training set then a testing set. The training set is around 80% and the testing is around 20%. Then I let edge impulse run. After the model was created, I tested it on the test set and there was almost no errors between the coffee vs cinnamon vs background. Edge impulse was also able to make an arduino library, such that I can run the model on an arduino or microcontroller alternative. This was a great first success. The next start was to start using harder measurments, and a regression model. The next section I am going to go through trying to classify salt concentration in water. One issue I ran into was cord management. I also want to work on that for the next iteration

Salt Concentration

Now that the easy classification was done. It was time to move into something that I did not know would be successful. I was nervous because when smellling salt water it is hard for me to differentiate a lot vs a little salt. For the concentrations I chose 40,25,10, and 0. I originally wanted to do 100,75,50,25,0. But when I tried to make a concentration of 100%. I realized that there is a maximum concentration of salt that will disolve in water. This was frustrating but I was forced to adapt. 40 percent seemed to be the maximum of even a little past the maximum concentration that the salt would dissolve into. To get the concetrations I knew I was going to use 200ml of water. I then measured out the concentration by calculating the weight I needed of salt to get the correct concentration then measuring out the salt on a scale.
After doing the math the concentrations I got:
  1. 40p = 80 g salt, 200ml water
  2. 25p = 50 g salt, 200 ml water
  3. 10p = 20g salt, 200ml water
  4. 0p = 200ml water
In order to make the training go as smooth as possible, needed to add to the case I already made. I printed out a new case that would cover the original case and allow the wires to be pulled through. I changed the wire colors so that the groups would be the same colors, Ground, VCC, and Analog out. I then took heat shrink and wrapped them around the groups of wires I knew went together. The making of the case was pretty simple, I used Fusion 360 to model it.
The part that took much longer was the connection between the cup and the case. This took me 5 attempts. I failed for many reasons. The first reason the piece failed was because of my poor measuring skills, this is a constant throughout many of the iterations. I then did not make a rim for my cup, then for my holder. Then I finally got it correct. It fit really nicely
Next came the training:
  1. Run Nose DataCollection script for 4 minutes each data collection
  2. Then in terminal run python serial-data-collect-csv.py -p /dev/cu.usbserial-00000000 -b 115200 -d Folder Name -l File Name, make sure serial monitor is closed, which is a scirpt that takes the data from the arduino and turning them into CSV files. Name should just be a number if want to use recursion
  3. Put the data through the dataset processing script
  4. Go to edge impulse
  5. Go to data acquisition and imput the processed data
  6. Go to impulse design
  7. Change window to 250 ms
  8. Add a flatten block for processing block
  9. Choose Regression and Anomaly detection for learning block
  10. Hit Save impulse
  11. Go to flatten
  12. Deselect Skewness and Kurtosis and choose Save Parameters
  13. Click calculate feature importance then Generate Features
  14. Ideally go to EON Tuner to get parameters for NN Class
  15. From EON Tuner able to choose the node layout mine is using 30 -> 20 -> 10 -> 4 click start trainging
  16. Go to anamoly detection and choose RMS for all the inputs
  17. Go to model testing
  18. Click test and see how the data was trained
  19. Go to deployment and download in zip file
After trying to upload the library to run model on the ESP, there was a problem. Edge Impulse didn't make it easy to use the model with an ESP board, I had to upload firmware to the board to use the regression model. But after I uploaded the firmware all of the analog outputs became zero for some reason.

The Actual Nose

The next step was to make the device in the image of my nose. I plan to use blender and then make the stuff out of foam. Then use pressure heat press to make a plastic casing. I had seen people use blender before and it seemed so easy to mold the shape into whatever an imagination could think of. But after I got the hang of it I was able to get the shape that I wanted. I also needed to cut the nose up in order to cut it into the foam, the foam pieces. I tried cutting it out in blender the first time and I ended up cutting it wrong and was not able to go back to before I sliced it. So instead I exported it .stl file and uploaded it into fusion to cut.
After I cut the files, I used the shopbot to cut the foam.
I then used the hot wire foam cutter to cut out the shapes. I then taped the pieces together. Because I had poor resolution on my pieces I used plaster to try to make the nose look more noselike. After that I wrapped the nose in tinfoil and tape and was going to use the vacuum former.
While trying to vaccuum form tradgedy struck.
but with some friends help I was able to remake a the nose.
From there I tried to use composite, to make the case. This unfortunatly ended in failure as the apoxy did not set.

Takeaways from the project

This was a really fun project to work on. I learned so much about so many different aspects of digital fabrication and it also allowed me to see what working on a long term project felt and looked like. Coming into this class I wanted the skills to make prototypes/MVPs for ideas that I have and after finishing this class I believe I have the skills to do that.

I want to thank the Harvard TA's and other students for making this class unforgetable.