Drinking... For Science!!!
April 11th, 2014
So while browsing through cheap sensors off of eBay I managed to find a mq-3 ethanol sensor for about four dollars. About a month later the sensor finally came in and I was very excited to test how well it worked and mainly I wanted to create a breathalyzer. A couple weeks later I found some time one Friday evening so I created a simple program to read analog values from the sensor.
The sensor returned analog values of 0-1023, so after doing some research on the sensor I found plenty of information on blood alcohol content (BAC) and how many parts per million (ppm) of ethanol is found in ones breath. The problem I found in the research is that there are many different definitions of BAC and many variables effect the readings. Humidity and temperature are the big environmental variables that effect my analog values from my sensor and I had thought about trying to account for them in my code.
The next step was to make some device that could at least mitigate some of the environmental factors, or at least help the readings be somewhat consistent for each person. A quick (not too scientific) method was to put the sensor in a chamber that would be filled with each persons breath which would allow the sensor to have time to adjust its values without the person constantly breathing into the device.
To create a quick, cheap device for testing I drilled some holes in an Altoids can for the sensor wires, attached a PVC piece for an inlet, and added some very small holes for an outlet. I have impatient roommates who wanted to start drinking (to be fair, I was keeping them from drinking on a Friday evening) so I did not have time to write elaborate code, just a simple analog read function through serial communication with a knockoff Arduino Mega (eBay, $16).
My thought was that if I took readings while recording how much each person drank in a given time period I could then use the numbers found from an online source to compare their theoretical BAC values to my analog readings and see if there was any sort of trend between the two sets of data.
I took an initial reading before the blowing into the sensor and then a max reading for the highest analog value reached within the reading period. I used an EBAC formula found online to determine the alleged BAC value for each person. After the data was found I took the values of the change in analog values and compared it to the EBAC values with respect to time in minutes, and then again with respect to amount of drinks. The EBAC is already a function of both time and number of drinks, but I was really trying to find if there was any sort of trend between the analog values and the theoretical values.
So while browsing through cheap sensors off of eBay I managed to find a mq-3 ethanol sensor for about four dollars. About a month later the sensor finally came in and I was very excited to test how well it worked and mainly I wanted to create a breathalyzer. A couple weeks later I found some time one Friday evening so I created a simple program to read analog values from the sensor.
The sensor returned analog values of 0-1023, so after doing some research on the sensor I found plenty of information on blood alcohol content (BAC) and how many parts per million (ppm) of ethanol is found in ones breath. The problem I found in the research is that there are many different definitions of BAC and many variables effect the readings. Humidity and temperature are the big environmental variables that effect my analog values from my sensor and I had thought about trying to account for them in my code.
The next step was to make some device that could at least mitigate some of the environmental factors, or at least help the readings be somewhat consistent for each person. A quick (not too scientific) method was to put the sensor in a chamber that would be filled with each persons breath which would allow the sensor to have time to adjust its values without the person constantly breathing into the device.
To create a quick, cheap device for testing I drilled some holes in an Altoids can for the sensor wires, attached a PVC piece for an inlet, and added some very small holes for an outlet. I have impatient roommates who wanted to start drinking (to be fair, I was keeping them from drinking on a Friday evening) so I did not have time to write elaborate code, just a simple analog read function through serial communication with a knockoff Arduino Mega (eBay, $16).
My thought was that if I took readings while recording how much each person drank in a given time period I could then use the numbers found from an online source to compare their theoretical BAC values to my analog readings and see if there was any sort of trend between the two sets of data.
I took an initial reading before the blowing into the sensor and then a max reading for the highest analog value reached within the reading period. I used an EBAC formula found online to determine the alleged BAC value for each person. After the data was found I took the values of the change in analog values and compared it to the EBAC values with respect to time in minutes, and then again with respect to amount of drinks. The EBAC is already a function of both time and number of drinks, but I was really trying to find if there was any sort of trend between the analog values and the theoretical values.
It does appear that there is some correlation between the two data points that could be used to find a relation to create a breathalyzer, but I don't feel that it will be very accurate especially since it was a $4 sensor. It did get more consistent over time, it started with a low value of around 110 and throughout the night the analog value kept decreasing until it got into the teens. This probably has something to do with the "burn in" time that is mentioned in the data sheet, which might provide some insight into why the values were so sporadic when we first started taking readings.
With the sensor better calibrated and with more readings it might be worth using this mq-3 sensor for a home-made breathalyzer but once again it probably isn't sensitive enough without lots of time invested into calibrating the sensor. Holding the inlet to the open end of a bottle of Everclear (95% alcohol by vol.) returned the largest analog values by far, so it does do a decent job at returning a change in value relative to the previous analog value. With that idea in mind the sensor can at least be used to determine who is the most intoxicated I suppose. Regardless of its effectiveness I still got quite a bit of amusement out of the $4 sensor.
Link to Spreadsheet..
With the sensor better calibrated and with more readings it might be worth using this mq-3 sensor for a home-made breathalyzer but once again it probably isn't sensitive enough without lots of time invested into calibrating the sensor. Holding the inlet to the open end of a bottle of Everclear (95% alcohol by vol.) returned the largest analog values by far, so it does do a decent job at returning a change in value relative to the previous analog value. With that idea in mind the sensor can at least be used to determine who is the most intoxicated I suppose. Regardless of its effectiveness I still got quite a bit of amusement out of the $4 sensor.
Link to Spreadsheet..