Vous êtes sur la page 1sur 20

AUTOMOBILE COLLISION DETECTION SYSTEM

by Eilleen Berganos and Timothy Lim ECE 345Senior Design TA: Shao Hsia December 5, 2000 Project #2

ii

Abstract
In this paper, the goal is to present a senior design project which pertains to building an automobile collision detection system that will successfully detect obstacles or targets at a variety of ranges, avoid side collision situations via force feedback to the driver, and create an easy way for alerting the driver of obstacles and collisions via a user friendly console. The components, design, and verification of the entire project will be discussed as well as certain challenges that came up while work was done on the project. Primarily ultrasonic sensors, an analog to digital converter, a Motorola 68HC12 microcontroller, and a set of light emitting diodes implemented the design.

iii

TABLE OF CONTENTS
PAGE 1. INTRODUCTION...1 1.1 1.2 1.3 2. Functionality and block diagram.....1 Performance variables and specifications1 Major design components1

DESIGN PROCEDURE..3 2.1 2.2 2.3 Sensing System Procedure...3 System Logic Procedure..3 Design Alternatives..4

3.

DESIGN DETAILS.6 3.1 3.2 Sensing System Details6 System Logic Procedure..7

4.

DESIGN VERIFICATION11 4.1 4.2 Sensing System Verification..11 System Logic Verification.12

5. 6.

COSTS...15 CONCLUSION..16 APPENDIX 1. REFERENCES.17

1. Introduction
1.1 Functionality and Block Diagram

The block diagram of the automobile collision detection system is shown in Figure 1.1 at the end of the chapter and the functionality of each block is as follows: Sensor Will detect obstacles and withstand most everyday environments. Logic Will handle a network of sensors linking the sensors to a microcontroller and be implemented with a demultiplexer. Synchronization Will cycle through sensory data coming in from the demultiplexer and relay the information to a proximity alert console and if need be relay control signals to drivers steering wheel to produce force feedback in situations where side collisions are imminent. Presentation of Data Will present data processed by the microcontroller and display the results of the sensor data to the user via a proximity alert console. Guidance System Will take control signals presented from the microcontroller and present it to the user as force feedback. 1.2 Performance variables and specifications

The variables pertaining to the performance of the project include the time-delay from the sensor to the light emitting diode console, the distance between the object and the sensor, and the analog to digital reference voltages. The time-delay from the sensor to the light emitting diode console pertains to the time it takes for the system to produce a LED output after the sensor detects an object in its detection range. This value should be less than half a second. The distance between the object and the sensor pertains to the minimum and maximum distances that the sensor can accurately detect any object. The value of the minimum and maximum detection range of the ultrasonic sensors should be 0 in. and 12 in. respectively. The analog to digital reference voltage pertains to the voltage value that the analog to digital converter utilizes in order to determine its sampling value in bits per mV. The value of this should be around 1.3 V with a resulting resolution of 5 mV/bit. 1.3 Major design components

The purpose of the Automobile Collision Detection system is to keep drivers better informed with the environment surrounding them. The system consists of eight different sensing areas: front, rear, side, and as well as front and rear diagonal positions. To implement this system, the following components were used: the sensor system and the system logic. The sensing system consists a set of Jameco model number 40TR128 ultrasonic sensors and a National Semiconductor ADC0808 model analog to digital converter. The data sheets for the sensors and the analog digital converter can be found at http://www.jameco.com/Jameco/Products/ProdDS/139491.PDF and http://www.national.com/adscgi/viewer.pl/ds/AD/ADC0808.pdf, respectively. The system logic consists of Motorola 68HC12 Microcontroller and a set of LEDs for each sensor area.

Figure 1.1. Block Diagram of the Automobile Collision Detection System

2. Design Procedure
2.1 Sensing System Procedure In the sensing system of the project a set of ultrasonic sensors and an analog to digital converter are used. The system required eight analog signals to be converted from each of the eight sensing areas of the system (front, rear, left side, right side, front right, front left, rear right, and rear left). It was also determined that a smaller reference voltage needed to be fed into the analog to digital converter in order for the analog signal coming in from the sensors to be utilized properly by the microcontroller. The analog signal coming in from the sensors was pretty small in magnitude and so the reference voltage needed to be reduced so that the signal can be more accurately broken down for the microcontroller to use. To bring the voltage down, an appropriate resistor was dropped down from a voltage source to the analog to digital converter. The equation used to calculate the reference voltage needed for a particular resolution can be seen in Equation (1) below. A general circuit diagram of the sensing system can be seen in Figure 2.1 at the end of the chapter. Bit resolution * Analog to digital converter resolution = Desired reference voltage (1)

In order to choose the resistor that needed to be pulled to the voltage source we used Equation (2) below after measuring the current coming into the analog to digital converter. Resistor value = (Value of main voltage source desired reference voltage)/measured current 2.2 System Logic Procedure (2)

The system logic is the subproject that ties the user interface and ultrasonic sensors together. This subproject determines the sub-ranges of each sensor area while at the same time outputting this information to the user interface. The sensor ranges were predetermined with voltage measurements from the ultrasonic sensors and the analog/digital conversion discussed in Section 2.1. Each sensor area had a range of 0 to 12 inches. Therefore, each range was arbitrarily divided into four different sub-ranges. With each sub-range, the corresponding light emitting diode (LED) on the user interface would be lit. A summary of the sub-ranges for each sensor area and corresponding LEDs are listed in Table 2.1. TABLE 2.1. Designation of sub-ranges with reference voltage = 1.3 Volts. Sub-Range 1 (10-12 inches) 2 (7-9 inches) 3 (3-6 inches) 4 (0-2 inches) Voltage Amplitude (mV) 0-59 60-119 120-179 180 LED Display Green Yellow Red Force Feedback LED

The voltage amplitudes are measurements from the ultrasonic sensors at different ranges. The 5mv/bit value is the value calculated from the reference voltage of the analog/digital conversion. Both the voltage amplitude and the 5mV/bit value are discussed further in the previous section. Using the maximum voltage level within each sub-range chooses the boundary values. Equation (3) shows how to determine the boundary values.

4 Boundary Value = (Maximum Voltage Amplitude in sub-range) / (5mv/bit) (3)

These boundary values would then be converted to a binary number for easy comparison with the binary data that would be coming from the ultrasonic sensors along with their analog/digital conversion. The Motorola 68HC12 Microcontroller would take the binary data determined for the boundaries and the binary data from the sensors to determine the proper output to the user interface. With the microcontroller, the sensor area and its corresponding sub-range would easily be determined. It would compare and branch according to the predetermined boundary values. Once the sub-ranges were determined with the 68HC12 Microcontroller, the determined values would need to be outputted to the user interface. The user interface comprised of a series of LEDs. Each LED represented each sub-range within each sensor area. Therefore, the corresponding area that was activated would be lit on the user display. With all these elements combined, the user will be able to see where obstacles are located around their vehicle and make the necessary adjustments. 2.3 Design Alternatives

The reason ultrasonic sensors are used is because they are the best available sensors to accurately detect objects of virtually any material and through many types of weather unlike sensors of the infra-red and photoelectric variety. In deciding what analog to digital converter to use, the need for an analog to digital converter with a multiplexer as opposed to an analog to digital converter that took in analog signals one at a time was realized. It was determined that an analog to digital converter with a multiplexer built into it will be advantageous over a configuration of two separate entities (multiplexer and analog to digital converter configured separately) due to the reduced propagation time of the combined analog to digital converter and multiplexer package. Other design alternatives could involve the system logic. The system logic could have been built using simple logic. However, this design was not chosen in hope of adding more functionality to the collision system in the future.

Figure 2.1. General Circuit Diagram of Sensing System

3. Design Details
3.1 Sensing System Details

To get an idea of the voltage range that needed to be dealt with coming from the ultrasonic sensors, different distances between an arbitrary object (a wirekit) and the sensor had to be determined. The data that was acquired in Table 3.1 below shows the approximate magnitudes of voltages at different object distances for a given ultrasonic sensor transmitter/receiver pair. TABLE 3.1. Voltage as a function of Distance using Wirekit (Plastic Object) Distance (inches) 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 Voltages (mV) 177.35 140.60 79.69 62.50 60.94 56.25 53.13 50.00 42.19 23.44 21.88 17.19 12.50

After coming up with the voltage magnitudes above, it can be seen that a small bit resolution is the most desirable since the voltage magnitudes coming out of the ultrasonic sensor are pretty small. A smaller bit resolution would allow the microcontroller to better distinguish between different distances. It was decided then that a bit resolution of 5mV/bit would be sufficient enough for a good distance differentiation. In order come up with the appropriate 5mV/bit resolution for the analog to digital conversion instead of the default resolution produced by a 5 V reference voltage coming from the main voltage source (Vcc), which would have been 20mV/bit, the reference voltage that was required to be fed into the analog to digital converter needed to be calculated. Using Equation (1), a voltage reference of about 1.3 V was calculated. The calculation can be seen below for this in Equation (4). 5 mV/bit * 256 bits = 1.28 V 1.3 V (4)

Next, the resistor value dropping from the main voltage source needed to be calculated. First, the current to the voltage reference pin, without the presence of a resistor, was measured by an ammeter to be 5 mA. The desired reference voltage was 1.3 V. Using Equation (2), a resistor with a value of 740 ohms was calculated in order to produce the reference voltage. The calculation for this is shown below in Equation (5). (5 volts 1.3 volts) / 5 mA = 740 ohms (5)

3.2

System Logic Details

7 The system logic can be divided into two main components: the microcontroller and the user interface. The user interface depends solely on the output of the microcontroller. Therefore it is important that the microcontroller efficiently execute the code and is constantly updating the information from the sensors. The details of the microcontroller are described further below. The Motorola 68HC12 Microcontroller combined the elements of the user interface and the ultrasonic sensors. The three main functions of the microcontroller were the following: 1. Control the multiplexer to select appropriate sensing area 2. Determination of ranges with compares and branch commands 3. Control the output to the user interface Each of the sensor areas goes through each of the above functions by cycling through an infinite loop. This is to ensure constant updates for the user display and to ensure that the microcontroller is getting the most updated information from the ultrasonic sensors. While cycling through the infinite loop, the microcontroller must choose which sensor it wants to look at. This is done with Port E. The values of Port E are outputted to the multiplexer and in turn that multiplexer chooses the appropriate sensor pair. For example, while cycling through each sensor area within the code it would first set the value for the multiplexer followed by a half second delay. The delay is implemented by decrementing a numeric variable until it reaches zero. This delay ensures that the signal has time to go through the analog/digital conversion and can be inputted through Port A. At the same time, this delay does not cause any significant delay that will cause the user to have inaccurate information about the obstacles around them. The values used to select the sensor area are stated in Table 3.1. TABLE 3.1. Control values for selecting sensor areas. PORT E (PE7, PE6) 00 01 10 11 Sensor Area Left Side Rear Left Diagonal Mid Rear Rear Right Diagonal

Once the delay is done it loads and stores the data from the analog/digital conversion of the ultrasonic sensors into Port A. It then goes through a range of compares and branches with the boundary values calculated ahead of time. The process can easily be seen through the flow diagram in Figure 3.1 at the end of the chapter. It loads and stores the value from the sensor that was selected earlier with Port E. Then it compares this value with the boundary values calculated in Table 3.2. When the compare is done, depending if it is within the boundary values, it will assign the proper values to Port B and then branch to the next sensor area. The boundary values are 60 mV, 120 mV, and 180 mV respectively. By using Equation (1), the binary values for the boundary values are calculated and listed within Table 3.2.

TABLE 3.2. Boundary values used in branching.

8 Boundary Value (mV) 60 120 180 Boundary Value Calculated from Equation (1) 0000 1100 0001 1000 0010 0100

Port B is the output that controls the user interface. These values are determined from the comparison described above. Port B is set up in a way in which 2 bits of the 8-bit port represent the 4 different sensor areas. From there, those 2 bits can have up to four different values depending on the sub-range. Table 3.3 describes which bits of Port B are designated to which area. Table 3.4 describes the possible values for each area and their subsequent sub-ranges along with their values for the user interface display. TABLE 3.3. Designation of Sensor Area in Port B PORT B (Bits Used) PB7, PB6 PB5, PB4 PB3, PB2 PB1, PB0 Sensor Area Left Side Rear Left Diagonal Mid Rear Rear Right Diagonal

TABLE 3.4. Possible Values for each sensor area Sub-ranges 1 (10-12 inches) 2 (7-9 inches) 3 (3-6 inches) 4 (0-2 inches) Value 00 01 10 11 LED Display Green Yellow Red Force Feedback LED

Once all of these values are determined, they are used to build the user interface. The user interface is built using a 3 to 8 decoder and a set of inverters for each sensor area. A LED is tied via an inverter to the first four least significant address lines since these are the only address lines for the four different subranges. The values from Port B are used as selector bits for the decoder hence give a low to the selected address and a high to all the other address. Therefore an inverter is needed to subsequently reverse all these signals therefore allowing the corresponding LED to be lit. The user interface is built using the decoder and inverter. They are arranged according to Figure 3.2 at the end of the chapter.

Load
Loads input into PORTA

Store
Stores input into PORT A

Compare
Range 1

Each sensor area goes through this process.

Compare
Range 2

Compare
Range 3

Compare
Range 4

Store
Put proper value into LED

Start for new Sensor Area


Figure 3.1. Flow Diagram for each sensor area

10

Front

Rear

Figure 3.2. User Interface

11 4. Design Verification 4.1 Sensing System Verification

In order to verify that the sensing system was working according to its design, tests were done on the sensors and the analog to digital converter. For the sensors, voltage versus distance tests were done with objects of differing materials. The data for objects made of plastic (which was shown in Table 3.1 on the previous chapter), wood and metal. The data for wood and metal can be seen on Tables 4.1 and 4.2 below relating distance between sensor and object as well as the corresponding voltage level for each distance. TABLE 4.1. Voltage as a function of using Distance using Wooden Object Distance (inches) 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 Voltages (mV) 180.47 145.45 69.60 62.50 60.30 58.21 52.43 48.55 43.68 26.89 20.73 19.57 12.45 TABLE 4.2. Voltage as a function of using Distance using Metal Object Distance (inches) 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 Voltages (mV) 174.35 132.43 74.56 65.70 61.39 59.54 51.37 49.66 42.78 28.89 21.11 19.56 13.01

As can be seen by Tables 3.1, 4.1 and 4.2, the voltages dont differ that much at each distance. This confirms that the sensors are indeed independent of the material that the object is made of. In order to verify the functionality of the analog to digital converter, eight light emitting diodes were connected to each of the eight digital output ports of the analog to digital converter. When the time came to convert the analog signals coming from the sensors the bit value of the digital output can then be seen on the eight light emitting diodes. The values tested, voltages and the binary values realized can be seen on Table 4.3. When running these tests, a problem arose when the analog signal was being converted into a binary value. The analog to digital converter was outputting many different binary values from one analog signal. It was then figured that this problem came from the fact that the analog signal coming in from the sensors was so noisy that the analog to digital converter was converting the noise too. To remedy this, a full wave rectifier circuit was designed as an attempt to remove most of the noise. The circuit for the diagram can be seen on Figure 4.1 at the end of the chapter. Unfortunately, after implementing the circuit into the system, it didnt correct the problem as expected. The PSPICE simulation of the graphed output of the rectifier circuit can be seen in Figure 4.2 at the end of the chapter. As can be seen, the circuit will ideally filter out all of the noise associated with the analog signal. Resistor and capacitor values were chosen so that the time constant of the circuit would be equal to the amount of time it took for the capacitor to reach ten percent of its maximum voltage value. Its in this region that steady state is achieved and thus a steady state signal can be realized. In order to figure out the

12 time constant that we needed to use we measured the time it took a one picofarad capacitor to decay to ten percent of its maximum voltage value. The desired time constant was set equal to this value and the value of the required resistor was calculated. Ten percent of the maximum voltage value of the one picofarad capacitor was measured to be 1.25 us. And by using Equation (6) below, a resistor with a value of about 1.25 M was required to be used. = RC R = /C (1.25 us)/(1.0 pF ) = 1.25 M (6)

Due to the lack of time and the fact that both the sensors and the analog to digital converter had achieved basic functionality, the issue was not looked into any further. 4.2 System Logic Verification To test the functionality of the system logic, simulated high and low signals were put into Port A. The simulated voltage values were determined using Equation (3). With this simulation it was possible to see the output of the microcontroller through the user interface. The following values were used and the results for each of the values. TABLE 4.3. Simulated inputs to test functionality of system logic. Sub-range 1 (10-12 inches) 1 (10-12 inches) 2 (7-9 inches) 2 (7-9 inches) 3 (3-6 inches) 3 (3-6 inches) 4 (0-2 inches) Simulated Voltage Value (mV) 20 59 60 119 120 179 180 Bit Value 0000 0100 0000 1011 0000 1100 0001 0111 0001 1000 0010 0011 0010 0100 LED Display Green Green Yellow Yellow Red Red Force Feedback LED

Only one test was done with Range 4 because anything higher that the bit value would have the same output on the LED user display. With this test we were able to verify the functionality of the microcontroller.

13

Figure 4.1. Full Wave Bridge Rectifier Circuit Layout with Low Pass Filter

Figure 4.2. PSPICE Simulated Graph of the Output for the Rectifier Circuit

5. Costs
Parts: Jameco Ultrasonic Sensors (4 pairs) Motorola HC12 Microprocessor 10 kilo Ohm resistors (12) National Semiconductor Analog/Digital Converter Red LED (8) Yellow LED (4) Green LED (4) 3 to 8 Decoder (4) Inverters (4) Total $ 24.00 $ 25.00 $ 0.60 $ 5.50 $ 1.20 $ 0.60 $ 0.60 $ 2.40 $ 2.40 $62.30

Labor: 2* ($ 40/hour * 2.5 * 300 hours) = $60,000

Project Total: $60,062.30

6. Conclusion
The automobile collision detection system is a useful device in today's society. It helps the driver to be aware of the environment surrounding them. Although there were implementation problems, the design was successfully. Through simulations, it was predicted that the project would be functional in any environment. With a successful design and implementation, the driver would be able to detect multiple obstacles in multiple areas. The system logic subproject was implemented successfully. The Motorola 68HC12 microcontroller was able to communicate accurately with the ultrasonic sensor output and the user LED interface. Thus making it possible for the driver to have a safer trip. The sensor area implementation encountered some difficulties. The main obstacle within the subproject was the analog/digital conversion. This problem could have been solved with a full-wave rectifier and low-pass filter. This would eliminate any irregularities with the analog/digital conversion, thus making the project successful. Despite these, irregularities the project as a whole was functional. For real world implementation, the project would need to take into account different situations. At the deadline, the project was able to detect obstacles while stationary. Real world implementation would include movement factors such as velocity, wind, and weather conditions. Other additions to the project could include a force feedback system that would incorporate steering and breaking controls. Another possible addition would be monitoring the actual distance from the object in addition to have the designated sensor areas. The possibilities of this project depend on the wants of the user. This project provided the basic awareness components for the user and other options could easily be adapted. Therefore making the project open to expansion or adequate as a stand-alone device.

Appendix 1. References

Jameco Electronics, Jameco Part Number 139491, http://www.jameco.com/Jameco/Products/ProdDS/139491.PDF. National Semiconductor, ADC0808 8-bit uP Compatible A/D Converters with 8-Channel Multiplexer, October, 1999, and http://www.national.com/ads-cgi/viewer.pl/ds/AD/ADC0808.pdf.

Vous aimerez peut-être aussi