The most common and widely used sobriety
Transcription
The most common and widely used sobriety
Final Report April 29, 2004 Executive Summary Driving under the influence (DUI) of alcohol was responsible for 41% of all fatalities in motor vehicle crashes in 2001 [1]. Although over the past 15 years the number of deaths because of DUI are reducing, it is still a major hazard on roads today. Breathalyzers are used by the police to measure the Blood Alcohol Content (BAC) to check for sobriety in drivers. However, BAC does not assure sobriety rather it is just an indication of the alcohol present in the blood which could be present as a by product of certain medicines or medical conditions. For instance, diabetics produce alcohol and ketones as by-products when breaking down simple sugars and so will have a small amount of alcohol present in their blood anyway. We present a diagnostic device that uses Horizontal Gaze Nystagmus (HGN) to test the sobriety of an individual rather than determine the BAC. This way not only can the test be used to check for the influence of other non-alcoholic narcotics but can also be an indicator of how much a person is intoxicated. It can be used in conjunction with the breathalyzer test to develop a more accurate assessment of intoxication or sobriety in subjects. This sobriety tester uses a linear photodiode array to track the movement of the eyeballs and then uses this data to verify if the individual is intoxicated. The following steps provide a brief synopsis of the working of our design: § The subject is asked to visually track a horizontally moving stimulus while looking into a lens setup connected to a linear array of 128 photodiodes. § These diodes capture the movement of the eyeball and send out a continuous analog signal. § Transistor-to-Transistor Logic (TTL) and analog circuitry is used to simplify and digitize the analog signal. § This digital signal is then transferred to the computer where a Digital Signal Processing program is used to calculate the position of the eyeball. In the following report we present the final design, design tradeoffs and alternatives and technical details with an in-depth analysis of the marketing and the economic viability of this device. We finish the report with a section devoted to assist the next group in carrying this project forward since some work is still needed before our product is ready for the market. 2 Table of Contents Introduction………………………………….…………………………………………….4 Design Alternative and Tradeoffs…………………………………………………………5 Marketing & Cost Analysis…………….…………………………………………………6 Project Technical Details………….………………………………………………………9 Tasks & Schedule…………………….………………………………………………….13 Product Demonstration..……….………………………………………………………...17 Conclusions…………………….………………………………………………………...17 Continuation……………………………………………………………………………...18 Bibliography……………………………………………………………………………..20 Appendix A: MATLAB Code for DSP and Visual C++ code for Parallel Port Communication ………………………………….………………………21 Appendix B: Schematic of Circuit and Pictures of Final Design ……………………….24 3 Introduction According to the Center for Disease and Control (CDC), 33% of the American population will be involved in an alcohol related fatality. During 2002, 41% of all trafficrelated deaths in the United States died in alcohol-related motor vehicle crashes at a cost of over $50 billion [2]. The largest groups at risk are male drivers between the ages of 15 through 24. Most of these drivers had a blood alcohol concentration (BAC) well above the 0.08% legal state limit. Some methods enforced by law officials to prevent “drinking and driving” (DUI) include license suspension and stricter penalties, and zero tolerance laws for drivers under the age of 21. The risks of “driving under the influence” of alcohol is shown in Figure 1. Figure 1. Risks of accident in relation to the BAC [2]. To combat the serious consequences of driving under the influence, the National Highway Traffic Safety Administration ("NHTSA") has developed a battery of field sobriety tests, which are designed to detect the impaired driver [3]. One of the sobriety tests used by officials in some states is the Horizontal Gaze Nystagmus (HGN) or “eye test.” The test requires the subject to track a horizontally moving object. When the subject reaches the horizontal extremes, if they are under the influence of alcohol the eyes would cause a fluttering or oscillatory motion called nystagmus. However, this is sometimes a naturally occurring phenomenon in some individuals. One of the major flaws with this test is it relies on the interpretation of the law enforcer and is therefore very arbitrary. The disadvantages of the HGN test will be alleviated by creating a more accepted quantitative method for law officials. The model will involve a horizontal moving target on a computer screen and a linear optical array that will track and record the eye movements. The model is separated into three separate components: an optical component, an electrical component, and a software component. Each of these after being 4 tested separately, will be implemented to test for the nystagmus effect. The data collected from this analysis will be beneficial for law officials to accurately diagnose if a person is or is not under the influence of alcohol. However, due to time constraints, there was only a certain extent of accuracy that was obtained after completing the project due to small errors in the circuit components, the manual parallel port input and the setup of the optical device. Design Alternatives and Tradeoffs This project is a continuation from a previous semester when a group tried to detect the Nystagmus effect by using an Electro-Oculogram (EOG) to detect the position of the eyeball. Although they were successfully able to detect eye movement, their design was too slow to be able to detect the high frequency movement associated with the Nystagmus effect. Thus, our first step was to seek an alternative to the design that was currently being pursued. We decided to use an optical approach to the problem and detect the presence of the dark pupil against the white background of the eyeball to determine the eye position. The device we decided to use to detect the pupil was a linear array of photodiodes. The photodiodes would have an output voltage depending on the amount of light incident on it. The output voltages could then be treated in two possible ways: 1. Pass the entire analog signal into a computer using a special card that allows analog data to be sampled, ported and stored in the computer. The data could then be analyzed and processed to get the desired information. This would require a lot of Digital Signal Processing and software development. 2. In this approach the signal would first be processed and cleaned using electrical components and logic. By cleaning up most of the signal only the information pertinent to the problem would be kept and would then be sampled into the computer. This would require extensive analog circuit design and various logic considerations. We settled on the second choice because analog circuitry and Transistor-toTransistor Logic (TTL) is our group’s forte. Moreover, as Electrical Engineers we felt more inclined to do more work with circuitry rather than focus only on high level programming. Yet another possible optical approach to this problem would involve using a high speed camera or even a video camera to capture some footage of the eye. The frames could then be evaluated to obtain eye movement. This would probably be the most accurate method but at the same time it will be the most expensive. Such a setup would have required too much time and money to be a viable option. Finally, we settled on an optical approach to capture Nystagmus effect. Our implementation would clean most of the signal using TTL and analog circuitry. By using counters and TTL output levels we effectively digitized the signal to make signal processing much easier and almost intuitive. After considering the various alternatives and tradeoffs we settled not only for an economically viable solution but also for one that was most appealing to our interests. 5 Marketing & Cost Analysis The most common and widely used sobriety tester today is the breathalyzer. They are used by the police as well as relied on by people for personal testing. Most consumer models have typical accuracy levels of ±0.01% at 0.10% BAC. Most models provide an exact blood alcohol level (BAC) reading to one hundredth of one percent. For most models, users simply blow through the mouthpiece for 2-4 seconds. The sensors measure the alcohol level of air in the deep lungs. Testing is most accurate if subjects have not consumed food or alcohol 15 minutes prior to testing. Different factors like a person's weight, muscle mass, and recently consumed food or beverages all affect a person's blood alcohol content (BAC). Just because a person may act or seem sober does not mean that they are. Breathalyzers vary in cost with disposable testers such as “BreathScan” costing $1.95 each to a Phoenix fuel cell sensor breathalyzer that costs as much as $1,945. Please refer to Table 1 for a price-performance comparison of common consumer and professional breathalyzers. Table 1. Price-Performance Comparison of Consumer and Professional Breathalyzers [4] Breathalyzer AL-2500 Alcoscan AlcAlert AlcoMate AlcoMate Pro Lifeloc FC-10 Lifeloc FC-10 Plus Lifeloc FC-20 CA-5000 Phoenix Sensor Semiconductor type Semiconductor gas Semi-conductive oxide Semiconductoroxide Patent pending fuel cell Patent pending fuel cell Fuel cell Oxidesemiconductor Fuel cell Used By Personal Price $59.95 Personal Personal, law enforcement organizations for initial screening Hospitals, schools, law enforcement $59.99 $129.95 Law enforcement, corrections, probations, clinics, schools, businesses. DOT/ NHTSA approved. Check-points, schools, work-release screening DOT/NHTSA approved Bars, restaurants, clubs (coinoperated) Managers of workplace alcohol testing programs. DOT approved. $539 $139.95 $695 $780 $1,395 $1,945 6 Our product is superior to the Breathalyzer test since it indicates the level of intoxication and not on the BAC, and at the same time we will be able to price it competitively. The following is the breakdown of the cost of design and development of our prototype: Table 2. Cost Assessment for Development of the Prototype [5, 6] Item PROTOBOARD ® Bread Board Toshiba Satellite ® Laptop Computer (Windows OS) Texas Instruments ® Hex Inverter Fairchild Semiconductor ® Comparator 8-Dip Texas Instruments ® Latch 16-Dip Texas Instruments ® 8-bit Binary Counter RadioShack ® T 1-3/4 Red Diffused LED Lamps Linear Array Fresnel Lens Optical setup (PVC) Cold mirror Break out box (for parallel port cable) TOTAL COST Model Number PB-103 A10-S1291 Unit Quantity 1 1 Unit Cost $35 $900 SN74LS04N LM311N 1 1 $0.40 $0.48 SN74LS75N 74HC590AN 276-026 2 1 8 $0.92*2 $0.88 $1*8 MLX90255 NT32-684 NT43-960 - 1 1 1 1 1 $120 $52 $20 $27 $33.25 - - $1,172.73 The cost of development of our prototype, as seen from Table 2, is very reasonable as compared to the other professional breathalyzers (see Table 1) that are thriving well in market now. The fact that we have used very superior equipment to build our prototype will make our product very accurate while not increasing maintenance costs significantly. The cost of production will be much lower not only because of the savings per piece when buying a large quantity but also because we will use a much simpler and less sophisticated Analog-To-Digital converter and computer. For the personal handheld device, the Analog-To-Digital converter and computer can be integrated into one device running of an embedded Microcontroller such as PIC18F452 and displaying the result on an LCD display. This will significantly lower the costs as the Analog-To-Digital converter and the computer are the two most expensive components in our prototype. Since our primary potential marketing targets are the police and the highway patrol, the functionality of the final device can easily be integrated with the computers that the police vehicles have onboard. The savings on computer hardware will significantly lower production costs. With above two changes in the prototype, the functionality or accuracy does not get affected whatsoever, yet a much cheaper product is 7 made. The following table shows the cost of building the device for personal and police use, with the computer and Analog-To-Digital converter replaced by a microcontroller and LCD: Table 3. Cost Assessment of Prototype for Personal and Police Use [5, 6, 7] Item Model Number Microchip Technology ® Microcontroller Maxim ® LCD PROTOBOARD ® Bread Board Texas Instruments ® Hex Inverter Fairchild Semiconductor ® Comparator 8-Dip Texas Instruments ® Latch 16-Dip Texas Instruments ® 8-bit Binary Counter RadioShack ® T 1-3/4 Red Diffused LED Lamps Linear Array Fresnel Lens Optical setup (PVC) Cold mirror TOTAL COST PIC18F452-I/PT Unit Quantity 1 Unit Cost $10.7 Cost Per Hundred $651 MAX7231BFIPL PB-103 1 1 $7.88 $35 $525 $3,500 SN74LS04N 1 $0.40 $24 LM311N 1 $0.48 $27 SN74LS75N 2 $0.92*2 $65*2 74HC590AN 1 $0.88 $45.65 276-026 8 $1*8 $100*8 MLX90255 NT32-684 NT43-960 1 1 1 1 $120 $52 $20 $27 $12,000 $5,200 $2,000 $2,700 - - $257.98 $24,948.3 Thus with the above cost of production, we can competitively price our product while offering a better and a cheaper alternative to other professional breathalyzers. The cost of support required for customers to install and use the final product is essentially zero. Since the product will be a fresh launch in the market, advertising and marketing costs will be a bit higher in the first year. Also, some costs will be incurred in getting the product DOT/ NHTSA approved. While contemplating marketing cost to be 15% of the production cost, and maintenance cost and other overheads each to be 5% of the production cost, we are hoping to sell 500 products this year. The following table provides an annual budget analysis for our company to sell, support, maintain and market our product. 8 Table 4. Annual Budget Analysis for Product Prototype development cost Production cost Maintenance cost at 5% Marketing cost at 15% Other overheads at 5% AVERAGE COST PER UNIT Entire Expenditure Expenditure Per Unit $1,172.73 $2.35 $1,24,741.5 $249.48 $6237.08 $12.47 $18,711.23 $37.42 $6237.08 $12.47 $1,57,099.62 $314.19 The above table shows that our overall expenditure per unit will be a meager $314.19 as compared to our cheapest competitor Lifeloc FC-10 priced at $539. Considering the worst case scenario, assuming that we will manage to sell only 350 products in this year, we will recover our entire expenditure incurred on the development of this product, provided the selling price of our product is $450. In order to develop this lucrative product, the total accumulated number of person hours required were approximately 200 hours. Four people, Nisha Javia, Narendhra Seshadri, Brock Wester and Ranit Windlass; each worked for about 3 hours per week for 15 weeks in order to complete this project. About 20 more hours need to be put in to complete the final assimilation of the electrical, optical and computer components of the design. Final testing of the device and data collection will follow thereafter. If the product is finished up as scheduled, then not only will this product offer police and highway patrol a very accurate way of determining the BAC of an individual, but will also be a very lucrative business. Project Technical Details The DUI quantification device consists of several optical and circuit components that convert an analog visual input signal to a digital signal that is processed using computer software. The device is divided into an optical component, a circuit component, and a computer component. The optical component of the DUI device is responsible for taking an image of a moving eye, and converting it from a three dimensional image to a two dimensional image. The optical component consists of several infrared light emitting diodes as light sources, a single bi-convex lens, a cylindrical Fresnel lens, and a cold mirror. Each of the lenses is oriented inside of a long shaft that will block out light interference. Infrared light emitted from the infrared LEDs will deflect off the eye creating an image that is passed through the bi-convex lens. This image is then passed through the Fresnel lens, which effectively sums each of the vertical intensities of light to a single point, converting the full image into a horizontal line of light. This light is then passed through the cold mirror, which will pass light in the infrared spectrum, and reflect all else. A large percentage of the light pollution (which consists mostly of wavelengths outside the 9 infrared spectrum) that can enter the shaft from a source other than the eye will effectively be filtered out by the cold mirror. A diagram of the optical component is displayed below, showing critical dimensions and relative positions of each of the lenses. Figure 2. Lens setup. The circuit component will take the light from the optical setup and convert it into a digital signal that will be passed through a parallel port to a computer. The input device to the circuit is a linear optical sensor array, which is an integrated circuit element that contains an array of light sensitive 200µm by 66µm photodiodes. Each photodiode outputs a voltage that is directly dependent on the proximal intensity of light. Light intensity generates photocurrent in each photodiode, which is integrated to provide an output voltage [8]. The linear array is housed in an evaluation board that has native clock and integration signals that control the reading of the array of photodiodes. On each integration signal, the cycle of consecutive reads from each of the photodiodes begins. On the rising edge of the clock signal, each subsequent photodiode’s voltage is outputted, making the overall output a series of concatenated photodiode voltages delimited by each clock signal. In the figure below is an oscilloscope reading of a typical voltage output of the linear optical array. Figure 3. Screen capture of the output voltage of the linear array. 10 The native clock signal generated by the linear array evaluation board is used to create new non-overlapping clock signals, which will be used to latch the signaling for the rest of the circuit. This is accomplished by leading the native clock signal to a monostable multivibrator, or “one shot,” which triggers off the clock edges, creating new clock signals with duty cycles less than 50%. These will be used in conjunction with the linear array output to read each individual photodiode signal. The analog output voltage signal from the linear array leads into a latchable voltage comparator element which determines if the signal for each photodiode is “light” or “dark,” effectively digitizing the output. The voltage threshold which separates a light or dark signal is dependent on the voltage output range, which varies with the lead voltage supplied to the linear array board. The Output of the comparator circuit chip is latched so that a read and digitization will occur in the middle of each photodiode output voltage. The digitized output of the voltage comparator is run through two latches, which will temporarily store two consecutive photodiode output readings. These two consecutive output readings will go into an exclusive-or circuit to determine if the consecutive signals are different, which would indicate a change across two adjacent photodiodes from “light” to “dark” or vice versa. These changes from light to dark and vice versa will set the exclusive-or circuit high, and are used to latch the memory. A figure showing the behavior of the exclusive-or gate is shown below. Notice how the firing of this gate minimizes data capture. Figure 4. Firing of the Exclusive-OR gate After each of the photodiodes has been read, the values in the stored memory will begin to paint a picture of the different images present in front of the linear array. The memory value recorded is simply the number of the diode in the array in which a change occurred. This number originates from an 8-bit counter circuit that resets its count on the linear array board’s integration signal that begins a new series of photodiode readings. Considering the expected image will be an eye, the difference in a change from light to 11 dark, and dark to light may not be necessary to record. Over an extended number of signals, patterns in light changes can be determined, allowing signal processing of horizontal image movements present in front of the linear optical array. A block diagram of the entire circuit component of the device is displayed below. A circuit diagram with individual elements and pin numbers in included in Appendix A. Figure 5. Block diagram of the entire circuit component of the device. On each integration signal of the linear array evaluation board, a new series of image data will be recorded, and passed to the computer component of the DUI device. This is accomplished by a parallel port cable, utilizing 8 input/output pins, and 1 trigger pin which are tied directly to the outputs of the counter chip and exclusive-or chip respectively. A computer software program written in C++, which makes use of a special driver class to communicate with the parallel port, is used to input data from the circuit and store it in a text file. This text file can then be parsed into MATLAB, where a MATLAB file has been written to analyze the data, and reconstruct the original movement of the eye during the test. This file is able to discern between a blemish and the pupil and thus provides more than a simple graphing utility. The source code for data capturing and signal processing can be found in Appendix B. Clock speeds of the linear array and circuit elements should be adequately fast to detect, with great accuracy, the quickest possible physiological movement of the eye, including nystagmus. This design is a new and unique approach to a project from last year that attempted to measure and quantify nystagmus. The overall goal of measuring fast eye movements remains, but the previous device used Electro-Oculogram (EOG) technology instead of optical analyses. None of the previous theoretical design or any of the components of the previous group have been used in this project. Each aspect of the device and its design has been reworked. 12 Tasks & Schedule The design and development of this DUI testing device was broken down into three distinct phases. Since our design required the integration of several different individual components into one seamless product, we planned ahead to devote adequate time to debugging and overcoming problems created by integrating the different components. The first phase requires us to come up with a theoretical design and evaluate the resources already available to us. Since this project builds on another project done 4 months earlier, we first need to evaluate the earlier design to ascertain if any of its components or design can benefit our idea. The initial planning phase of this project was critical as we needed to chart out a path for the design and fully utilize the work already done on this project. In the second phase, we implemented the design and at the same time revised and updated the design to compensate for unforeseen circumstances and other errors that came up while actually testing our design. The last phase of the project involved testing the individual components thoroughly and integrating them together into one seamless product. Figure 6 is a PERT chart that outlines our intended schedule and breakdown of tasks. Figure 6. PERT chart outlining the major goals. Our final tasks and scheduling were significantly different from our intended path. This was in part due to the unforeseen problems and circumstances. However, in many cases we wrongly estimated the difficulty of a task and assigned very little time to it. Thus, we had to spend a lot of time on tasks we initially thought would be very easy to complete. In spite of these shortcomings, we were able to compensate for this extra time since we were ahead of schedule for most of the semester. Figure 7 shows a PERT chart that outlines our actual schedule of tasks performed. Thus it required constant work and effort as individuals, and good co-ordination as a team to be able to keep working on schedule. Following is a detailed look at each of the three phases, the different tasks that had to be completed and how we divided the work so that not only did we meet the deadlines, but were also able to utilize each of the group member’s expertise. 13 Figure 7. PERT chart showing task scheduling and major goals. Phase I: Brainstorming, Planning and Initial Design Development The first two weeks, January 12th through January 25th, were essentially brainstorming sessions, where the work was driven by each group member’s ideas and suggestions. Finally, it was decided that our implementation of the DUI testing device will be based on Brock Wester’s design for the Linear Diode Array. With this as the starting point, Ranit Windlass and Brock came up with a preliminary circuit design linking the array with the Analog-To-Digital Converter. Narendhra Seshadri and Nisha Javia evaluated the design from the previous semester. In the week of January 26, the two teams compared the results and decided to build an entire new circuit as the old circuit had too many extraneous components. Thus, by the end of phase I, we had decided on an initial design, tested the old circuit and found it unacceptable, which gave us a good start into Phase II. Phase II: Design Implementation and Integration This phase consisted of the most amount of work and most of the semester was used in completing this phase. We had to divide the work since all the three technical components, Electrical, Optical and Computer, needed to be developed simultaneously. Brock and Ranit worked on the electrical component and implemented the circuit design they had presented during Phase I. Meanwhile, Nisha contacted professors in the optics department and performed some basic experiments to determine the lens setup that would project the eye onto the linear array. Narendhra tried to configure the Analog-to-Digital converter used by the previous DUI group for our use. However, the sampling rate was 14 too slow and soon he was searching for a different scheme to perform the task of porting data into the computer. After considering various options we decided to use the PC’s parallel port to capture data from the Electrical circuit. Our change of approach prompted Ranit to develop the code for the parallel port communication. Nisha started working simultaneously on a DSP program in MATLAB to analyze the ported data. Narendhra continued Nisha’s experiments and came up with a simple design to test the Optical component of our design. Brock tested and verified the working of the electric circuit. The electrical design essentially remained unchanged, but in some cases the implementation of a particular device was slightly different, for instance we relied on a more TTL based implementation rather than a more analog based implementation, which is what we had visualized earlier. These few weeks everyone was working on their own but we communicated effectively and continuously via email. The development and verification of software took longer than anticipated but this time was well used in the development of the Electrical and Optical Components. Narendhra laid the circuit out cleanly on a breadboard whereas Brock made a more permanent and sturdy setup for the lenses with PVC encasing. After verifying the working of the DSP and port communication, we were ready to integrate the three components together and begin phase III. Phase III: Integrating, Final Testing and Presentation The final phase involved overcoming all the unanticipated delays, removing any potential bugs or shortcomings in design and compensating for unforeseen circumstances. Although we had been doing well as a team till now by compensating for each other to keep the project on schedule, we were unable to find solutions to the problems in this phase fast enough. The Optical and Electrical components were integrated with only minor hiccups. Without much trouble we were able to tie in the native clock signal from the linear array to the registers and counters. The problem lay in tying in the computer component with the design. Despite our sincere efforts and consistent work, we were unable to come up with a scheme to resolve all the power issues we faced in porting data. However, the solution is not too far and should only require another week or two to solve. In the following Gantt chart, a summary of the task breakdown and scheduling is presented. Most of the work that needs to be done has already been completed and only a small amount of effort and time is needed in completing the prototype of this excellent product. 15 16 Product Demonstration Due to the expected portability of the final system, the optical and circuit components of the device must be able to perform under random and possibly extreme environmental conditions. It will be possible to take a live reading with the device and the collection of data by the circuit element, and the displaying of that data using a graphical user interface will be a possible demonstration. With the graphical display of the optical data, it will be evident that the circuit has been able to determine the major visible components of the eye, and can track its movement. Setup of the device will require a power source of 7V to power the linear array evaluation board, and a power source of 5V to power the integrated circuit. The parallel port cable needs to be connected to a computer with the required software to collect data from the circuit and analyze it. A complete demonstration of the device takes part in two steps. The first step is to acquire binary data in a text file based on the movement of the eye, and the second step is the run the text file through the signal processing algorithm which will graph the movement of the eye. To begin a test, the software to collect data must be loaded and then executed when the examinee is ready to begin testing. The software, which will not require any initial setup, will be timed and will eventually terminate, at which point a text file will be created with the data from the test. This data file will then need to be loaded into the signal processing software where the movement of the eye over time will be graphed. The actual testing of the eye movement, which will be determined at a later date, can vary in length, but will contain enough eye movements to acquire sufficient data to understand physiological behavior. Analysis of the test data will take a matter of seconds, as the data is interpreted by software. Conclusions Though this product was developed after a lot of thought and tremendous effort was put into its development, a few possible changes in the product will make it simpler, more accurate, reliable, useful and lucrative. Since the product consists of three main components, i.e. circuit component, optical component and computer component, we can individually look at each of these and discuss alternatives to make the overall design superior. Optical component: The optical component consists of an arrangement of lenses and mirrors encased in a PVC tube. An infrared image captured by the moving eyeball is incident on this system of lenses and mirrors, which is subsequently passed along into the linear diode array (consisting of 128 photodiodes). This image is interpreted to create an output which is basically an analog voltage. This optical component of our product could be improvised in a way so as to reduce its complexity. People with a good understanding in the field of physics and optics should be able to accomplish this quite easily. Electric component: The electric component consists of a complex integrated circuit consisting of several chips connected on a bread board. The output from the linear array, which is an analog voltage, is analyzed to get significant data. The data so aquired is converted to a digital signal, which is in turn fed to a computer by means of a parallel port cable. This electric component of our product could be improvised in a way so as to directly feed the analog output from the linear array to a computer. This will eliminate the use of the parallel port cable completely and, hence, reduce the amount of signal processing. This means adding more hardware components to the design while increasing costs measly. Computer component: The computer component consists of a combination of Visual C++ and MATLAB programs. The data fed into the computer via a parallel port cable will go through some data communication software code and digital signal processing code in order to be interpreted for reconstruction of the original eyeball movement. This computer component of our product could be improvised in a way so as to include more digital signal processing code to filter out noise and outlier data points from the signal. Some other means of circuit-to-computer communication could be devised and implemented which could allow faster data flow and in turn also increase accuracy. Although, thorough testing of the individual optical, circuit and computer components was carried out, due to time and resource constraints our product was never fully tested after integration of all the three components. Finally, some data collection and testing needs to be done to evaluate the usefulness and accuracy of our product. In order to accomplish this task, a stimulus consisting of a horizontally moving light pattern emitted from an array of LEDs needs to be created. In some more time, the little work that remains to be done can be finished to provide the final product as designed to provide a better and more accurate DUI testing device. Continuation There were several complicated and very different components present in the DUI device which could be improved individually to make the device perform better. The first component of the device consisted of an optical setup that took an infrared image of the moving eye, and passed it through several lenses and into a linear optical array, which created an analog voltage output of the interpreted image. The optical setup of this device could be improved or reworked by a team more adept in optics, reducing the overall cost of complexity of this component. The second component of the device was a integrated circuit that took the analog output of the linear array, analyzed the signal, decoded it, and converted significant data it into a digital signal that could be feed to a computer for high speed logging. While this component considerably reduces the required signal processing by the computer, it is possible, given the right funding and hardware, that this component could altogether be removed from the device by feeding the analog output of the linear array directly to a computer. 18 The third component consisted of several software programs on a computer that collected data through a parallel port attached to the integrated circuit and interpreted the data to reconstruct the original movement of the eye. While this component of the project works correctly, additional signal processing could be used to compensate for unexpected input or noise from the signal. There are also several other methods possible for communication between an integrated circuit and a computer which could be developed to allow for increased or more efficient data flow, and in turn, increased accuracy for the tests conducted by the device. Each component required significant amounts of time, and while their effectiveness and performance could be tested individually, their eventual combination, and the performance of the entire device, was never fully tested. Some valid data was collected, which could say that the prototype or at least the individual components are performing as designed. However, the tests for eye movement and their execution and analysis, which will dictate the eventual usefulness of the device in determining the level of intoxication of an individual, have not been created. A stimulus for the test, consisting of a simple moving light pattern emitted from an array of regular LEDs will need to be created, and then correlated with the movement of the patient’s eye. Digital signal processing can then be used to quantify reaction speeds, and other physiological responses. It is believed that alternative methods of collecting optical data and passing it through a circuit to a computer for logging could be achieved. Given another semester, this device could be re-tweaked to provide for a more professional prototype. However, considering the time requirements for the PhD student needing the device, with a little more time, this device will perform as designed. 19 Bibliography [1] Bureau of Transport Statistics,”Occupant and Nonmotorist Fatalities in Crashes by Number of Vehicles and Alcohol Involvement (AI)” [Online Document] http://www.bts.gov/publications/national_transportation_statistics/2003/html/table _02_20.html [2] CDC, “Impaired Driving,” [Online Document] http://www.cdc.gov/ncipc/factsheets/drving.htm [3] Forensic Evidence, “Horizontal Gaze Nystagmus,” [Online Document] http://www.forensic-evidence.com/site/Biol_Evid/HGN.html [4] Breathalyzer.net, “Consumer and Professional Breathalyzers,” [Online Document] http://www.breathalyzer.net [5] Digi-Key Corporation, “Parts Search,” [Online Document] http://www.digikey.com/ [6] SGS-Thomson Microelectronics, “TTL Data Sheets,” [Online Document] http://www.ulrich-roehr.de/elektronik/pulslimiter/hc123.pdf [7] Maxim Semiconductors, “Parts Number Search (Price and availability),” [Online document] http://www.maxim-ic.com/index.cfm [8] Melexis Microelectronic Integrated Systems, “Linear Optical Array” [Online Document] http://www.melexis.com/prodfiles/mlx90255ba.pdf 20 Appendix A: MATLAB Code for DSP and Visual C++ code for Parallel Port Communication 21 %% ECE 4006 DUI Tester Group %% DSP Code to parse and manipulate the data %% Parses code and then finds midpts from the matrix load data.txt %% data from the linear array positions = 64; %% array of the final eye positions i = 1; l=0; midpts = 0; startpts = 0; val=0; while i < length(data),%% going through all the data l=0; midpts = 0; startpts = 0; val=0; while (i < length(data) & data(i+1,1) > data(i,1)), %% checking one instance sol = data(i+1,1)-data(i,1); if sol >= 30 & sol <= 50 %%checking if big enough to be an eye l=l+1; if l==1 midpts = (data(i+1,1)+data(i,1))/2; startpts = data(i,1); else midpts = vertcat(midpts, (data(i+1,1)+data(i,1))/2); startpts = vertcat(startpts, data(i,1)); end end i = i+1; end if l>1 & startpts(1,1)==0 val = midpts(2,1); else val = midpts(1,1); end positions = vertcat(positions, val); i = i+1; end plot(positions) Figure A1. MATLAB code for DSP. 22 // InpoutTest.cpp : Defines the entry point for the console application. // DUI Tester Group. Code to capture data from parallel port. #include "stdafx.h" #include "stdio.h" #include "string.h" #include "stdlib.h" #include <conio.h> #include <vector> #include <deque> /* ----Prototypes of Inp and Outp--- */ short _stdcall Inp32(short PortAddress); void _stdcall Out32(short PortAddress, short data); /*--------------------------------*/ int main(int argc, char* argv[]) { FILE* pfile = fopen("data.txt","w"); std::deque<int> data; int val; int test1 = 0; short status; status = Inp32(0x379); int count = 0; while(1){ //printf("%d \n", status); if(status != 0){ //printf("%d ", status); val = Inp32(0x378); fprintf(pfile,"%d\n",val); //printf(" value is :%d \n", val); data.push_back(val); count = 0; } else{ count++; } status = Inp32(0x379); printf("%d %d \n", status, val); //printf("%d running \n",status); } fclose(pfile); printf("ran fine \n"); printf("completed data capturing. %d values written to data.txt\n", data.size()); printf("press any key to perform DSP and signal analysis \n"); getch(); return 0; } Figure A2. Visual C++ code for parallel port data communication Note: This application is built on a driver class called Inpout32. The complete code for this driver can be obtained from our materials CD or from www.logix4u.net This code sets up parallel port communication for any Windows or DOS based system. 23 Appendix B: Schematic of Circuit and Pictures of Final Design 24 Figure B1. PSpice schematic of the circuit. 25 Figure B3. Top view showing linear array (without lens setup). 26 Figure B4. Picture showing the placement of lens setup on the linear array. Figure B5. Top view showing entire setup and the placement of lenses inside the PVC casing. 27