Project 38 Report - Breathalyzer Enabled Ignition Switch | ECE 445, Study Guides, Projects, Research of Electrical and Electronics Engineering

Material Type: Project; Class: Senior Design Project Lab; Subject: Electrical and Computer Engr; University: University of Illinois - Urbana-Champaign; Term: Spring 2004;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 03/16/2009

koofers-user-vxt
koofers-user-vxt 🇺🇸

3

(2)

10 documents

1 / 23

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Breathalyzer Enabled Ignition Switch
By
Todd Borrowman
Robert Wilson
ECE 345, SENIOR DESIGN PROJECT
Spring 2004
TA: Jeff Bruggemann
5/4/04
Project No. 38
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download Project 38 Report - Breathalyzer Enabled Ignition Switch | ECE 445 and more Study Guides, Projects, Research Electrical and Electronics Engineering in PDF only on Docsity!

Breathalyzer Enabled Ignition Switch By Todd Borrowman Robert Wilson ECE 345, SENIOR DESIGN PROJECT Spring 2004 TA: Jeff Bruggemann 5/4/ Project No. 38

ABSTRACT

The breathalyzer enabled ignition switch is a device which only allows the operation of an automobile if a breathalyzer test is passed. The device is wireless with a handheld breathalyzer which transmits the operate signal to a unit within the car. The handheld unit consists of an alcohol sensor, a microcontroller to calculate the BAC and control the output, a display, and a transmitter. The internal car portion of the device consists of a receiver and a relay integrated into the ignition circuit of the automobile. The device was tested using a varied range of prepared alcohol mixtures and satisfactory results were observed along with proper operation of the program, transmitter receiver pair, and the operation ignition switch. ii

1. INTRODUCTION

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 [1]. 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 a wireless breathalyzer controlling the ignition switch’s 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 handheld device will take in a sample of the user’s breath 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 decide if the car’s ignition switch is able to close. If the user is legally sober, a digital high will be sent from the transmitter in the handheld device to the receiver in the car which will allow a relay to close and thereby allow operation of the vehicle. If the user is legally drunk and unsuitable to drive, no signal will be sent, the relay will remain open, and no car can be driven until the sample is once again under safe limits. 1.3 Subprojects The breathalyzer device is divided into two sections of circuitry and operation: the handheld breathalyzer itself and the automobile’s internal circuit. The former is further broken down into two modules: the alcohol sensor and the microcontroller with display. The latter simply consists of the wireless link between transmitter and receiver and the relay circuitry within the car. These components can all be seen in the block diagram in Figure 1. Each component, or subproject, could be worked on and tested independently with little or no work needed in order to integrate all components once they were individually designed, built, and verified operational.

2. DESIGN PROCEDURE

Great care was given to all three major areas of this project in order to ensure proper, accurate, and easy operation of the entire breathalyzer device. 2.1 TGS2620 Ethanol Sensor There are currently three types of alcohol sensors on the market: metal-oxide semiconductors, fuel cells, and infrared spectroscopy. Fuel cells are the most reliable and are the ones used by law enforcement officials today, but they are very expensive. Infrared spectroscopy is another accurate and reliable technology available; unfortunately, it is hardly portable and requires a very high voltage to operate. The semiconductor technology is the least reliable among the three; however, it is by far the cheapest, least bulky, and consumes the least amount of power. Therefore, a semiconductor alcohol sensor was used for the purposes of this design. The sensor used in order to detect the ethanol gas concentrations of the breath is the TGS Volatile Organic Compound (VOC) Semiconductor Sensor. The sensing material is a thick film of tin oxide, or SnO 2. When this metal oxide is heated at a certain high temperature in air, oxygen is adsorbed on the crystal surface with a negative charge [2]. Then donor electrons in the crystal surface are transferred to the adsorbed oxygen, resulting in leaving positive charges in a space charge layer. Thus, surface potential is formed to serve as a potential barrier against electron flow. A visual depiction of this description can be seen in Figure 2 and the chemical reaction equations can be viewed below [3]. O 2 (gas)  O 2 (absorbed) (1) O 2 (absorbed) + e–^  O 2 –^ (2) O 2 –^ + e–^  2O–^ (3) Inside the sensor, electric current flows through the conjunction parts (grain boundary) of the SnO 2 micro crystals. At the grain boundaries, adsorbed oxygen forms a potential barrier which prevents carriers from moving freely. The electrical resistance of the sensor is attributed to this potential barrier. In the presence of a deoxidizing gas, such as ethanol, the surface density of the negatively charged oxygen decreases, so the barrier height in the grain boundary is reduced (shown in Figure 3). Hence, the reduced barrier height decreases sensor resistance. The chemical equations (4-7) of the ionized oxygen created by equations 1-3 and the ethanol to be detected are derived below. C 2 H 5 OH (gas) + O–^  CH 3 CHO + H 2 O + e–^ (4) C 2 H 5 OH (gas)  H + C 2 H 5 O (surface) (5) C 2 H 5 O  H + CH 3 CHO (6) CH 3 CHO + O (bulk) → CH 3 COOH + O (vacancies) (7) Now that the most fundamental concepts of the sensor are better understood, it is also important to consider the many variables that may (and, in fact, do) affect our results and calibrations. Due to the fact that the sensor used in this project is a semiconductor, it is highly affected by temperature and humidity. Since the extensive testing of these two variables was beyond the scope of this project, it was assumed that the temperature and humidity in the lab room was nearly constant during any calibration processes. This relationship between both variables and their effects on the sensor’s resistance relative to a predetermined and constant resistance, RO, are shown in Figure 4. The sensor is also highly time dependent. While the resistance of the sensor reaches a fairly consistent steady-state value when exposed to ethanol gas concentrations, it still takes about a minute, on average, for that value to be attained (as seen in Figure 5). This was taken care of by careful programming of the BasicX microcontroller. Still, it is necessary to take note of this time-delayed response so as to obtain the most accurate reading and therefore an accurate BAC read-out.

3. DESIGN DETAILS

The ethanol sensor selected was the TGS2620 Ethanol Sensor because of its low cost and low power consumption. For the microcontroller, the BasicX microcontroller was chosen for its built-in A/D converter and ample I/O pins. This controller is programmed in a language derived from Visual Basic so it is easy to program and use. For the display, a 5x7 LED array was desired for its ability to easily display both numbers and letters discernibly. The wireless link was accomplished using the Linx modules. This transmitter and receiver pair is prefabricated and easy to integrate into the project. 3.1 TGS2620 Ethanol Sensor The ethanol sensor being used has four pins that allow voltage supply to the heater resistor, RH, and the variable sensor resistor, RS. The supply voltage must remain within 4% of 5V for the proper operation of this device. The load resistor, RL, was recommended to be 4kΩ so that the power consumption of the sensor resistor did not surpass its maximum power rating of 15mW. An output to gage the sensor’s response to various concentrations of ethanol was taken to be the voltage drop across that load resistor, called VRL. All of this can be easily seen in Figure 8. After assembling the simple sensor circuit, it was then necessary to devise a way of creating test gas concentrations to mimic various BAC’s. The Blood Alcohol Concentration is defined to be the percentage of alcohol, in grams, in 100mL of blood. Therefore, a .08% BAC is 80mg of alcohol within 100mL of blood. Since the sensor detects the presence of alcohol in air, not blood, a relatively constant ratio of 2100:1 was implemented to create these mock-solutions. This ratio comes from a scientifically agreed upon notion that the Breath Alcohol Concentration is defined as the amount of alcohol, in grams, in 210L of air. Furthermore, ethanol has a specific gravity of .79. This means that 1mL of ethanol weighs about .79g (contrasting it to water, where 1g = 1mL). Calculations to find the amount of ethanol needed in each solution was done for the following concentration levels: .02, .04, .06, .08, .10, .12, and .20. These values can be seen in Table 1. With these quantities now derived, it was then easy to create these concentrations by putting the amount of ethanol needed via a micropipette into a 1L flask. These flasks were then labeled and sealed in order to allow them to reach equilibrium. This typically took about an hour since the amount of ethanol was so low. Once they were created and ready, extensive calibration testing was then performed. 3.2 BasicX Microcontroller and Display The program initializes the values of the state limits and sets the state to the default, Alabama. As seen in Figure 9 a loop is entered which waits for a button to be pressed (See the attached file for program code). If the on button is pressed the microcontroller begins to read the values from the sensor circuit from the A/D. The controller will continue to read the input until the values begin decreasing. The controller continues to read the values for an additional 10 seconds and the maximal value is recorded. The microcontroller calculates the BAC from the voltage with the calibration equation obtained. Then the program displays the BAC for 10 seconds. After the BAC is displayed it is compared with the limit of the state selected and if less than that limit a digital 1 is output to the transmitter, thus enabling the car’s ignition. The other button that can be pressed to exit the initial loop is the state select button. When first pressed, the currently selected state is displayed. When pressed repeatedly while the state is being displayed the microcontroller cycles through the state’s abbreviations, displaying them after each press. The last state displayed when the display goes blank is the new selected state and the process can be repeated. The 5X7 LED array is powered by placing a positive bias across the column and row to light up the associated LED in the array. The problem with this is every column and row is tied together therefore every bias will light up an LED. To work around this the microcontroller displays one row at a

time and switches between them fast enough for the desired image to be shown. Current limiting 220 Ohm resistors were put in series with each row so the LEDs would not absorb too much power and burn out [5]. An octal bus integrated chip was chosen to drive the LEDs. Two SN74L5645N chips were used; one to sink the current and one to source it. This separated the display from the microcontroller so the current load did not need to be supplied by the BasicX. The complete wiring for the microcontroller and display can be seen in figure 10. 3.3 Transmitter/Receiver and Ignition Circuitry The Linx transmitter and receiver were wired as per the manufacturer’s datasheets [4]. Channel 0 was selected as the transmitting channel for ease of wiring. No antenna was needed for our link because of the close range considered. For longer ranges an antenna would be needed to complete the link. The receiver will be operated with 12 volts Vcc off of the car battery. The transmitter will use the 5 volts Vcc from the handheld unit needed for the microcontroller. In our prototype a LED was used in replace of the automotive relay. The complete wiring of the in-car circuit can be seen in figure 11.

5. COST

5.1 Parts

220 Ω resistors $ 0.01 6 $ 0.

    1. INTRODUCTION....................................................................................................................
    • 1.1 Purpose/Motivation.............................................................................................................
    • 1.2 Specifications......................................................................................................................
    • 1.3 Subprojects.........................................................................................................................
    1. DESIGN PROCEDURE...........................................................................................................
    • 2.1 TGS2620 Ethanol Sensor...................................................................................................
    • 2.2 BasicX Microcontroller and Display..................................................................................
    • 2.3 Transmitter/Receiver and Ignition Circuitry……………………………………………..
    1. DESIGN DETAILS..................................................................................................................
    • 3.1 TGS2620 Ethanol Sensor...................................................................................................
    • 3.2 BasicX Microcontroller and Display..................................................................................
    • 3.3 Transmitter/Receiver and Ignition Circuitry……………………………………………..
    1. TESTING/VERIFICATION.....................................................................................................
    • 4.1 Testing................................................................................................................................
    1. COST........................................................................................................................................
    • 5.1 Parts....................................................................................................................................
    • 5.2 Labor...................................................................................................................................
    1. CONCLUSIONS......................................................................................................................
    • APPENDIX – FIGURES..........................................................................................................
    • APPENDIX – TABLES.........................................................................................................
    • REFERENCES.......................................................................................................................
    • 4 kΩ resistorΩ resistor $ 0.01 1 $ 0. Component Name Part Number Cost Per Unit Units Used Total
    • 220 Ω resistors $ 0.01 6 $ 0.
    • 2.2 kΩ resistorΩ resistors $ 0.01 2 $ 0.
    • Linx Transmitter TXM - 900 - HP - II $ 10.00 1 $ 10.
    • Linx Receiver RXM - 900 - HP - II $ 10.00 1 $ 10.
    • BasicX Microcontroller $ 99.95 1 $ 99.
    • 5X7 LED Array LTP747R $ 0.20 1 $ 0.
    • Octal Bus SN74L5645N $ 0.13 2 $ 0.
    • Ethanol Sensor TGS2620 $ 65.00 1 $ 65.
    • Push Button $ 2.00 2 $ 4. - Total $189.
  • 2 people X 80 hours X $50 / hour X 2.5= $20, 5.2 Labor - Total Cost = $20,000 + $189.50 = $20,189.

6. CONCLUSIONS

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. A fuel cell sensor would give more accurate readings and improve the performance of the circuit. A fuel cell sensor is not as dependant on temperature and ambient environment. Also this sensor has a linear response over a larger region. To improve the semiconductor sensor’s readings a Wheatstone bridge could be used instead of a load resistor. This would separate the small voltage variations of the sensor over a larger range of voltages, making the results more precise. The algorithm to find the actual value of the sensor reading could be improved. The time delay on the sensor is not totally overcome by the current scheme. The display should be expanded to give clearer results. Some of the letters, such as “M” and “N”, are too similar to be easily distinguished on the 5x7 display. Also using three digits in the BAC would improve accuracy and eliminate most of the rounding errors which occurred during the calculations performed by the microcontroller. These small improvements would increase the device’s performance and give more accurate results over a larger range of inputs. Furthermore, a more trusted and reliable system, such as these improvements imply, would yield a larger market of consumers. The entire goal of utilizing this device is so that responsible people who enjoy alcoholic drinks have an easy and trustworthy way of eliminating any danger to themselves and others by operating a vehicle.

FIGURE 2

Model of Inter-Grain Potential Barrier (in the absence of gases) FIGURE 3 Model of Inter-Grain Potential Barrier (in the presence of gases)

FIGURE 4

Temperature and Humidity Dependency (RS/RO) FIGURE 5 Time-Delayed Sensor Response to Ethanol

FIGURE 8

Circuit Diagram of Ethanol Sensor for Calibration FIGURE 9 Flow Chart for BasicX Microcontroller Program

FIGURE 10

Handheld Unit Circuit Diagram 5 6 7 8 20 19 18 17 5V 9 10 11 12 16 15 14 13 1 2 3 4 24 23 22 21 1 20 2 19 3 18 4 17 5 16 6 15 7 14 8 13 9 12 10 11 1 12 2 11 3 10 4 9 5 8 (^1 206 ) 2 19 3 18 4 17 5 16 6 15 7 14 8 13 9 12 10 11 Data In Gnd Vcc Power Dn CH SL 2 CH SL 1 CH SL 0 CTS Antenna Gnd SN74LS SN74LS LED 5X7 Array LTP747R Basic X 24 TXM-900-HP-II On State Selector 3 kΩ resistorOhm 220 Ohm 1 kΩ resistorOhm 1 kΩ resistorOhm 2.2 kΩ resistorOhm

FIGURE 12

Calibration Line for Ethanol Sensor

Figure 13 Calibration Data for the BasicX A/D