final ads report completed
Post on 27-Nov-2014
123 Views
Preview:
TRANSCRIPT
ALCOHOL DETECTION SYSTEM
ABSTRACT
How can it reliably be established that a person has consumed alcohol in
amounts that are illegal and/or may cause harm to that person or others and may he
works efficiently? Many people think of this as a relatively easy task, conjuring up
images of the “falling down drunk,” although even this obvious display may be
something else, for example, and diabetic shock. The reality is that even when
people have high blood alcohol concentrations (BAC) known to cause significant
impairment, it can be difficult for experts and laypersons alike to detect alcohol,
especially among seasoned users and among people who wish to remain
undetected. Detecting drugs other than alcohol presents its own set of problems,
and in many cases the behavioral cues are less obvious than when alcohol has been
consumed. At present drunken people have increased enormously and so is the
deaths, crimes due to drunken people increases obviously. So there is a need for an
effective system to check drunken peoples.
In our alcohol detection system the breath of person is sensed by alcohol
sensor. The sensor circuit is used to detect whether alcohol was consumed by that
person recently. Our design also consists of a breath (MQ3) sensor which is used to
check whether alcohol is consumed while driving. In addition to this particular
device we have added thermal printer which will provide receipt containing
information such as amount of alcohol detected and fine accordingly and also there
is pc interface to keep the record of how much fine is collected over a particular
period.
The overall objective of this system is to keep eye on suspects happening
due to alcohol drinkers and to perform accuracy in work while detecting and
preventing alcohol drinkers.
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 1
ALCOHOL DETECTION SYSTEM
INDEXSr. No. Particulars Page No.
1 Introduction 5
2 Literature survey 14
3 Block Diagram 184 Circuit Diagram 215 List of Components
5.1 Alcohol Sensor 5.2 ADC 5.3 Microcontroller 5.4 LCD 5.5 EEPROM 5.6 Keypad 5.7 MAX 232 5.8 Thermal Printer
232531334043464750
6 Software Development 6.1 Flow Chart of Main Program 6.2 Flow chart of LCD interface 6.3 Flow chart of Keypad Interface
53545556
7 Advantages 578 Applications 599 Future Demand 6110 Conclusion 6311 References 66
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 2
ALCOHOL DETECTION SYSTEM
LIST OF FIGURES:
Figure No Name Page NoFig 3.1 Block Diagram 19
Fig 4.1 Circuit Diagram 22
Fig 5.1.1 Alcohol Sensor 25
Fig 5.1.2.1 Sensor Circuit Connection 27
Fig 5.2.1 ADC Pin Diagram 32
Fig 5.3.3.1 µC Pin-Out 34
Fig 5.3.5.1 Reset Circuit 39
Fig 5.3.6.1 Crystal Circuit 39
Fig 5.4.1 LCD 40
Fig 5.4.2.1 Schematic Of LCD 41
Fig 5.5.3.1 EEPROM Pin-out 44
Fig 5.6.1 Keypad Interfacing 46
Fig 5.7.1.1 MAX 232 Interfacing 47
Fig 5.8.1 Thermal Printer 50
Fig 6.1 Flow Chart Of Main Program 54
Fig 6.2 Flow Chart Of LCD interfacing 55
Fig 6.3 Flow Chart Of Keypad Interfacing 56
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 3
ALCOHOL DETECTION SYSTEM
LIST OF TABLES:
Table No Name Page No
Table 1.1 Blood Alcohol Percentage for female
7
Table 1.2 Blood Alcohol Percentage for male 8
Table 3.1.1 Standard work condition 25
Table 3.1.2 Environment Condition 25
Table 3.1.3 Sensitivity characteristic 26
Table 3.1.4 Structure and configuration, basic measuring circuit
27
Table 5.2.2 Pin Description of ADC 31
Table 5.5.3.1 Pin Description of EEPROM 44
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 4
ALCOHOL DETECTION SYSTEM
CHAPTER1INTRODUCTION
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 5
ALCOHOL DETECTION SYSTEM
1. INTRODUCTIONAlcohol Detector-An Essential Tool. Useful in companies for performing
accurate tests. Reduces the possibility of accidents and it can be incorporated with the
car system. It is the hand held unit so easy to move anywhere. We got the concept of
ADS from ‘ELECTRONICS FOR U’ magazine.
Drunken drivers have been left 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 as such that happened in Delhi in which a car
ran over four road dwellers killing them on the spot. So there is a necessity to
develop an efficient alcohol detection system.
1.1 Purpose/Motivation
The most recent statistic on accidents leading to fatalities in the United States
shows that a staggering 41% of them are alcohol-related. Most of those accidents
were caused by repeat drunk-driving offenders. With this number on the rise every
year, it behooves the nation to have a device that is fail-proof in disallowing the
use of an intoxicated driver’s automobile. With the incorporation of an alcohol
detector controlling the ignition switch ability to operate, these repeat offenders
can be stopped before they even get into their car. Through the combination of a
handheld device and simple circuitry components within the car, this can be made
possible.
1.2 Specifications
The design is relatively simple and given the best current technologies, safe,
accurate, and reliable operation of this device can be guaranteed. The sensor will
take in a sample of the user’s breath through mask for Blood Alcohol
Concentration, or BAC, analysis. The output from the sensor will be fed into a
microcontroller where all of the comparisons to various states limits and
calculations will be made in order for it to get whether that person is having drunk
and what much amount he had in percentage. If the user is legally sober, he will
not be fined at all. If the user is legally drunk and unsuitable to drive or work, he
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 6
ALCOHOL DETECTION SYSTEM
will be fined and no car can be driven until the sample is once again under safe
limits.
Table No 1.1
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 7
ALCOHOL DETECTION SYSTEM
Table No 1.2
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 8
ALCOHOL DETECTION SYSTEM
1.3 Blood Alcohol Concentration
Blood alcohol concentration (BAC) reflects the amount of alcohol in the
body. Food, alcohol content and quantity of beverage, weight, sex, and rate of
elimination determine the BAC after the consumption of alcohol.
To estimate blood alcohol level at a given time, knowledge of other factors
is required. These factors may include age and height of the subject; consumption
start and stop times, pattern of drinking; times when meals were eaten; disease
states; and any medications that may have been taken.
1.4 Alcohol absorption
Alcohol is absorbed from the stomach and small intestine. Most absorption
occurs from the small intestine due to its large surface area and rich blood supply.
The rate of absorption varies with the emptying time of the stomach. Generally the
higher the alcohol concentration of the beverage, the faster the rate of absorption.
However, above a certain concentration, the rate of absorption may decrease due to
the delayed passage of alcohol from the stomach into the small intestine.
The maximum absorption rate is obtained with the consumption of an
alcoholic beverage containing approximately 20-25% (by volume or v/v) alcohol
solution on an empty stomach. The absorption rate may be less when alcohol is
consumed with food or when a 40% (v/v) alcohol solution is consumed on an
empty stomach. The rate may also slow down when high fluid volume/low alcohol
content beverages, such as beer, are consumed.
1.4.1 Normal social drinking
For normal social-type drinking, the highest BAC is usually achieved
within 30 minutes after completion of consumption, though it could take as long as
60 minutes. When large amounts of alcohol are consumed over a short time, or
when a large quantity of food is eaten with the alcohol, the absorption phase may
continue for up to two hours after last consumption.
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 9
ALCOHOL DETECTION SYSTEM
1.4.2 Weight and sex affect BAC
A person's weight and sex determine the total volume of body water and
consequently the BAC obtained upon consumption of a particular quantity of
alcohol. Generally, the more a person weighs, the larger the volume of body water
and the lower the BAC obtained from the consumption of a given amount of
alcohol.
A female may have more fat tissue than a male of the same weight and
therefore a smaller volume of body water. As a result, a female may obtain a
slightly higher BAC upon consumption of the same quantity of alcohol as a male,
all other factors being equal.
1.4.3 Elimination of alcohol
Alcohol is eliminated from the body by excretion and metabolism. Most
alcohol is metabolized or burned in a manner similar to food, yielding carbon
dioxide and water. A small portion of alcohol is excreted, such as through the
breath, leaving the body as alcohol, unchanged. It is this latter process that allows
for breath alcohol testing.
1.4.4 Average rate of elimination
Elimination occurs at a constant rate for a given individual. The median rate
of decrease in BAC is considered to be 15 milligrams per cent (mg %) per hour.
The range of decrease in BAC is 10-20 mg% per hour. This range represents the
extreme ends of the rate encountered in a normal population. Most people
eliminate at a rate of between 13 and 18 mg% per hour. Of these, the majority
eliminates at the higher end. Very few people eliminate at as low a rate as 10 mg%
per hour.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 10
ALCOHOL DETECTION SYSTEM
1.5 Blood Alcohol Content Drink Driving Limits by Country
Lower blood alcohol limits may apply in some countries for professional drivers,
inexperienced drivers or operators of heavy vehicles.
Country BAC (%)
Country BAC (%)
Australia 0.05 Mexico 0.08
Austria 0.05 Namibia 0.05
Bangladesh 0.00 Nepal 0.00
Belgium 0.05 Netherlands 0.05
Bermuda 0.08 New Zealand 0.08
Bhutan No Limit
Norway 0.02
Brazil 0.00 Pakistan 0.00
Canada 0.08 Peru 0.05
Chile 0.05 Philippines 0.05
China 0.02 Pitcairn Islands 0.08
Czech Republic 0.00 Poland 0.02
Denmark 0.05 Portugal 0.05
France 0.05 Puerto Rico 0.08
Germany 0.05 Reunion 0.05
Greece 0.05 Russia 0.03
Guyana 0.01 South Africa 0.05
Hungary 0.00 South Korea 0.05
India 0.03 Sri Lanka 0.08
Indonesia 0.00 Switzerland 0.05
Iran 0.00 Thailand 0.05
Japan 0.00 United Kingdom 0.08
Kazakhstan 0.00 United States 0.08
Kenya 0.08
The Motor Vehicle Act, 1988
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 11
ALCOHOL DETECTION SYSTEM
184. Driving dangerously- Whoever drives a motor vehicle at a speed or in a manner
which is dangerous to public having regard to all the circumstances of the case
including the nature, condition and use of place where the vehicle is driven and the
amount of traffic which actually is at the time or which might reasonably be expected
to be in the place, shall be punishable for the first offence with imprisonment for a
term which may be extended to six months or with fine up to 1000 rupees, and for any
second or subsequent offence if committed within 3 years of the commission of a
previous similar offence with imprisonment for a term which may be extended to 2
years or with fine up to 2000 rupees, or with both.
185. Driving by drunken person or by a person under the influence of the drugs-
Whoever, while driving, or attempting to drive a motor vehicle,--
a) Has, in his blood alcohol exceeding 30 mg. per 100 ml of blood detected in
test by breath analyzer
OR
b) Is under this influence of a drug to such an extent as to be incapable of
exercising proper control over the vehicle.
shall be punishable for the first offence with imprisonment for a term which may
be extended with six month, or with fine which may be extended to 2000 rupees, or
with both; and for second or subsequent offence, if committed within a 3 years of the
commission for previous similar offence, with imprisonment for a term which may be
extended to 2 years, or with fine up to 3000 rupees, or with both.
Explanation – for the purpose of this section, the drug or the drugs specified
by the central government in this behalf, by the notification in the official gazette,
shall be deemed to render a person incapable of exercising a proper control over the
motor vehicle.
1. Provided that any person so arrested in connection with an offence
punishable under section 185 shall within 2 hours of his arrest, be subjected to
medical examination referred in section 203 and 204 by a registered medical
practitioner who he shall be released from custody.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 12
ALCOHOL DETECTION SYSTEM
2. A police officer in uniform may arrest without warrant any person, who has
committed and offence under this act, if such a person refuse to give his name and
address.
3. A police officer arresting without warrant the driver of a motor vehicle
shall if the circumstances so require take or cause to be taken any steps he may
consider proper for temporary disposal of vehicle.
203. Breath Test
1) A police in uniform or an officer of the motor vehicle department as may be
authorized in this behalf by that department may require any person driving or
attempting to drive a motor vehicle in a public place to provide one or more
specimens of breath for breath tests there or nearby, if such a police officer or officer
has any reasonable cause to suspect him of having committed an offence under the
section 185;
Provided that requirement for the breath test shall be made as soon as reasonably
practicable after the commission of such offence
2) If motor vehicle is involved in an accident in a public place and a police officer in
uniform has any reasonable cause to suspect that person who was driving the motor
vehicle at the time of accident had alcohol in his blood or that he was driving under
the influence of drug referred in section 185 he may require the person so driving the
motor vehicle to provide a specimen of his breath for test.
a) In the case of person who is hospitalized as an indoor patient at the hospital
b) In the case of any other person either at or near the place where the requirement
is made or if the police officer thinks fit at a police station specified by the police
officer
Provided that person shall not be required to provide such a specimen while at a
hospital as an indoor patient if the registered medical practitioner in immediate charge
of this case is not first notified of the proposal to make the requirement or object to
the provision of a specimen on the ground that its provision or the requirement to
provide it would be prejudicial to proper care of the patient.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 13
ALCOHOL DETECTION SYSTEM
CHAPTER 2LITERATURE
SURVEY
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 14
ALCOHOL DETECTION SYSTEM
2. LITERATURE SURVEY
In Olden days there was no system available for checking such parameter as
alcohol. For companies that need to perform highly accurate tests with different users
several time a day. An essential tool for responsible managers who look after their
employees and their safety. To overcome such kid of problems we are developing the
detection system which can be hand held & easy to operate.
This system is also useful for the Traffic Control Department to people from
drink & drives the car. If anybody gets caught they can charge him fine. We
incorporate a thermal printer which immediately gives receipt of fine charged.
Every day we hear and read about drivers involved in accidents that are later
charged with drunken driving, and later will hear about the accident on the news. The
news will discuss the suspect’s blood alcohol level and the legal limit for blood
alcohol. A driver might be found to have a level of 0.15, for example, and the legal
limit is 0.08.
But what do those figures mean?
And how do police officers determine if a suspected drunken driver is
actually legally drunk? You may have heard about a tool called a Breathalyzer – a
device used in breath alcohol analysis – but may not know exactly how a person’s
breath reveals how much he or she has had to drink.
It is important for our public safety that people who are drunk should not be
on the road. Of the many thousands of traffic deaths each year in the United States,
about 35 to 40 percent are related to alcohol. Drivers who are able to successfully pass
police sobriety tests – those who can touch their noses or walk a straight line without
falling over – still might be breaking the law by exceeding the legal limit for blood
alcohol and be a hazard on the road. Police departments now use modern technology
to $determine impairment in suspected drunk drivers and to prevent fatalities.
Police departments and many individual officers are now equipped with breath
alcohol testers (Breathalyzers are one type) to determine drunk driving suspects’
blood alcohol concentration (BAC). That’s because alcohol intoxication is legally
defined by the BAC level.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 15
ALCOHOL DETECTION SYSTEM
Taking a blood sample out on the road and taking it back to the lab for analysis was
not practical or efficient for arresting those who were suspected of driving while
impaired (DWI) or driving under the influence (DUI). A urine test for alcohol was
just as impractical as blood sampling. Officials needed a less invasive way to measure
BAC levels.
In the 1940s, the first breath alcohol testing devices were developed for
police use. In 1954, Dr. Robert Borkenstein of the Indiana State Police invented the
Breathalyzer, which is an efficient type of alcohol testing device used by many law
enforcement departments today.
Alcohol that a person drinks will always appear in his breath. This is because
alcohol is absorbed from that person’s mouth, throat, stomach and intestines into the
bloodstream. Alcohol is not digested like food is, nor chemically changed in the
bloodstream upon absorption.
When a person’s blood passes through his or her lungs, some of the ingested alcohol
travels across the membranes of the lung’s air sacs and moves into the air. This
process is one of alcohol’s main properties of evaporating from a volatile solution. So,
the alcohol concentration from lung air is directly related to the alcohol concentration
from the blood.
When the alcohol in the lung air is exhaled, it can usually be detected by any
modern breath testing device. So, this allows any police officer to handle suspected
drunk driver tests in a faster and simpler way. Instead of having to draw a suspected
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 16
ALCOHOL DETECTION SYSTEM
drunk’s blood to test his alcohol level, the officer is able to perform a quick test on
that driver’s breath on the spot. He can instantly determine if there is a reason to arrest
the driver.
The relationship between the alcohol concentration in the breath and the
concentration in the blood lets us easily find out the BAC by measuring alcohol
concentration level on the breath. The ratio of alcohol in the breath to that in the blood
is 2,100:1. So, we can quickly calculate that 2,100 milliliters (ml) of lung air has the
same amount of alcohol as 1 ml of blood.
For a long period of time, the US has kept the legal standard for drunkenness
around 0.10, but now in all states has adopted the 0.08 federal BAC standards because
the federal government put pressure on the states to lower the legal limit. The
American Medical Association says that a person can become impaired when the
blood alcohol level hits 0.05.
When a person’s BAC measures 0.08, it means that he or she has 0.08 grams
of alcohol per 100 ml of blood.
.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 17
ALCOHOL DETECTION SYSTEM
CHAPTER 3BLOCK DIAGRAM
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 18
ALCOHOL DETECTION SYSTEM
3. BLOCK DIAGRAM
Air Inlet
Fig 3.1 block diagram
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 19
AlcoholSensor
SignalConditioner
ADC
Micro-ControllerAT89S52
LCD Display
KeypadInterface
Thermal Printer
RS 232 Cable
PC Interface
ALCOHOL DETECTION SYSTEM
Working-
The individual on whom we are performing test will give his breath into air
inlet. Then gas sensing layer of alcohol sensor (SnO2) senses the alcohol in breath. In
accordance to amount of alcohol the resistance of sensor goes on changing. Since the
output of alcohol sensor is analog resistive output which is given to signal
conditioning circuit.
At signal conditioner it will get amplified and given to the microcontroller
through ADC .The output of signal condition circuit is analog voltage in the range of
0 to 5V which is converted in to digital form in the range of TTL voltage levels. It is
compatible to microcontroller.
Then microcontroller compares this signal with predefined range and
display the result on LCD. The data displayed on LCD consist of amount of alcohol
detected in percentage, fine charged according to that individual, number of vehicle
and date.
At the same time controller will send data to thermal printer where it will
print the receipt containing the information same as displayed by the LCD. To keep
the record of amount of fine collected over a particular period it may be one week or
one month so here provided the computer interfacing by using RS-232 cable.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 20
ALCOHOL DETECTION SYSTEM
CHAPTER 4CIRCUIT
DIAGRAM
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 21
ALCOHOL DETECTION SYSTEM
4. CIRCUIT DIAGRAM
Fig 4.1 Circuit Diagram
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 22
ALCOHOL DETECTION SYSTEM
CHAPTER 5COMPONENTS
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 23
ALCOHOL DETECTION SYSTEM
5. LIST OF COMPONENTS
1. ALCOHOL SENSOR
2. ADC(0808)
3. MICROCONTROLLER(89S52)
4. LCD DISPLAY
5. EEPROM
6. KEYPAD
7. MAX 232
8. THERMAL PRINTER
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 24
ALCOHOL DETECTION SYSTEM
5.1 ALCOHOL SENSOR (MQ-3 SENSOR)
MQ-3 GAS SENSOR
FEATURES:
* High sensitivity to alcohol and small sensitivity to Benzene.
* Fast response and High sensitivity
* Stable and long life
* Simple drive circuit
APPLICATION:
They are suitable for alcohol checker, Breathalyzer.
SPECIFICATIONS Fig 5.1.1
Table 5.1.1 Standard work condition
Symbol Parameter name Technical condition
Remarks
Vc Circuit voltage 5V±0.1 AC OR DC
VH Heating voltage 5V±0.1 ACOR DC
RL Load resistance 200KΩ
RH Heater resistance 33Ω±5% Room Tem
PH Heating consumption
less than 750mw
Table 5.1.2 Environment condition
Symbol Parameter name Technical condition Remarks
Tao Using Tem -10℃-50℃Tas Storage Tem -20℃-70℃RH Related humidity less than 95%Rh
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 25
ALCOHOL DETECTION SYSTEM
Table 5.1.3 Sensitivity characteristic
Symbol Parameter name Technical parameter
Remarks
Rs Sensing Resistance 1MΩ- 8 MΩ(0.4mg/L alcohol )
Detecting concentrationscope:0.05mg/L—10mg/LAlcohol
Α(0.4/1 mg/L)
Concentration slope rate
≤0.6
Standarddetectingcondition
Temp: 20℃}2� ℃ Vc:5V±0.1Humidity: 65%±5% Vh: 5V±0.1
Preheat time Over 24 hour
Table 5.1.4 Structure and configuration, basic measuring circuit
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 26
ALCOHOL DETECTION SYSTEM
Sr.No. Parts Materials
1 Gas sensingLayer
SnO2
2 Electrode Au
3 Electrode line Pt
4 Heater coil Ni-Cr alloy
5 Tubular ceramic Al2O3
6 Anti-explosionnetwork
Stainless steel gauze(SUS316 100-mesh)
7 Clamp ring Copper plating
Ni
8 Resin base Bakelite
5.1.2 CONNECTION DIAGRAM:
Fig 5.1.2.1
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 27
ALCOHOL DETECTION SYSTEM
5.1.3 SENSITVITY ADJUSTMENT
Resistance value of MQ-3 is difference to various kinds and various concentration
gases. So, when using this component, 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 200 KΩ
(100KΩ to 470 KΩ).
When accurately measuring, the proper alarm point for the gas detector should be
determined after considering the temperature and humidity influence.
5.1.4 Solenoid valve
A solenoid valve is an electromechanical valve for use with liquid or gas. The valve
is controlled by an electric current through a solenoid coil. Solenoid valves may have
two or more ports: in the case of a two-port valve the flow is switched on or off; in the
case of a three-port valve, the outflow is switched between the two outlet ports.
Multiple solenoid valves can be placed together on a manifold.
Solenoid valves are the most frequently used control elements in fluidics. Their tasks
are to shut off, release, dose, distribute or mix fluids. They are found in many
application areas. Solenoids offer fast and safe switching, high reliability, long service
life, good medium compatibility of the materials used, low control power and
compact design.
5.1.5 Working principle
A solenoid valve has two main parts: the solenoid and the valve. The solenoid
converts electrical energy into mechanical energy which, in turn, opens or closes the
valve mechanically. A direct acting valve has only a small flow circuit, shown within
section E of this diagram (this section is mentioned below as a pilot valve). This
diaphragm piloted valve multiplies this small flow
by using it to control the flow through a much larger
orifice.
Solenoid valves may use metal seals or rubber seals, and
may also have electrical interfaces to allow for
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 28
ALCOHOL DETECTION SYSTEM
easy control. A spring may be used to hold the valve opened or closed while the valve
is not activated.
Fig 5.1.5.1
Constructional diagram:
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 29
ALCOHOL DETECTION SYSTEM
A-Input side
B- Diaphragm
C- Pressure chamber
D- Pressure relief conduit
E- Solenoid
F- Output side
At the top figure is the valve in its closed state. The water under pressure
enters at A. B is an elastic diaphragm and above it is a weak spring pushing it down.
The function of this spring is irrelevant for now as the valve would stay closed even
without it. The diaphragm has a pinhole through its center which allows a very small
amount of water to flow through it. This water fills the cavity C on the other side of
the diaphragm so that pressure is equal on both sides of the diaphragm. While the
pressure is the same on both sides of the diaphragm, the force is greater on the upper
side which forces the valve shut against the incoming pressure. In the figure, the
surface being acted upon is greater on the upper side which results in greater force.
On the upper side the pressure is acting on the entire surface of the diaphragm while
on the lower side it is only acting on the incoming pipe. These results in the valve
being securely shut to any flow and, the greater the input pressure, the greater the
shutting force will be.
In the previous configuration the small conduit D was blocked by a pin which
is the armature of the solenoid E and which is pushed down by a spring. If the
solenoid is activated by drawing the pin upwards via magnetic force from the solenoid
current, the water in chamber C will flow through this conduit D to the output side of
the valve. The pressure in chamber C will drop and the incoming pressure will lift the
diaphragm thus opening the main valve. Water now flows directly from A to F.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 30
ALCOHOL DETECTION SYSTEM
5.2 ADC (Analog to Digital Convertor)
5.2.1 Description
The ADC0808, ADC0809 data acquisition component is a monolithic
CMOS device with an 8-bit analog-to-digital converter, 8-channel multiplexer and
microprocessor compatible control logic. The 8-bit A/D converter uses successive
approximation as the conversion technique. The converter features a high
impedance chopper stabilized comparator, a 256R voltage divider with analog
switch tree and a successive approximation register. The 8-channel multiplexer can
directly access any of 8-single-ended analog signals.
ADC0808 is an 8 bit analog to digital converter with eight input
analog channels, i.e., it can take eight different analog inputs. The input which is to
be converted to digital form can be selected by using three address lines. The
voltage reference can be set using the Vref+ and Vref- pins. The step size is
decided based on set reference value. Step size is the change in analog input to
cause a unit change in the output of ADC. The default step size is 19.53mV
corresponding to 5V reference voltage. ADC0808 needs an external clock to
operate unlike ADC0804 which has an internal clock. The ADC needs some
specific control signals for its operations like start conversion and bring data to
output pins. When the conversion is complete the EOC pins goes low to indicate
the end of conversion and data ready to be picked up. The device eliminates the
need for external zero and full-scale adjustments. Easy interfacing to
microprocessors is provided by the latched and decoded multiplexer address inputs
and latched TTL TRI-STATE outputs.
5.2.2 Pin Description
PIN NODISCRIPTION PIN NO DISCRIPTION
1 IN3 - Analog Input 3 15 2(-6) - Tri-State Output Bit 6
2 IN4 - Analog Input 4 16 Vref- - Voltage Reference Negative Input
3 IN5 - Analog Input 5 17 2(-8) - Tri-State Output Bit 8
4 IN6 - Analog Input 6 18 2(-4) - Tri-State Output Bit 4
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 31
ALCOHOL DETECTION SYSTEM
5 IN7 - Analog Input 7 19 2(-3) - Tri-State Output Bit 3
6 START - Start Conversion 20 2(-2) - Tri-State Output Bit 2
7 EOC - End Of Conversion 21 2(-1) - Tri-State Output Bit 1
8 2(-5) - Tri-State Output Bit 5 22 ALE - Address Latch Enable
9 OUT EN - Output Enable 23 ADD C - Address Input C
10 CLK - Clock 24 ADD B - Address Input B
11 Vcc - Positive Supply 25 ADD A - Address Input A
12 Vref+ - Positive Voltage Reference Input
26IN0 - Analog Input 0
13 GND - Ground 27 IN1 - Analog Input 1
14 2(-7) - Tri-State Output Bit 7 28 IN2 - Analog Input 2
Fig 5.2.1
Key Features
Resolution8 Bits
Total Unadjusted Error ±½ LSB and ±1 LSB
Single Supply 5 VDC
Low Power 15 Mw
Conversion Time 100 μs
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 32
ALCOHOL DETECTION SYSTEM
5.3 MICROCONTROLLER (89S52)
5.3.1 DEFINITION OF A MICROCONTROLLER
Microcontroller, as the name suggests, are small controllers. They are like
single chip computers that are often embedded into other systems to
function as processing/controlling unit. For example, the remote control
you are using probably has microcontrollers inside that do decoding and
other controlling functions. They are also used in automobiles, washing
machines, microwave ovens, toys ... etc, where automation is needed.
The key features of microcontrollers include:
High Integration of Functionality-
Microcontrollers sometimes are called single-chip computers because they have
on-chip memory and I/O circuitry and other circuitries that enable them to function
as small standalone computers without other supporting circuitry.
Field Programmability, Flexibility-
Microcontrollers often use EEPROM or EPROM as their storage device to allow
field programmability so they are flexible to use. Once the program is tested to be
correct then large quantities of microcontrollers can be programmed to be used in
embedded system
Easy to Use-
Assembly language is often used in microcontrollers and since they usually
follow RISC architecture, the instruction set is small. The development package of
microcontrollers often includes an assembler, a simulator, a programmer to "burn"
the chip and a demonstration board. Some packages include a high level language
compiler such as a C compiler and more sophisticated libraries.
A serial I/O port to allow data to flow between the microcontroller and
other devices such as a PC or another microcontroller.
5.3.2 FEATURES OF MICROCONTROLLER 89S52
The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 33
ALCOHOL DETECTION SYSTEM
8K bytes of Flash programmable and erasable read only memory (PEROM). The
device is manufactured using Atmel’s high density nonvolatile memory. The Atmel
AT89C52 is a powerful microcomputer which provides a highly flexible and cost
effective solution to many applications.
Also some features are,
-256 x 8-Bit Internal RAM
- 32 Programmable I/O Lines
- Three 16-bit Timer/Counters
- Eight Interrupt Sources
- Low Power Idle and Power Down Modes
5.3.3 PIN OUT OF MICROCONTROLLER
Fig5.3.3.1 Pin out Diagram of µC 89S52
Pin Diagram of 8952 Microcontroller
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 34
ALCOHOL DETECTION SYSTEM
5.3.4 PIN DESCRIPTION OF 8952 MICROCONTROLLER
1. VCC: - Supply voltage.
2. GND:-Ground.
3. Port 0:-
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can
sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as
high impedance inputs. Port 0 can also be configured to be the multiplexed low
order address/data bus during accesses to external program and data memory. In
this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash
programming and outputs the code bytes during program verification. External
pull-ups are required during program verification.
4. Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1
pins that are externally being pulled low will source current (IIL) because of the
internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the
timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input
(P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the
low-order address bytes during Flash programming and verification.
5. Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2
pins that are externally being pulled low will source current (IIL) because of the
internal pull-ups. Port 2 emits the high-order address byte during fetches from
external program memory and during accesses to external data memory that uses
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 35
ALCOHOL DETECTION SYSTEM
16-bit addresses (MOVX [at] DPTR). In this application, Port 2 uses strong
internal pull-ups when emitting 1s. During accesses to external data memory that
uses 8-bit addresses (MOVX [at] RI), Port 2 emits the contents of the P2 Special
Function Register. Port 2 also receives the high-order address bits and some control
signals during Flash programming and verification.
6. Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pull ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3
pins that are externally being pulled low will source current (IIL) because of the
pull-ups. Port 3 also serves the functions of various special features of the
AT89C52. Port 3 also receives some control signals for Flash programming and
verification.
7. RST
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.
8. ALE/PROG
Address Latch Enable is an output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input
(PROG) during Flash programming. In normal operation, ALE is emitted at a
constant rate of 1/6 the oscillator frequency and may be used for external timing or
clocking purposes. Note, however, that one ALE pulse is skipped during each
access to external data memory. If desired, ALE operation can be disabled by
setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a
MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the
ALE-disable bit has no effect if the microcontroller is in external execution mode.
9. PSEN
Program Store Enable is the read strobe to external program memory. When the
AT89C52 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 36
ALCOHOL DETECTION SYSTEM
each access to external data memory.
10. EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device
to fetch code from external program memory locations starting at 0000H up to
FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally
latched on reset.
EA should be strapped to VCC for internal program executions. This pin
also receives the 12-volt programming enable voltage (VPP) during Flash
programming when 12-volt programming is selected.
11. XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
12. XTAL2
Output from the inverting oscillator amplifier.
MEMORY UNIT
Memory is part of the microcontroller whose function is to store data.
The easiest way to explain it is to describe it as one big closet with lots of drawers.
If we suppose that we marked the drawers in such a way that they cannot be
confused, any of their contents will then be easily accessible. It is enough to know
the designation of the drawer and so its contents will be known to us for sure.
Memory components are exactly like that. For a certain input we get the contents
of a certain addressed memory location and that's all. Two new concepts are
brought to us: addressing and memory location. Memory consists of all memory
locations, and addressing is nothing but selecting one of them. This means that we
need to select the desired memory location on one hand, and on the other hand we
need to wait for the contents of that location. Besides reading from a memory
location, memory must also provide for writing onto it. This is done by supplying
an additional line called control line. We will designate this line as R/W
(read/write). Control line is used in the following way: if r/w=1, reading is done,
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 37
ALCOHOL DETECTION SYSTEM
and if opposite is true then writing is done on the memory location. Memory is the
first element, and we need a few operation of our microcontroller.
The amount of memory contained within a microcontroller varies between different
microcontrollers. Some may not even have any integrated memory (e.g. Hitachi
6503, now discontinued). However, most modern microcontrollers will have
integrated memory. The memory will be divided up into ROM and RAM, with
typically more ROM than RAM.
Typically, the amount of ROM type memory will vary between around 512 bytes
and 4096 bytes, although some 16 bit microcontrollers such as the Hitachi H8/3048
can have as much as 128 Kbytes of ROM type memory.
ROM type memory, as has already been mentioned, is used to store the program
code. ROM memory can be ROM (as in One Time Programmable memory),
EPROM, or EEPROM.
The amount of RAM memory is usually somewhat smaller, typically
ranging between 25 bytes to 4 Kbytes. RAM is used for data storage and stack
management tasks. It is also used for register stacks (as in the microchip PIC range
of microcontrollers).
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 38
ALCOHOL DETECTION SYSTEM
5.3.5 RESET CIRCUIT
Fig 5.3.5.1 Reset Circuit Diagram
• Requires 2 machine cycles to reset controller
• Uses RC combination to give the delay of 2 machine cycle to reset
controller.
5.3.6 CRYSTAL CIRCUIT
Fig5.3.6.1 Crystal Circuit Diagram
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 39
ALCOHOL DETECTION SYSTEM
5.4 LCD(Liquid Crystal Display)
LCD is the Liquid Crystal Display used for displaying the commands and data.
Fig5.6.1 LCD Display
It has 14 pins.
• VCC
• GND
• VEE- It is provided to LCD for controlling the contrast.
• Also there are two register present inside the LCD i.e. COMMAND and
DATA REGISTER.
-The COMMAND REGISTER allows the user to send a command such
as clear display, curser at home, or display the number, etc
-The DATA REGISTER allows the user to send data to be displayed on
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 40
ALCOHOL DETECTION SYSTEM
the LCD.
• ENABLE pin is used by LCD to latch the information present to its data
pins.
• READ/WRITE pins are used to write or read the information.
• D0-D7 is the 8bit data pins used to send information to the LCD.
5.4.1 DESCRIPTION
An LCD is a small low cost display. It is easy to interface with a micro-
controller because of an embedded controller (the black blob on the back of the
board).This controller is standard across many displays (HD 44780) which means
many micro-controllers have libraries that make displaying messages as easy as a
single line of code.
This is the first interfacing example for the Parallel Port. We will start with
something simple. This example doesn't use the Bi- directional feature found on
newer ports, thus it should work with most, if no all Parallel Ports. It however
doesn't show the use of the Status Port as an input. So what are we interfacing? A
16 Character x 2 Line LCD Module to the Parallel Port. These LCD Modules are
very common these days, and are quite simple to work with, as all the logic
required running them is on board.
These instructions must be sent to the LCD's Instruction Register which is
c controlled by the Register Select (Pin 4). When pin 4 is low the instruction
register is selected, thus when high the data register must be selected. We connect
this to the Parallel Port's Select Printer line which happens to be hardware inverted.
Therefore if we write a '1' to bit 3 of the Control Register the Select Printer line goes
low.
We want to first send instructions to the LCD module. Therefore the
Register Select line must be low. As it is hardware inverted, we will want to set bit
3 of the Control Register to '1'.
5.4.2 SCHEMATIC
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 41
ALCOHOL DETECTION SYSTEM
Fig 5.4.2.1
5.4.3 CIRCUIT DESCRIPTION
Above is the quite simple schematic. The LCD panel's Enable and
Register Select is connected to the Control Port. The Control Port is an open
collector / open drain output. While most Parallel Ports have internal pull-up
resistors, there is a few which don't. Therefore by incorporating the two 10K
external pull up resistors, the circuit is more portable for a wider range of
computers, some of which may have no internal pull up resistors.
We make no effort to place the Data bus into reverse direction.
Therefore we hard wire the R/W line of the LCD panel, into write mode. This will
cause no bus conflicts on the data lines. As a result we cannot read back the LCD's
internal busy flag which tells us if the LCD has accepted and finished processing
the last instruction. This problem is overcome by inserting known delays into our
program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing
fancy here. As with all the examples, I've left the power supply out. You can use a
bench power supply set to 5v or use a onboard +5 regulator. Remember a few de-
coupling capacitors, especially if you have trouble with the circuit working
properly
After we place a data byte on the data lines, we must then signal to the
LCD module to read the data. This is done using the Enable line. Data is clocked
into the LCD module on the high to low transition. The Strobe is hardware inverted,
thus by setting bit 0 of the Control Register we get a high to low transition on the
Strobe line. We then wait for a delay, and return the line to a high state ready for the
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 42
ALCOHOL DETECTION SYSTEM
next byte.
After we initialize the LCD Module, we want to send text to it. Characters
are sent to the LCD's Data Port, thus we want to clear bit 3.
The delays should be suitable for most machines. If the LCD panel is not
initializing properly, we can try increasing the delays.
5.5 EEPROM MEMORY
The EEPROM Memory is used for storing the overall voting’s data.
The device is optimized for use in many industrial and commercial applications
where low power and low voltage operation are essential. Also to read or to write
the data, the Memory read & writes facilities are provided. It has high reliability,
that is, the data retention must be long duration. It required only electricity to erase
the data.
5.5.1 FEATURES OF EEPROM
• Low-Voltage and Standard-Voltage Operation
– 2.7 (VCC = 2.7V to 5.5V)
– 1.8 (VCC = 1.8V to 5.5V)
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 43
ALCOHOL DETECTION SYSTEM
• Low-Power Devices (ISB = 2 μA at 5.5V) Available
• Internally Organized 4096 x 8, 8192 x 8
• 2-Wire Serial Interface
• Schmitt Trigger, Filtered Inputs for Noise Suppression
• Bidirectional Data Transfer Protocol
• 100 kHz (1.8V, 2.5V, 2.7V) and 400 kHz (5V) Clock Rate
• Write Protect Pin for Hardware Data Protection
• 32-Byte Page Write Mode.
• Self-Timed Write Cycle (10 ms max)
• High Reliability
– Endurance: 1 Million Write Cycles
– Data Retention: 100 Years
• Automotive Grade and Extended Temperature Devices Available
• 8-Pin JEDEC PDIP, 8-Pin JEDEC SOIC, 8-Pin EIAJ SOIC,
and 8-pin TSSOP Packages
5.5.2 DESCRIPTION
The AT24C32/64 provides 32,768/65,536 bits of serial electrically erasable
and programmable read only memory (EEPROM) organized as 4096/8192 words
of 8 bits each. The device’s cascadable feature allows up to 8 devices to share a
common 2-wire bus. The device is optimized for use in many industrial and
commercial applications, where low power and low voltage operation are essential.
The AT24C32/64 is available in space saving 8-pin JEDEC PDIP, 8-pin
JEDEC SOIC, 8-pin EIAJ SOIC, and 8-pin TSSOP (AT24C64) package.
5.5.3 PIN CONFIGURATION OF EEPROM
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 44
ALCOHOL DETECTION SYSTEM
Table 5.5.3.1 Pin configuration of EEPROM
Fig5.5.3.1 Pin out of EEPROM
5.5.4 PIN DESCRIPTION
SERIAL CLOCK (SCL): The SCL input is used to positive edge clock data into
each EEPROM device and negative edge clock data out of each device.
SERIAL DATA (SDA): The SDA pin is bidirectional for serial data transfer. This
pin is open-drain driven and may be wire-O Red with any number of other open-
drain or open collector devices.
DEVICE/PAGE ADDRESSES (A2, A1, A0): The A2, A1 and A0 pins are device address inputs that are hard wired or
left not connected for hardware compatibility with AT24C16. When the pins are
hardwired, as many as eight 32K/64K devices may be addressed on a single bus
system (device addressing is discussed in detail under the Device Addressing
section). When the pins are not hardwired, the default A2, A1, and A0 are zero.
WRITE PROTECT (WP):
The write protect input, when tied to GND, allows normal write operations.
When WP is tied high to VCC, all write operations to the upper quandrant (8/16K
bits) of memory are inhibited. If left unconnected, WP is internally pulled down to
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 45
ALCOHOL DETECTION SYSTEM
GND.
5.6 KEYPAD INTERFACING
Fig5.6.1. Keypad Interfacing
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 46
ALCOHOL DETECTION SYSTEM
5.6.1 KEYPAD CONNECTION
Fig5.6.1.1Keypad connection
5.7 MAX 232
It is a voltage converter device in which it converts the TTL logic level to
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 47
ALCOHOL DETECTION SYSTEM
the RS-232 voltage level and vice versa. So it is also referred as line driver. The
MAX-232 is interface with PC and operates at +5V power supply.
Also MAX-232 is provides the ESD protection to the RS-232 input and
output pins.
5.7.1 MAX-232 INTERFACING
Fig5.7.1.1 MAX232 Interfacing
5.7.2 DISCRIPTION OF MAX-232
The MAX202E–MAX213E, MAX232E/MAX241E consists of three
sections: charge-pump voltage converters, drivers (transmitters), and receivers.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 48
ALCOHOL DETECTION SYSTEM
These E versions provide extra protection against ESD. They survive ±15kV
discharges to the RS-232 inputs and outputs, tested using the Human Body Model.
When tested according to IEC1000-4-2, they survive ±8kV contact discharges and
±15kV air-gap discharges.
The rugged E versions are intended for use in harsh environments or
applications where the RS-232 connection is frequently changed (such as notebook
computers). The standard (non-“E”) MAX202, MAX203, MAX205–MAX208,
MAX211, MAX213, MAX232, and MAX241 are recommended for applications
where cost is critical.
Voltage Converter
The +5V to ±10V conversion is performed by dual charge-pump voltage
converters (Figure 4). The first charge-pump converter uses capacitor C1 to double
the +5V into +10V, storing the +10V on the output filter capacitor, C3. The second
uses C2 to invert the +10V into -10V, storing the -10V on the V- output filter
capacitor, C4. In shutdown mode, V+ is internally connected to VCC by a 1k½
pull-down resistor, and V- is internally connected to ground by a 1k½ pull-up
resistor.
RS-232 Drivers
With VCC = 5V, the typical driver output voltage swing is ±8V when
loaded with a nominal 5k½ RS-232 receiver. The output swing is guaranteed to
meet EIA/TIA-232E and V.28 specifications that call for ±5V minimum output
levels under worst-case conditions. These include a 3k½ load, minimum VCC, and
Maximum operating temperature. The open-circuit output voltage swings from (V+
- 0.6V) to V-. Input thresholds are CMOS/TTL compatible. The unused drivers’
inputs on the MAX205E–MAX208E, MAX211E, MAX213E, and MAX241E can
be left Unconnected because 400k½ pull-up resistors to VCC are included on-chip.
Since all drivers invert, the pull up resistors force the unused drivers’ outputs low.
The MAX202E, MAX203E, and MAX232E do not have pull up resistors
on the transmitter inputs.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 49
ALCOHOL DETECTION SYSTEM
RS-232 Receivers
The receivers convert the RS-232 signals to CMOS-logic output levels.
The guaranteed 0.8V and 2.4V receiver input thresholds are significantly tighter
than the ±3V thresholds required by the EIA/TIA-232E specification. This allows
the receiver inputs to respond to TTL/CMOS logic levels, as well as RS-232 levels.
The guaranteed 0.8V input low threshold ensures that receivers shorted to ground
have logic 1 output. The 5k½ input resistances to ground ensures that a receiver
with its input left open will also have logic 1 output. Receiver inputs have
approximately 0.5V hysteresis. This provides clean output transitions, even with
slow rise/fall-time signals with moderate amounts of noise and ringing. In
shutdown, the MAX213E’s R4 and R5 receivers have no hysteresis.
RS–232 SPECIFICATIONS
RS–232 is a “complete” standard. This means that the standard sets out to
ensure compatibility between the host and peripheral systems by specifying 1)
common voltage and signal levels, 2)common pin wiring configurations, and 3) a
minimal amount of control information between the host and peripheral systems.
Unlike many standards which simply specify the electrical characteristics of a
given interface, RS–232 specifies electrical, functional, and mechanical
characteristics in order to meet the above three criteria.
5.8 THERMAL PRINTER
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 50
ALCOHOL DETECTION SYSTEM
Fig 5.8.1
Thermal Printer
Operates on 5V DC & 1.5A average current. Size :85(W) x 76(L) x 43(H) mm Uses RS-232 level signals for serial interface. Uses Thermo chromic paper for printer
A thermal printer (or direct thermal printer) produces a printed
image by selectively heating coated thermo chromic paper, or thermal paper as it is
commonly known, when the paper passes over the thermal print. The coating
turns black in the areas where it is heated, producing an image. Two-color direct
thermal printers can print both black and an additional color (often red) by
applying heat at two different temperatures.
Thermal transfer printing is a related method that uses a heat-sensitive
ribbon instead of heat-sensitive paper.
A thermal printer comprises these key components:
Thermal head — generates heat; prints on paper
Platen — a rubber roller that feeds paper
Spring — applies pressure to the thermal head, causing it to contact the thermo-
sensitive paper
Controller boards — for controlling the mechanism
In order to print, thermo-sensitive paper is inserted between the
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 51
ALCOHOL DETECTION SYSTEM
thermal head and the platen. The printer sends an electrical current to the heating
elements of the thermal head, which generate heat. The heat activates the thermo-
sensitive coloring layer of the thermo-sensitive paper, which changes color where
heated. Such a printing mechanism is known as a thermal system or direct
system. The heating elements are usually arranged as a matrix of small closely-
spaced dots—thermal printers are actually dot-matrix printers, though they are not
so called.
The paper is impregnated with a solid-state mixture of a dye and a
suitable matrix; a combination of a fluoranleucodye and an octadecylphosphonic
acid is an example. When the matrix is heated above its melting point, the dye
reacts with the acid, shifts to its colored form, and the changed form is then
conserved in metastable state when the matrix solidifies back quickly enough. See
thermochromism.
Controller boards are embedded with firmware to manage the thermal
printer mechanisms. The Firmware can manage multiple bar code types, graphics
and logos. They enable the user to choose between different resident fonts (also
including Asian fonts) and character sizes.
Controller boards can drive various sensors such as paper low, paper
out, door open, top of form etc., and they are available with a variety of interfaces,
such as RS-232, parallel, USB and wireless. For point of sale application some
boards can also control the cash drawer.
Thermal printers print more quietly and usually faster than impact dot
matrix printers. They are also smaller, lighter and consume less power, making
them ideal for portable and retail applications. Cost of thermal paper, their only
consumable, was somewhat less than US$0.10 per sheet as of 2010. By
comparison, one study of the per page cost of color inkjet printers [3] found cost of
third-party ink cartridge and paper to be about $0.05 per page (some low-capacity
cartridges are more expensive to use). Roll-based printers can be rapidly refilled.
Commercial applications of thermal printers include filling station pumps,
information kiosks, point of sale systems, voucher printers in slot machines, print
on demand labels for shipping and products, and for recording live rhythm strips on
hospital cardiac monitors.
Through the 1990s many fax machines used thermal printing
technology. Toward the beginning of the 21st century, however, thermal wax
transfer, laser, and inkjet printing technology largely supplanted thermal printing
technology in fax machines, allowing printing on plain paper.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 52
ALCOHOL DETECTION SYSTEM
The Game Boy Printer, made in 1998, was a small thermal printer used
to print out certain elements from some Game Boy games. Early formulations of
the thermo-sensitive coating used in thermal paper were sensitive to incidental
heat, abrasion, friction (which can cause heat, thus darkening the paper), light
(which can fade printed images), and water. Later thermal coating formulations are
far more stable; theoretically, thermally-printed text should remain legible at least
50 years.
Hospitals commonly record fetal ultrasound scan images on thermal
paper. This can cause problems if the parents wish to preserve the image by
laminating it, as the heat of most laminators will darken the entire page—this can
be tested for beforehand on an unimportant thermal print. An option is to make and
laminate a permanent ink duplicate of the image.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 53
ALCOHOL DETECTION SYSTEM
CHAPTER 6SOFTWARE
DEVELOPMENT
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 54
ALCOHOL DETECTION SYSTEM
6. SOFTWARE DEVELOPMENT6.1 FLOW CHART OF MAIN PROGRAM:
No
Yes
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 55
START
Initialize Serial Comm., Buffers, I/O Devices, etc….
Initialize Interrupt and Hardware
Take analog input of Sensor and give it to ADC for conversion.
Take digital input from ADC and give it to µC for processing.
Is Alcohol Detecte
d?
Check for the level of alcohol detected.
Store the data in EEPROM memory.
Print the report and Fine charged through Thermal Printer.
Input Vehicle Number and Date through keypad.
STOP
START
CALL DELAY
SEND COMMAND
SELECT REGISTER
ENABLE LCD
SEND DATA
CALL DATA ROUTINE
CALL DELAY
STOP
ALCOHOL DETECTION SYSTEM
6.2 FLOW CHART FOR LCD INTERFACING
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 56
START
TAKE DATA FROM P1 TO ACCUMULATOR
REPEAT PROCESS
COMPARE WITH KEY ADDRESS OR DATA
DISPLAY CHARACTER
ALCOHOL DETECTION SYSTEM
6.3 FLOW CHART FOR KEYPAD INTERFACING
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 57
ALCOHOL DETECTION SYSTEM
CHAPTER 7ADVANTAGES
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 58
ALCOHOL DETECTION SYSTEM
7. ADVANTAGES
1. Easy and Efficient To Test Alcohol detection system is portable hand held devices that are easy to handle and provide quick results. The design and material of Alcohol detection system make it strong to use on field and withstand rough field conditions. The breathalyzers consists of three parts: a mouthpiece, two glass vials containing chemical reaction mixture, and photocells to measure color change. The breathalyzers can easily fit in bag, or purse making it easy to carry anywhere. The portable nature of alcohol detection system makes it a suitable device for random alcohol testing at workplaces, industries etc. The subject has to blow into the mouthpiece and results are displayed in few seconds. Keeping a portable breathalyzers at workplaces makes alcohol monitoring easy and causes very less disruptions during work time. It is difficult to tamper breathalyzers result.
2. Quick and Accurate Results Breathalyzers provide quick and accurate results in few seconds. The alcohol detection sensor in breathalyzers is sensitive enough to detect presence of alcohol with considerable BAC accuracy. The sensor is build strong enough to provide accurate results for several times. The breathalyzers are passed through various quality assurance tests and strict quality requirements. Although portable breathalyzers provide results with considerable accuracy, more advanced types of breathalyzers like Intoxilyzer and Alco sensor can detect alcohol with greater efficiency. Portable breathalyzers are used for preliminary breath test (PBT) and its results are not court admissible. However, the results given by Intoxilyzer are court admissible while that of Alco sensor are not.
3. Helpful For Organizations and Police The law enforcement officers use breathalyzers on highways and roads to check drunken driving that can lead to accidents. Every year large number of accidents occurs on highways and roads due to drunken driving. Drivers who drink and drive put their life as well as others lives at risk. Breathalyzers prove to be an effective tool in checking drunken driving and prevailing of safe driving conditions on highways and roads.
4. Alcohol abuse leads to low productivity, absenteeism, and accidents at workplaces, industries and offices. A lot of alcohol related crimes, injuries can occur at workplaces. There is higher possibility that persons addicted to alcohol can harm themselves or injure others at workplaces. The breathalyzers can help to maintain a safe and productive environment at workplaces. Using breathalyzers for alcohol detection is also a non-invasive way of detection. Even alcohol consumers can use personal breathalyzers which are inexpensive to pre-examine themselves for level of alcohol in blood before driving. As Alcohol testing in laboratories takes more time, breathalyzers provide an easy, quick, and reliable way for alcohol testing at homes, colleges, offices, and highways.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 59
ALCOHOL DETECTION SYSTEM
CHAPTER 8APPLICATIONS
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 60
ALCOHOL DETECTION SYSTEM
8. APPLICATIONS
1) In Companies for high performance by Workers.
If the worker found drunk he is not allowed
to work.
2) In Car for Automatic Engine Ignition Off.
Here if the person detected certain alcohol the car will not start.
GM, Toyota and a few others are working under the Driver Alcohol Detection System for Safety, which is a $10 million federal program for mass production of this unit.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 61
ALCOHOL DETECTION SYSTEM
CHAPTER 9FUTURE DEMAND
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 62
ALCOHOL DETECTION SYSTEM
9. FUTURE DEMANDS
o In the future, alcohol interlocks may be a standard feature on all vehicles.
o In order to achieve general acceptance, this technology must be unobtrusive,
fast, accurate, reliable, and repeatable.
o It must also be functional across a wide range of driving and environmental
conditions, require little or no maintenance, and are tamper and circumvention
resistant.
CONSUMER BUY-IN IS CRITICAL
Technology will be effective only if the driving public welcomes and
accepts it:
58 percent of U.S. public supports smart technology to prevent alcohol-
impaired driving
56 percent of Canadian public agree that all new vehicles be equipped with
driver alcohol detection device that prevents starting if the driver is over a
preset limit
37 percent of U.K. public supports requiring all new drivers to use
equipment that tests them for alcohol before starting their car
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 63
ALCOHOL DETECTION SYSTEM
CHAPTER 10CONCLUSION
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 64
ALCOHOL DETECTION SYSTEM
10. CONCLUSION
The device performed well for a prototype. The whole system worked
functional very well; it was able to read in values, display the correct/expected BAC
value, and send the operation signal when programmed to do so. There were some
errors which showed up in the prototype. The semiconductor sensor needed to be
operated in the linear region to get reliable results, however the BAC values that
would occur in the normal operation of the device would sometimes be well below
this range.
An alcohol interlock requires a driver to perform a breath test to start a
vehicle, and provide repeated breath samples while the vehicle is in use.
Advances in alcohol interlock technology have overcome many of the
limitations associated with earlier devices.
Technical standards and certification requirements govern the use of delivery
of these devices across jurisdictions.
Devices can withstand many environmental influences and have a variety of
programmable features.
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 65
ALCOHOL DETECTION SYSTEM
COMPANIES
The companies which are developing this system:-
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 66
ALCOHOL DETECTION SYSTEM
CHAPTER 11REFERENCES
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 67
ALCOHOL DETECTION SYSTEM
11. REFERANCES
1. http://www.thinkgeek.com/gadgets/electronic/837f/
2. www.futurelec.com
3. www.nationalelectronics.com
4. www.howstuffworks.com
5. www.electronics4u.com
6. www.dadss.com
7. http://www.hwsensor.com
8. http://www.usatoday.com
Dr. J. J. Magdum College Of Engineering, Jaysingpur.Page 68
top related