Professional Documents
Culture Documents
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.
Page 1
INDEX
Sr. No. 1 2 3 4 5 Particulars Introduction Literature survey Block Diagram Circuit Diagram 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
Page No. 5 14 18 21 23
25 31 33 40 43 46 47 50
Software Development
6.1 Flow Chart of Main Program 6.2 Flow chart of LCD interface 6.3 Flow chart of Keypad Interface
53
54 55 56
7 8 9 10 11
57 59 61 63 66
Page 2
LIST OF FIGURES:
Figure No
Fig 3.1 Fig 4.1 Fig 5.1.1 Fig 5.1.2.1 Fig 5.2.1 Fig 5.3.3.1 Fig 5.3.5.1 Fig 5.3.6.1 Fig 5.4.1 Fig 5.4.2.1 Fig 5.5.3.1 Fig 5.6.1 Fig 5.7.1.1 Fig 5.8.1 Fig 6.1 Fig 6.2 Fig 6.3
Name
Block Diagram Circuit Diagram Alcohol Sensor Sensor Circuit Connection ADC Pin Diagram C Pin-Out Reset Circuit Crystal Circuit LCD Schematic Of LCD EEPROM Pin-out Keypad Interfacing MAX 232 Interfacing Thermal Printer Flow Chart Of Main Program Flow Chart Of LCD interfacing Flow Chart Of Keypad Interfacing
Page No
19 22 25 27 32 34 39 39 40 41 44 46 47 50 54 55 56
Page 3
LIST OF TABLES:
Table No
Table 1.1 Table 1.2 Table 3.1.1 Table 3.1.2 Table 3.1.3 Table 3.1.4 Table 5.2.2 Table 5.5.3.1
Name
Blood Alcohol Percentage for female Blood Alcohol Percentage for male
Page No
7 8
Standard work condition Environment Condition Sensitivity characteristic Structure and configuration, basic measuring circuit Pin Description of ADC Pin Description of EEPROM
25 25 26 27 31 44
Page 4
CHAPTER1 INTRODUCTION
Page 5
1. INTRODUCTION
Alcohol 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 drivers 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 users 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
Page 6
will be fined and no car can be driven until the sample is once again under safe limits.
Table No 1.1
Page 7
Table No 1.2
Page 8
Page 9
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.
Page 10
Page 11
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.
Page 12
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.
Page 13
Page 14
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 suspects 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.
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 persons 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 persons blood passes through his or her lungs, some of the ingested alcohol travels across the membranes of the lungs air sacs and moves into the air. This process is one of alcohols 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
Page 16
drunks blood to test his alcohol level, the officer is able to perform a quick test on that drivers 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 persons BAC measures 0.08, it means that he or she has 0.08 grams of alcohol per 100 ml of blood.
Page 17
Page 18
3. BLOCK DIAGRAM
Keypad Interface
Thermal Printer
RS 232 Cable
PC Interface
Page 19
WorkingThe 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.
Page 20
Page 21
ALC
4. CIRCUIT DIAGRAM
Dr. J. J. M
C ll
Of Engineering, Jaysingpur.
L DETECTION SYSTEM
Page 22
CHAPTER 5 COMPONENTS
Page 23
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
Page 24
Page 25
0.6
Over 24 hour
Page 26
Sr.No. 1 2 3 4 5 6
Parts Gas sensing Layer Electrode Electrode line Heater coil Tubular ceramic Anti explosion net ork Clamp ring Copper plating Resin base
Materials SnO2 Au Pt Ni Cr alloy Al2O3 Stainless steel gauze (SUS316 100-mesh) Ni Bakelite
7 8
Fig 5.1.2.1
Page 27
Page 28
Solenoid valves may use metal seals or rubber seals, and may also have electrical interfaces to allow for 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:
Fig 5.1.5.2
Page 29
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.
Page 30
7 8 9 10 11 12 13 14
EOC - End Of Conversion 2(-5) - Tri-State Output Bit 5 OUT EN - Output Enable CLK - Clock Vcc - Positive Supply Vref+ - Positive Voltage Reference Input GND - Ground 2(-7) - Tri-State Output Bit 7
21 22 23 24 25 26 27 28
2(-1) - Tri-State Output Bit 1 ALE - Address Latch Enable ADD C - Address Input C ADD B - Address Input B ADD A - Address Input A IN0 - Analog Input 0 IN1 - Analog Input 1 IN2 - Analog Input 2
Fig 5.2.1
Key Features
Resolution Total Unadjusted Error Single Supply Low Power Conversion Time 8 Bits LSB and 1 LSB
5 VDC 15 Mw 100 s
Page 32
Microcontrollers sometimes are called single-chip computers because they have onchip memory and I/O circuitry and other circuitries that enable them to function as small standalone computers without other supporting circuitry.
y
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 UseAssembly 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.
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
Page 34
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 16-bit addresses (MOVX [at] DPTR). In this application, Port 2 uses strong internal pullups 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
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 35
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 each access to external data memory.
10. EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device
Page 36
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.
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, 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.
Page 37
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).
Page 38
Requires 2 machine cycles to reset controller Uses RC combination to give the delay of 2 machine cycle to reset controller.
Page 39
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 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
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 40
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
Fig 5.4.2.1
Page 41
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 decoupling 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 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.
Page 42
Page 43
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 devices 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.
Page 44
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 GND.
Page 45
Page 46
Page 47
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, MAX205MAX208, 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 pulldown 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 MAX205EMAX208E, 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.
Page 48
The MAX202E, MAX203E, and MAX232E do not have pull up resistors on the transmitter inputs.
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 MAX213Es R4 and R5 receivers have no hysteresis. RS232 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.
Page 49
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 thermosensitive paper
Page 50
In order to print, thermo-sensitive paper is inserted between the 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 thermochromism. when the matrix solidifies back quickly enough. See
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
Dr. J. J. Magdum College Of Engineering, Jaysingpur. Page 51
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 pagethis can be tested for beforehand on an unimportant thermal print. An option is to make and laminate a permanent ink duplicate of the image.
Page 52
Page 53
6. SOFTWARE DEVELOPMENT
6.1 FLOW CHART OF MAIN PROGRAM:
START
No
Check for the level of alcohol detected. Store the data in EEPROM memory. Print the report and Fine charged through Thermal Printer.
STOP
Page 54
START
SEND COMMAND
SELECT REGISTER
ENABLE LCD
CALL DELAY
SEND DATA
CALL DELAY
STOP
Page 55
START
DISPLAY CHARACTER
REPEAT PROCESS
Page 56
CHAPTER 7 ADVANTAGES
Page 57
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.
Page 58
CHAPTER 8 APPLICATIONS
Page 59
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.
Page 60
Page 61
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.
Page 62
CHAPTER 10 CONCLUSION
Page 63
10.
CONCLUSION
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.
y 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.
y Advances in alcohol interlock technology have overcome many of the
programmable features.
Page 64
Page 65
CHAPTER 11 REFERENCES
Page 66
11.
REFERANCES
Page 67