Design and implementation of fatigue driving detection device based on ATMaga8

Publisher:电子设计探索者Latest update time:2012-09-25 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Structural features of the detector

The detector uses a single-chip microcomputer to control a reflective infrared sensor to detect the position of the driver's head. By detecting the relative position of the driver's head and the seat headrest in a normal sitting position, it automatically determines whether the driver is in a fatigue driving state.

If the driver is in a fatigue driving state, the head must deviate from the normal position and the time exceeds the set value, then an alarm and brake control signal are output. The reflective infrared sensor in the detector consists of an infrared emitting diode and two infrared receiving heads. The infrared emitting diode emits a modulated 38 kHz infrared beam and is installed on the front of the seat headrest facing the driver's head. The infrared emitting diode is placed in the middle and the two infrared receiving heads are placed symmetrically on the left and right sides. 2 Analysis of the driver's head position During driving, the driver's head position is different when normal and when fatigued. The side view is shown in Figure 1. Figure 1 (a) shows that when the driver is driving the car normally, his head position is a few centimeters away from the seat headrest, rather than completely close to the headrest, because driving close to the headrest will make the eyes feel very uncomfortable and inconvenient to observe the road conditions close to the car. Figure 1 (b) shows the most common sleeping posture when the driver is driving a car while fatigued. It is also the driver's initial fatigue sleeping posture. At this time, the driver's head is generally more than 15 cm away from the seat headrest. In this case, an alarm should be sounded in time. If it lasts for 2 seconds, the brake system should be activated to brake automatically. However, other short-term non-fatigue actions, such as leaning over to operate the switch on the dashboard, looking back, and other short-term actions, also have similar distance changes. At this time, time can be used to distinguish. Returning to the normal position within 2 seconds is not considered as fatigue driving. Figure 1 (c) shows the posture of the driver when he consciously takes a short rest and closes his eyes while driving, but has not yet fallen asleep. However, this is a prelude to complete sleep. His head is close to the seat headrest and the distance is 0. In this case, an alarm should be sounded in time. If it continues to develop, it will evolve into the situation in Figure 1 (b).









Figure 1 Side view of the driver's head position

FIG2 is a top view of the driver's head, in which the circle represents the driver's head and the arrow represents the route of infrared emission and reflection. FIG2 (a) is a schematic diagram of the relative position of the driver's head and the infrared sensor during normal driving. The distance traveled by the infrared from the infrared emitting diode in the middle to the two infrared receiving heads on the left and right reflected by the driver's head is basically the same. FIG2

(b) shows the position of the driver's head after fatigue, which is tilted to the left or right. This is different from the typical position of FIG1 (b). It is an intermediate transition fatigue form and will eventually transform to the position of FIG1 (b). At this time, the infrared sensor will detect different distances on the left and right, and an alarm or brake signal should be output in time.

FIG2 (c) shows the position of the driver's head after fatigue. The infrared receiving head on one side can no longer receive the reflected infrared light. The result of infinite distance is obtained in the computer program, which indicates that the driver's fatigue level has further increased and an alarm or brake signal should be output in time.



Figure 2 Top view of the driver's head position



3 Hardware design of the detector

The hardware circuit diagram of the detector is shown in Figure 3, where LED is an infrared emitting diode, IC3 and IC4 are infrared receiving heads, and MCU is an ATMaga8 microcontroller.



Figure 3 Detector hardware circuit



LED emits a 38 kHz infrared modulated beam, which will be reflected by the driver's head and irradiate the receiving window of IC3 and IC4. IC3 and IC4 demodulate the received signal, and after amplification, send it to the input line of the single-chip microcomputer MCU in a high or low level manner. The computer program sends the value of the line to the memory for storage, which is used as a basis for judgment by the subsequent program. [page]

The effective detection distance of the infrared light emitted by the infrared emitting diode LED corresponds to the current passing through the infrared emitting diode. The current of the infrared emitting diode LED is determined by the output voltage of the three-terminal integrated voltage regulator IC2, and the output voltage of the three-terminal integrated voltage regulator IC2 is controlled by the control word output by the computer program.

The maximum value of the control word is binary 11111111d. At this time, R1~R8 are all grounded, the comprehensive resistance of R12 is the smallest, the output voltage Vout of the three-terminal integrated voltage regulator IC2 is also the smallest, and the effective distance of the infrared light beam emitted by the LED is also the smallest. By properly adjusting the values ​​of R1~R8, the effective distance of the infrared light beam emitted by the LED can be adjusted to about 1 cm. When the minimum value of the control word is binary 00000000d, all resistors R1 to R8 are suspended, the comprehensive resistance of R12 is R12, the output voltage Vout of the three-terminal integrated regulator IC2 is the maximum, and the effective distance of the infrared beam emitted by the infrared emitting diode LED is also the maximum. By properly adjusting the value of R12, the effective distance of the infrared beam emitted by the infrared emitting diode LED can be adjusted to about 20 cm. The effective detection distance of 1 to 20 cm can meet the actual needs. [page]

4 Detector software design

4. 1 Distance detection method The

effective distance detection corresponds to the control word issued by the single-chip microcomputer. The distance detection method is: gradually reduce the intensity of infrared emission until the reflected infrared beam is not received. The distance value corresponding to the control word at this time is the distance between the current driver's head and the seat headrest.

4. 2 Automatic calibration of the driver's head position

The single-chip microcomputer program flowchart is shown in Figure 4. The program for automatically calibrating the normal position of the head runs after the car starts the engine and then delays for a period of time, because fatigue driving will not occur during this period of time. When driving on the main road, the head movement gradually stabilizes, and this is the right time to calibrate the head to its normal position. Recalibration is required every time because the driver may change, and the position of each person's head is not exactly the same, so the calibration results will also be different.



Figure 4 Flow chart of automatic calibration of normal head position

The procedure for automatically calibrating the normal position of the head is to gradually reduce the current intensity of the infrared emitting diode from strong to weak, and at the same time detect the output status of IC3 and IC4 to determine whether it has reached the critical point where it cannot be received. This is the limit for stopping the reduction of the emission current intensity, and at the same time read the control word value at this moment as the distance calibration. When the signal levels output by the left and right two infrared receiving heads IC3 and IC4 are consistent and can remain unchanged for a considerable period of time, the control word at this time can be used as the standard distance calibration. Each control word corresponds to an actual distance.

4. 3 Detection of the driver's head deviating from the normal position

If an infrared receiving head does not receive the infrared signal, it is determined that the distance between this infrared receiving head and the driver's head is greater than the distance associated with the control word at this time.

The information output by the two infrared receiving heads respectively reflects the distance between the driver's head and the two infrared receiving heads at the same time. By comparing with the standard distance, it can be determined whether the driver's head is in the normal position or tilted forward, sideways, or backward. Whether to output the alarm and brake control level is determined by the computer program according to the duration after the driver's head deviates from the normal position.

5 Experimental results analysis

The detector was installed on cars such as Jetta and Swift and a large number of experiments were conducted. The normal driving state and fatigue driving state of 5 drivers were tested. The test data are shown in Table 1. It can be seen that the detector can track and judge the fatigue state of the tester in real time, and also serve as a warning for the improper sitting posture of drunk driving. 6 Conclusion The detector completes the recognition of whether the driver's head position is normal or not, and then judges whether the driver is driving fatigued. It is an intelligent application of simple technology. The detector can be equipped with existing cars at a low cost, improve the safety probability, and facilitate large-scale promotion. The market demand potential is huge.




Reference address:Design and implementation of fatigue driving detection device based on ATMaga8

Previous article:AVR learning air conditioner infrared remote control code
Next article:Design of Taxi Dispatch Center System Based on ATmega128

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号