IoT Breathalyzer with Cayenne, ESP8266, and MQ3 sensor


About This Project

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.

What’s Connected

Circuit diagram coming later


The 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 Sketch

The 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.

Cayenne Integration

Screenshots coming later

Photos of the Project

src="/uploads/mydevices/original/2X/d/d8714bdc14a2707f771d303486fe759a5732008a.jpg" width=“375” height=“500”>

Submit Your Cayenne Projects! [contest ended]

Cool project!.. I imagine the testing will be fun as well :wink:

Would be interested to see the code and Cayenne screen shots as well. Could implement triggers by making a buzzer go off if breathalyzer value goes above a certain threshold ?



The project is now complete. Unfortunately I can’t figure out how to edit my original post.

Cayenne Integration

Remember these measurements are solely for comparing relative alcohol concentrations.
I wish the polling rate for the sensors could be adjusted. It is a little slow at the moment.
SMS notification is sent if alcohol concentration threshold is exceeded


The arduino sketch is available at

Final Product


I like, I like!
This competition is getting VERY interesting!
Thanks for showcasing this sensor-
and the necessary voltage divider
that matches the +5V signal to 3v3.

and for showcasing the Esp12-e
I’m certain I will check it out further!

My only critique is that
it appears that you are using 2
Linear mode voltage regulator LM7803.3 and LM7805.
I’m not certain.
Switching mode regulators run super efficient and cool, so if heat is an issue- try using 78SR3.3 and 78SR5 regulators. :slight_smile:


Thanks a lot! The 3.3v regulator is in fact a switching mode regulator, however the only 5v regulator I had on hand was the old 7805. The aluminum case does a good job dissipating most of the heat, but in the future I will stick to the newer regulators.


The +VCC limits on the 78SR-3.3 and -5 is something like +7.5V to +34V, -and they still run cool even when passing 1 Amp! Ya, the Linear regulators are…old school now.


Great project. You can use also a 9v battery. I love the project like this where the components are combined like a puzzle. Wooo :slight_smile: