The idea for this project came when I found a cheap sensor online that claimed to measure alcohol concentration in the air. Who hasn't at some point wanted to use a breathalyzer, to see to a scientific degree just how intoxicated they were?
Police around the world use breathalyzers to obtain suspected drunk drivers' BAC. These breathalyzers give accurate and reproducible readings, but cost hundreds of dollars.
The MQ3 sensor only costs a couple bucks, but it does not give accurate, nor reproducible BAC readings. In other words, don't use this sensor to decide if you can drive or not. However, we can still have fun comparing relative values between friends.
The Cayenne platform and an ESP8266 are used to connect the MQ-3 sensor to the internet so data can be viewed and gathered over time.
HardwareThe device needs to be portable and durable if it should be used while under the influence. The 11.1 Wh/hr lipo battery provides about 8 hours of continuous use. All the components are stuck to the battery pack with thick double sided tape. I hope this provides some shock absorption in case of drops. The enclosure is made of two 3mm aluminum plates bolted together. Aluminum is a great material to work with because it cuts and drills easily, but that also means that it is easily scratched as seen by the pictures. Regardless, it will protect the battery and electronics in most situations and I think it gives the device a rugged feel.
Arduino SketchThe arduino sketch is pretty straightforward. The template provided in the cayenne dashboard provides a very good starting point. The first virtual input sends current readings from the sensor to the dashboard. I added a second channel/input to keep track of the highest reading obtained, aka the "high score". If the cayenne devs are reading this, I wish there were more input types other than luminosity, voltage, etc. I don't see why the data has to be tied to a unit at all. Lastly, there's an http server running so that the board firmware can be updated over the air.
Sketch is available at https://github.com/dpeters1/IoT-Breathalyzer
Cayenne IntegrationThe Cayenne dashboard provides current alcohol concentration, highest reading, and a graph of readings with respect to time.
Photos
Comments