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 )
Equipment:
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.
Description:
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.
Program:
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.
The red & black wires are the 5V power to the sensor. Draws approx 150mA
The purple wire is the sensor output. Goes to ADC0
DIY Breathalyser
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: DIY Breathalyser
Very impressive John, Certainly a very useful project there.
Also liking the gremlins reference
Also liking the gremlins reference
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: DIY Breathalyser
Hi john
Cracking project that, can you please crack open a bottle of scotch then post the results
Cracking project that, can you please crack open a bottle of scotch then post the results
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php