Digital Electronics- Project Report 2

37
ABSTRACT Most of the car accidents that happen in the streets are alcohol-related crashes, the driver is drunk. The researchers are developing a system which can detect if the driver is drunk or not. The Driver Alcohol Detection Systems for Safety will measure the blood content of the driver in two possible ways, through a driver’s breath or through the skin. This is done by the use of sophisticated touched-based sensors that would possibly be placed in the door locks or steering wheel. The researchers conducted its first public demonstration of the alcohol-detection system that could measure if the driver has reached the blood alcohol limit of .08. If the system detected the alcohol content of the driver is above the limit, the vehicle will not start. In a test demonstration, let’s test a man who drinks 3 1/2 ounce glasses of vodka and orange juice about 30 minutes apart, eating some cheese and crackers in between to imitate a critical social setting. After that, using the touched- based and breath-based prototypes they found out that a man has an alcohol content of .06 thus he can start the car. Though the system is 99.9% reliable, some of the groups are questioning the .08 limit since the blood alcohol content rises during a trip, also to some factors such how recently the driver is drunk and how much he/she 0

Transcript of Digital Electronics- Project Report 2

Page 1: Digital Electronics- Project Report 2

ABSTRACT

Most of the car accidents that happen in the streets are alcohol-related crashes, the

driver is drunk. The researchers are developing a system which can detect if the driver

is drunk or not. The Driver Alcohol Detection Systems for Safety will measure the

blood content of the driver in two possible ways, through a driver’s breath or through

the skin. This is done by the use of sophisticated touched-based sensors that would

possibly be placed in the door locks or steering wheel.

The researchers conducted its first public demonstration of the alcohol-detection

system that could measure if the driver has reached the blood alcohol limit of .08. If

the system detected the alcohol content of the driver is above the limit, the vehicle

will not start. In a test demonstration, let’s test a man who drinks 3 1/2 ounce glasses

of vodka and orange juice about 30 minutes apart, eating some cheese and crackers in

between to imitate a critical social setting. After that, using the touched-based and

breath-based prototypes they found out that a man has an alcohol content of .06 thus

he can start the car. Though the system is 99.9% reliable, some of the groups are

questioning the .08 limit since the blood alcohol content rises during a trip, also to

some factors such how recently the driver is drunk and how much he/she ate. This

system is still needs a long process though they predict that this is the option for

future cars.

Future technologies are expected to be much faster and less intrusive, requiring no

active involvement from the driver. Essentially, the technology will be invisible to

drivers, so that sober drivers wouldn't be inconvenienced.

In our alcohol detection system the ignition of the fuel is regulated by a sensor circuit.

The sensor circuit is used to detect whether alcohol was consumed by the driver

recently. Our design also consists of a body perspiration rate sensor which is used to

check whether alcohol is consumed while driving.

0

Page 2: Digital Electronics- Project Report 2

INTRODUCTION

Drunken drivers have been let unchecked in the society. Though there are laws to

punish drunken drivers they cannot be fully utilized as police cannot stand on every

road corner to check each and every car driver whether he has drink or not. This leads

to severe accidents killing people on the spot or physically impairing them. So there is

a necessity to develop an efficient alcohol detection system.

The Automotive Coalition for Traffic Safety and the National Highway Traffic Safety

Administration have entered into a cooperative research agreement to explore the

feasibility, the potential benefits of, and the public policy challenges associated with a

more widespread use of in-vehicle technology to prevent alcohol-impaired driving.

“Almost 9,000 road traffic deaths could be prevented every year if alcohol detection

devices were used in all vehicles.”

Aftermarket ignition interlocks have been used successfully among convicted drunk

drivers to significantly reduce the incidence of impaired driving. However,

deployment of the current technology on a more widespread basis as a preventative

measure is not likely to occur because drivers are required to provide a breath sample

each and every time before starting the vehicle. To be acceptable for use among the

general public, including those who do not drink and drive, alcohol detection

technologies must be far less intrusive – they must not impede sober drivers from

starting their vehicles. They would need to be capable of rapidly and accurately

determining and measuring alcohol in the blood. They would also need to be small,

reliable, durable, repeatable, maintenance free, and relatively inexpensive.

Two approaches have been identified that have considerable promise in measuring driver BAC non-invasively:

1) Tissue Spectrometry, a touch-based approach allowing estimation of alcohol in human tissue,

2) Distant Spectrometry that will allow assessment of alcohol concentration in the subject’s exhaled breath.

1

Page 3: Digital Electronics- Project Report 2

WORKING PRINCIPLE OF ALCOHOL DETECTORS

DISTANT SPECTROMETRY

In breath-based approach, we are using an external cavity quantum cascade

technology. These sensors are designed to measure Ethanol emanating from the driver

by simultaneously measuring the concentration of Alcohol and Carbon dioxide in the

cabin air near the driver. The tricky part is placing sensors to ensure that breath

samples are taken from the driver, not other passengers.

DESIGN OF ALCOHOL SENSOR

The MQ-3 is an alcohol gas sensor that is available from Sparkfun, Seed Studio and

others. It’s easy to use and has sparked the imagination of anyone who has dreamed of

building their own breathalyzer device for measuring the amount of alcohol in the

human body.

For typical alcohol detection we are using MQ-3 gas

sensor which is highly sensitive to alcohol.

The features of MQ-3 gas/Alcohol sensor are:

1. High sensitive to alcohol and small sensitive to

benzene.

2. Fast response and high sensitivity.

3. Stable and long life.

4. Simple drive circuit.

2

Page 4: Digital Electronics- Project Report 2

CONNECTING AND TESTING

The gas sensor canister plugs into the socket on the front of the module. The gas

sensors are essentially resistive devices and are not polarized, so there is no need to be

concerned about plugging it in “backwards.” It will work in either orientation.

The 4-pin SIP header on the Gas Sensor Module makes it easy to connect to a

breadboard or SIP socket. The four connections are defined in the table below.

Connection to a 5V microcontroller, such as the BASIC Stamp® module, would be

pretty straight forward and require two I/O pins; one input for detecting the alarm

signal and the other an output for controlling the internal heater.

For a 3.3V microcontroller such as the PropellerTM chip, a 3.9 kΩ (10 kΩ could be

used) resistor would be required from the ALR output to the Propeller chip input pin.

For the Propeller to control the heater switch input (HSW) you would need an NPN

switching transistor, such as a 2N3904 and a 1 kΩ resistor.

The schematic for this connection is shown below.

Fig.1 schematic connections for alcohol sensor

3

Page 5: Digital Electronics- Project Report 2

THEORY OF OPERATION

These gas sensor modules use gas sensors from Hanwei Electronics. When their

internal heating elements are activated, these gas sensors respond to their specific gas

by reducing their resistance in proportion to the amount of that gas present in the air

exposed to the internal element. On the gas sensor modules this is part of a voltage

divider formed by the internal element of each gas sensor and potentiometer R3 (Set

Point). The output of this voltage divider is fed into the non-inverting inputs of the

two op-amps on the LT1013 dual op-amp IC. Op-amp A is configured as a buffer

with unity gain and is used to provide a non-loaded test point for the signal voltage at

TP1 (+) and TP2 (-). The signal voltage is also being fed into op-amp B which is

configured as a comparator that gets its reference voltage at the inverting input from

potentiometer R4 (Trip Level) and is also available at TP3 (+) and TP4 (-).

The output of op-amp B goes out to the ALR pin through a 1 kΩ resistor providing a

TTL-compatible signal to a microcontroller. This output also connects to a red LED

on the gas sensor modules. The zero gas span adjustment is set via potentiometer R3.

As mentioned above R3 allows you to change the span/range of the voltage divider

formed by the gas sensor and R3 which is the bottom leg of the divider, electrically

speaking. Adjusting R3 to lower values will make the gas sensor less sensitive but

more stable. Avoid setting R3 below 200 ohms as at this point you will be close to

shorting the output to ground. Setting R3 to higher values will make the gas sensor

more responsive, but without a minimum load it will become unstable after a certain

point. The trip level adjustment is set via potentiometer R4.

This is just a simple voltage divider that lets you set the voltage from 0V to 5V. This

voltage is compared to the voltage coming from the gas sensor/R3 divider. When the

voltage from the gas sensor is higher than the voltage set by potentiometer R4 the red

LED will light and the ALR output will be high (5 V).

LAYOUT AND CONFIGURATION OF MQ-3 SENSOR

Structure and configuration of gas sensor is shown as Fig. 1 (Configuration A or B),

sensor composed by micro AL2O3 ceramic tube, Tin Dioxide (SnO2) sensitive layer,

measuring electrode and heater are fixed into a crust made by plastic and stainless

4

Page 6: Digital Electronics- Project Report 2

steel net. The heater provides necessary work conditions for work of sensitive

components. The enveloped MQ-3 has 6 pin, 4 of them are used to fetch signals, and

other 2 are used for providing heating current.

Fig.2 Layout of Gas Sensor

SENSITVITY ADJUSTMENT

5

Page 7: Digital Electronics- Project Report 2

Resistance value of MQ-3 is difference to various kinds and various concentration

gases. So, when using these components, sensitivity adjustment is very necessary. We

recommend that you calibrate the detector for 0.4mg/L ( approximately 200ppm ) of

Alcohol concentration in air and use value of Load resistance that( RL) about 10 KΩ.

When accurately measuring, the proper alarm point for the gas detector should be

determined after considering the temperature and humidity influence.

CO2 SENSOR

The CO2 (Carbon Dioxide) Gas Sensor Module is designed to allow a microcontroller

to determine when a preset Carbon Dioxide gas level has been reached or exceeded.

Interfacing with the sensor module is done through a 4-pin SIP header and requires

two I/O pins from the host microcontroller. The sensor module is mainly intended to

provide a means of comparing carbon dioxide sources and being able to set an alarm

limit when the source becomes excessive.

Fig.4 Schematic of CO2 sensor.

6

Page 8: Digital Electronics- Project Report 2

WIRING THE SENSOR

Sensing material

It is well known that chemisorbed oxygen (Oad−) on SnO2 plays an important role in

the sensitivity behavior of the gas sensor. The reactivity of Oad− is so high that it easily

reacts with the reducing gas in the ambient, which in turn injects electrons into the

oxide, thereby increasing the conductivity. However, Weisz limitation dictates that

the concentration of Oad− has to be less than 1%, at which surface acceptor level

becomes equal to the Fermi level of SnO2 by the band bending of the depletion layer.

7

Page 9: Digital Electronics- Project Report 2

The change of Oad− concentration less than 1% due to the catalytic reaction with

reducing gas cannot make more than 100 times difference in the bulk conductivity.

Therefore, the action of inter-granular barrier is proposed as an explanation.

According to this model, conductivity is expressed as G=G° exp(−qVS/kT), where VS

is the barrier height at inter-granular contacts, which is proportional to [Oad−]2.

As a result, the sensitivity of the sensing material has intimate connection with the

nature of the contact, which is determined by the history of the material preparation.

In practice, all the contacts in the path of percolating channel between two electrodes

take part in the resistance of the sensor to play a role in the sensitivity. These series of

contacts are very sensitive to the condition of heat treatment of the sensing material

and the material parameter itself.

Generally, voltage-dividing circuit is used to measure the concentration of gas. Output

voltage is expressed as

Sensor Calibration Challenges

So, I simply need to use the sensor to determine how many mg/L of alcohol there is in

my breath, right? The bad news is that it is very difficult to know how much alcohol is

in your breath in terms of mg/L! The poorly written MQ-3 datasheet says to calibrate

the sensor by exposing it to a known alcohol gas of 0.4mg/L. From there, you can

determine gas alcohol content in terms of mg/L.

But how do I create an air environment with 0.4mg/L alcohol? I could evaporate

0.4mg of ethanol (that’s the type of alcohol we’re talking about here) in a liter of air,

but how do I measure out exactly 0.4mg of pure ethanol? I don’t have a source of pure

ethanol. I could buy 151 proof Everclear grain alcohol but then would need to account

for the different density when measuring this tiny quantity. And there’s the additional

complexity in that evaporating aqueous ethanol will alter the humidity, and the sensor

8

Page 10: Digital Electronics- Project Report 2

readings are sensitive to humidity! This is getting complicated. If were really

motivated, I would drive to Wisconsin where I could buy 190 proof (95%) Everclear.

Last time I drove to Wisconsin was to buy illegal fireworks, and it seems that my only

reason for visiting Wisconsin is to purchase contraband and smuggle it back into

Minnesota. But I digress…the bottom line is that calibration according to the MQ-3

datasheet is hard.

Another calibration approach would be to use my breath as a “known” concentration

of ethanol after drinking a known quantity of alcoholic beverages. I could drink the

right amount of alcohol to give a 0.4mg/L concentraion in my breath and measure the

resistance to get my calibration baseline. But this presents problems, too! The sensor

calibration depends on 0.4mg/L concentration in “clean air”. What is “clean air”? I

think it means air that is devoid of other contaminating gases that affect the sensor,

and assumes 21% oxygen concentration and 65% humidity at room temperature.

Those conditions are not going to be true in my breath!

My head is spinning, and I haven’t even started drinking yet. In short, I don’t know

how to create the right conditions for accurate calibration without a laboratory. Any

ideas welcome.

THEORY OF OPERATION

The CO2 gas sensor module uses a gas sensor (MG811) from Hanwei Electronics.

When the internal heating element is activated, this gas sensor responds to CO2 gas

by generating a small voltage in proportion to the amount of CO2 gas present in the

air exposed to the internal element. The sensor is a high impedance device and

requires a buffer/amplifier to measure the output. The output from the buffer/amplifier

(op-amp) is then sent to the inverting input of another op-amp in the same package

(LMC6035) which is configured as a comparator. A voltage divider formed by R3 is

used to provide a reference voltage. The output of this voltage divider is fed into the

non-inverting inputs of the second op-amp on the LMC6035 dual op-amp IC. The

buffered output of the sensor can be measured for the signal voltage at TP1 (+) and

TP2 (-). The reference voltage is available at TP3 (+) and TP4 (-).

9

Page 11: Digital Electronics- Project Report 2

Fig.5 Schematic of CO2 Sensor

The output of op-amp B goes out to the ALR pin through a 1 kΩ resistor providing a

TTL-compatible signal to a microcontroller. The trip level adjustment is set via

potentiometer R3. This is just a simple voltage divider that lets you set the voltage

from 0V to 3.3V. This voltage is compared to the voltage coming from the gas sensor

buffer/opamp. When the voltage from the gas sensor is lower than the voltage set by

potentiometer R3 the red LED will light and the ALR output will be high (3.3 V). The

voltage from the sensor actually drops as CO2 increases. The section below describes

how to configure these gas sensor modules to detect gas with minimal calibration.

SCHEMANTIC OF ALCOHOL DETECTION SYSTEM

The schematic of alcohol system consists of an IC, gas sensor, carbon dioxide sensor

and a power supply.

All the connections are made as shown in the schematic figure. The power supply is

attached to all the three components, i.e. sensors and IC.

10

Page 12: Digital Electronics- Project Report 2

When the power supply is ON all the components get activated and the sensors give

the required inputs to the Microcontroller. The microcontroller then processes the

inputs given by the sensors and sends the required output to the ignition circuit.

If the sensors detect the alcohol content, then the microcontroller sends the signal to

kill the power to the ignition circuit.

Fig. 6 Schematic of Alcohol detection system

11

Page 13: Digital Electronics- Project Report 2

DESIGN OF LOGIC CIRCUIT

The various possibilities arising in the above circuit are

1. The driver is not drunk.

2. The driver is drunk.

3. The driver is not present.

Consider the change of color of salt as logic 1 and no color change as logic 0.

Consider the presence of CO2 as logic 1 and the absence of CO2 as logic 0.

TRUTH TABLE FOR THE CIRCUIT

CO2 Sensor

Alcohol Sensor

Output to

Relay

1 0 1

1 1 0

0 0 0

• So if CO2 is detected and Alcohol is absent then power supply from battery reaches the spark plug.

• If both Alcohol and CO2 is detected then the supply from the battery will not reach the spark plug.

• If both are undetected then also there will be no supply to the spark plug.

The gate diagram can be given as follows

A (alcohol) C (output)

B (CO2)

12

Page 14: Digital Electronics- Project Report 2

OPERATION OF ALCOHOL DETECTING SYSTEM

1. The Driver enters the car and places the ignition key.

2. When the key is turned a voice prompts the driver to prepare to give a breath

test. The driver has over 60 seconds to provide a deep lung breath sample.

3. As soon as the ignition key is placed, the alcohol detecting system gets

activated and the alcohol sensor placed near the driver cabin takes the readings

of Alcohol and CO2.

4. The breath sample is analyzed in 8 - 10 seconds.

5. Allows 6-8 second resamples as needed.

6. After test completion, a voice either prompts the driver to start the car or lets

him/her know it will not start (a lockout condition).

7. To discourage someone else from providing the original breath sample,

"random rolling retests" are given at intervals after starting.

8. If a retest is failed, a voice instructs the driver to pull over and shut off the

car. If this instruction is ignored, the horn sounds and the lights blink until the

car is shut off.

9. If the system detected the alcohol content of the driver is above the limit, the

system kills the power supply to the ignition circuit and the vehicle will not

start.

Thus the alcohol detecting system prevents the driver from driving the car if he is

drunk.

13

Page 15: Digital Electronics- Project Report 2

ADVANTAGES

1. Helps in reducing road accidents caused by drunk driving.

2. Eradicates the use of police officers to check the ongoing traffic.

3. Cost of installation is very cheap.

DISADVANTAGES

1. If the driver opens his window, due to the clean airflow from outside the

alcohol system may not function properly.

2. If the system kills the power supply to the ignition circuit when he is running

on a freeway, it would be a greater threat to oncoming vehicles.

14

Page 16: Digital Electronics- Project Report 2

TISSUE SPECTROMETRY

In Tissue Spectrometry, we use a touch-based prototype using near-infrared (NIR)

absorption spectroscopy to measure alcohol in skin tissue. It is designed to work by

shining NIR light on the user's skin. The light scatters several millimeters through the

user's skin before returning to the skin's surface, where it's collected by an optical

touch pad and analyzed to determine tissue alcohol concentration.

The fact used in this process is that after consumption of alcohol the pulse rate

decreases which increases the body heat and the perspiration rate. But the perspiration

rate varies significantly for different persons. So after initial testing the perspiration

rate of the person is recorded using perspiration sensors. The perspiration sensors

consist of very sensitive miniature infrared which gets deflected by the blood

perspiration. The number of pulses per minute is recorded by a perspiration counter

circuit. The initial reading is taken as reference and periodic checks are made by the

sensors, if there is significant increase is perspiration rate then the car stops.

These touch sensors can be placed in the steering wheel or in the transmission knob.

These sensors continuously monitor the blood alcohol levels in the body by taking the

samples from the perspiration produced by the body.

Fig. 7 Checking the blood alcohol level using Tissue Spectroscopy

15

Page 17: Digital Electronics- Project Report 2

On-board ILS ethyl alcohol sensors based on intracavity laser spectroscopy (ILS) are

provided lor detecting the presence ol ethyl alcohol vapors in a vehicle. The sensor

comprises:

(a) a laser comprising a gain medium having two opposed lacets within a laser

resonator and lunctioning as an intracavity spectroscopic device having a first end and

a second end, the first end operatively associated with a partially reflecting (i.e.,

partially transmitting) surface;

(b) a reflective or dispersive optical element (e.g., a mirror or a diffraction grating)

operatively associated with the second end to define a broadband wavelength laser

resonator between the optical element and the first end and to thereby define an

external cavity region between at least one facet of the gain medium and either the

first end or the second end or both ends;

(c) The external cavity region being exposed to air in the cabin of the vehicle to

enable any ethyl alcohol molecules to enter thereinto;

(d) A detector spaced from the first end;

(e) Appropriate electronics for measuring and analyzing the detector signal;

(f) a housing for containing at least the laser, the partially reflecting surface, and the

optical element, the housing being configured to prevent escape of stray radiation into

the cab and to permit air from the cab to continuously circulate through the external

cavity region for analysis; and

(g) means for driving the laser (e.g., electrical or optical). A method is provided for

measuring concentration of ethyl alcohol vapors in a vehicle employing the on-board

sensor. The method comprises:

(1) sensing any ethyl alcohol vapors in the cab by the on-board sensor; and

(2) providing a signal indicative of presence of any alcohol vapors.

16

Page 18: Digital Electronics- Project Report 2

UNITS OF MEASUREMENT

There are several different units in use around the world for defining blood alcohol

concentration. Each is defined as either a mass of alcohol per volume of blood or a

mass of alcohol per mass of blood (never a volume per volume). 1 milliliter of blood

is approximately equivalent to 1.06 grams of blood. Because of this, units by volume

are similar but not identical to units by mass. In the U.S. the concentration unit 1%

w/v (percent weight/volume, equivalent to 10g/l or 1g per 100ml) is in use. This is not

to be confused with the amount of alcohol measured on the breath, as with a

breathalyzer. The amount of alcohol measured on the breath is generally accepted to

be proportional to the amount of alcohol present in the blood at a rate of 1:2100.

Therefore, a breathalyzer measurement of 0.10 mg/L of breath alcohol converts to

0.021 g/210L of breath alcohol, or 0.021 g/dL of blood alcohol (the units of the BAC

in the United States).

Unit Dimensions Equivalent to Used in

1 percent (%) BAC by volume

1/100 g/mL = 1 cg/mL

9.43 mg/g, 217.4 mmol/L

United States, Australia, Canada, Spain

1 permille (‰) BAC by volume

1/1000 g/mL = 1 mg/mL

0.943 mg/g, 21.7 mmol/L

Netherlands, Lithuania, Latvia, Poland, Germany, Switzerland, Austria, Romania, Turkey

1 basis point (‱) BAC by volume

1/10,000 g/mL = 100 μg/mL

94.3 ppm, 2.17 mmol/L

Britain

1 permille (‰) BAC by mass

1/1000 g/g = 1 mg/g

1.06 mg/mL, 23 mmol/L

Finland, Norway, Sweden, Denmark

1 part per million (ppm)

1/1,000,000 g/g = 1 μg/g

1.06 μg/mL, 23 μmol/L

17

Page 19: Digital Electronics- Project Report 2

EFFECTS OF ALCOHOL

Progressive effects of alcohol

BAC (% by vol.)

Behavior Impairment

0.010–0.029 Average individual appears

normal

Subtle effects that can be

detected with special

tests

0.030–0.059

Mild euphoria

Sense of well-being

Relaxation

Joyousness

Talkativeness

Decreased inhibition

Concentration

0.06–0.09

Blunted feelings

Disinhibition

Extroversion

Reasoning

Depth perception

Peripheral vision

Glare recovery

0.10–0.19

Over-expression

Emotional swings

Angriness or sadness

Boisterousness

Super human feeling

Decreased libido

Reflexes

Reaction time

Gross motor control

Staggering

Slurred speech

0.20–0.29

Stupor

Loss of understanding

Impaired sensations

Severe motor impairment

Loss of consciousness

Memory

0.30–0.39

Severe CNS depression

Unconsciousness

Death is possible

Bladder function

Breathing

Heart rate

≥0.40 General lack of behavior Breathing

18

Page 20: Digital Electronics- Project Report 2

Unconsciousness

Death Heart rate

STANDARD DRINKING CHART

Standard drink chart (US)

AlcoholAmount

(ml)Amount

(fl oz)Serving

sizeAlcohol (% by

vol.)Alcohol

80 proof liquor

44 1.5 One shot 400.6 US fl oz (18 ml)

Table wine 148 5 One glass 120.6 US fl oz (18 ml)

Beer 355 12 One can 50.6 US fl oz (18 ml)

BLOOD ALCOHOL PERCENTAGE

MaleFemale

Approximate blood alcohol percentage (by vol.) One drink has 0.5 US fl oz (15 ml) alcohol by volume

Drinks

Body weight

40 kg 45 kg 55 kg 64 kg 73 kg 82 kg 91 kg 100 kg 109 kg

90 lb 100 lb 120 lb 140 lb 160 lb 180 lb 200 lb 220 lb 240 lb

1–

0.050.040.05

0.030.04

0.030.03

0.020.03

0.020.03

0.020.02

0.020.02

0.020.02

19

Page 21: Digital Electronics- Project Report 2

2–

0.100.080.09

0.060.08

0.050.07

0.050.06

0.040.05

0.040.05

0.030.04

0.030.04

3–

0.150.110.14

0.090.11

0.080.10

0.070.09

0.060.08

0.060.07

0.050.06

0.050.06

4–

0.200.150.18

0.120.15

0.110.13

0.090.11

0.080.10

0.080.09

0.070.08

0.060.08

5–

0.250.190.23

0.160.19

0.130.16

0.120.14

0.110.13

0.090.11

0.090.10

0.080.09

6–

0.300.230.27

0.190.23

0.160.19

0.140.17

0.130.15

0.110.14

0.100.12

0.090.11

7–

0.350.260.32

0.220.27

0.190.23

0.160.20

0.150.18

0.130.16

0.120.14

0.110.13

8–

0.400.300.36

0.250.30

0.210.26

0.190.23

0.170.20

0.150.18

0.140.17

0.130.15

9–

0.450.340.41

0.280.34

0.240.29

0.210.26

0.190.23

0.170.20

0.150.19

0.140.17

10–

0.510.380.45

0.310.38

0.270.32

0.230.28

0.210.25

0.190.23

0.170.21

0.160.19

20

Page 22: Digital Electronics- Project Report 2

RESULTS

Program to configure the microcontroller

----------------------------------------------------------------------------------

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL;

---- Uncomment the following library declaration if instantiating

---- any Xilinx primitives in this code.

--library UNISIM;

--use UNISIM.VComponents.all;

entity alcoholdetector is

Port ( clk : in STD_LOGIC;

x : in STD_LOGIC;

y : in STD_LOGIC;

z : out STD_LOGIC);

end alcoholdetector;

architecture Behavioral of alcoholdetector is

begin

if x ='0' then

z <= 0;

else

if y = '0' then

z <= 1;

else

z <= 0;

21

Page 23: Digital Electronics- Project Report 2

end if;

end Behavioral;

Code for interfacing Alcohol Gas Sensor MQ-3 with Microcontroller

const int analogPin = 0; // the pin that the potentiometer is attached toconst int ledCount = 10; // the number of LEDs in the bar graph

int ledPins[] = { 11,10,9,8,7,6,5,4,3,2 // Here we have the number of LEDs to use in the BarGraph };

void setup() {

for (int thisLed = 0; thisLed < ledCount; thisLed++) { pinMode(ledPins[thisLed], OUTPUT); }}

void loop() { //This is the code to light up LED's int sensorReading = analogRead(analogPin);

int ledLevel = map(sensorReading, 500, 1023, 0, ledCount);

for (int thisLed = 0; thisLed < ledCount; thisLed++) {

if (thisLed < ledLevel) { digitalWrite(ledPins[thisLed], HIGH); }

else { digitalWrite(ledPins[thisLed], LOW); } }}

22

Page 25: Digital Electronics- Project Report 2

OUTPUT Wave forms

TEST ASSUMPTIONS

Blood alcohol tests assume the individual being tested is average in various ways. For

example, on average the ratio of blood alcohol content to breath alcohol content

(the partition ratio) is 2100 to 1. In other words, there are 2100 parts of alcohol in the

blood for every part in the breath. However, the actual ratio in any given individual

can vary from 1300:1 to 3100:1, or even more widely. This ratio varies not only from

person to person, but within one person from moment to moment. Thus a person with

a true blood alcohol level of .08 but a partition ratio of 1700:1 at the time of testing

would have a .10 reading on a Breathalyzer calibrated for the average 2100:1 ratio.

A similar assumption is made in urinalysis. When urine is analyzed for alcohol, the

assumption is that there are 1.3 parts of alcohol in the urine for every 1 part in the

blood, even though the actual ratio can vary greatly.

Breath alcohol testing further assumes that the test is post-absorptive—that is, that the

absorption of alcohol in the subject's body is complete. If the subject is still actively

absorbing alcohol, their body has not reached a state of equilibrium where the

concentration of alcohol is uniform throughout the body. Most forensic alcohol

experts reject test results during this period as the amounts of alcohol in the breath

will not accurately reflect a true concentration in the blood.

24

Page 26: Digital Electronics- Project Report 2

CONCLUSION

A design has been developed for alcohol detection in cars/vehicles which can

efficiently check the alcohol levels of the driver. By implementing this design

accidents caused by the drunk drivers can be controlled to a greater extent.

Future technologies are expected to be much faster and less intrusive, requiring no

active involvement from the driver. Essentially, the technology will be invisible to

drivers, so that sober drivers wouldn't be inconvenienced.

Government must enforce laws to install alcohol detectors in the cars and must

regulate all the car companies to preinstall such mechanisms in their cars.

25

Page 27: Digital Electronics- Project Report 2

REFERENCES

Alcohol Consumption Impairs Detection of Performance Errors in

Mediofrontal Cortex

Alcohol detection device

JW Rugis… - US Patent 4,607,719, 1986 - Google Patents

Development of the Alcohol Use Disorders Identification Test (AUDIT):

WHO Collaborative Project on Early Detection of Persons with Harmful

Alcohol Consumption-II

http://www.hwsensor.com

www.parallax.com

www.dadss.org

www.sciencedaily.com

www.insideline.com

26