DIY Breathalyser

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

User avatar
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 716 times

DIY Breathalyser

Postby JohnCrow » Sun Jul 15, 2012 8:18 pm

MQ3 Breathalyser

This project utilises a simple alcohol sensor to create a basic breathalyser.

Gas Sensor Safety Notes.

Gas sensors operate at high temperatures. Therefore the sensor may become hot to the touch.

They must never be opened as they contain toxic chemicals.

They must never be allowed to get wet. (Don’t use them after midnight :D )


EB006 Programmer Board with 16F877A
EB005 – LCD Display – Port B
EB002 Screw Terminal Board – Port A

MQ3 Board:

The sensor is mounted on a Pololu break-out-board, as the sensor has an unusual pin out.
This is mounted on an adafruit ¼ size breadboard along with a 3way screw terminal and the 500k pot.


The MQ3 is a simple sensor that outputs a DC voltage (0 - 5V) depending on the gas concentration it detects.

The program reads the output using ADC0 as an integer value.

The input levels used in this project are as follows.

<400 = Sober
401 - 600 = Had A Drink
601-700 = Had A Few Drinks
701 - 850 = Had A Skinful
>850 = Drunk

These values are set up with the variables in Project Explorer.
This means they can be changed easily to suit individuals needs for where the levels are set.

The LCD Display shows on the

Topline = ADC value
Bottom Line = The status of the person being tested.

Port C is used to control the LED e-block to give a bar graph type display of the level.

Calibration is done by means of a 500k-ohm trimmer.


The program is very simple.

First a macro is called to allow a 30 second delay to allow the sensor to warm up.
The longer the warm up time the more accurate the readings will be.
The data sheet shows a preheat time of over 24 hours.
I think this could be overkill for this project though 

The program then drops into a loop

Read the output of the sensor as an integer on ADC0

This is then compared with the preset values.

The display then shows the sensor value on the top line of the LCD and the test status on the bottom line.

This should not be considered as an accurate measure of the amount of alcohol consumed.

Setting Up & Testing:

I initially tested the circuit by soaking a piece of absorbent paper in Isopropyl Alcohol and held it above the sensor and blew gently on it so the vapour went towards the sensor.
(Don’t let the liquid get onto the surface of the sensor).
This will allow the unit to give out the full range of values.

For real world testing, I have set to a sensor reading of 20 in fresh air.
After a pint of 4.8% bitter blowing on to the sensor gives a reading of about 270.
This is probably a falsely high reading due to excess mouth alcohol.
The output of the unit does tend to increase slightly when blown on even if no alcohol has been consumed. This could possibly be down to the presence natural alcohols.

Several examples of the use of this sensor can be found on the internet / you-tube.

System.JPG (138.43 KiB) Viewed 2533 times

Sensor.JPG (122.9 KiB) Viewed 2533 times

The red & black wires are the 5V power to the sensor. Draws approx 150mA
The purple wire is the sensor output. Goes to ADC0

MQ3 Breathalyser V1.fcf
(20.44 KiB) Downloaded 144 times
These users thanked the author JohnCrow for the post (total 7):
medelec35 (Sun Jul 15, 2012 9:09 pm) • kersing (Sun Jul 15, 2012 10:56 pm) • DavidA (Mon Jul 16, 2012 9:10 am) • Benj (Mon Jul 16, 2012 12:43 pm) • petesmart (Mon Jul 16, 2012 2:57 pm) • dazz (Tue Jul 17, 2012 2:14 pm) • Spanish_dude (Sun Jul 22, 2012 10:14 pm)
Rating: 35%
1 in 10 people understand binary, the other one doesn't !

User avatar
Matrix Staff
Posts: 14786
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4750 times
Been thanked: 4358 times

Re: DIY Breathalyser

Postby Benj » Mon Jul 16, 2012 12:45 pm

Very impressive John, Certainly a very useful project there.

Also liking the gremlins reference :wink:
These users thanked the author Benj for the post:
JohnCrow (Mon Jul 16, 2012 12:45 pm)
Rating: 5%

Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times

Re: DIY Breathalyser

Postby dazz » Tue Jul 17, 2012 2:15 pm

Hi john

Cracking project that, can you please crack open a bottle of scotch then post the results :D :lol:
These users thanked the author dazz for the post:
JohnCrow (Tue Jul 17, 2012 3:04 pm)
Rating: 5%
To sign up to the V5 forum follow this link