Car Black Box with Speed Control in Desired Areas for Collision Avoidance

— This paper presents an advanced step to the concept of car black-box in developing a comprehensive vehicle safety system which would not only record the video and audio, but also try to prevent a possible collision by limiting the speed of the vehicle in accident-prone areas. In case of an accident, the time and location (co-ordinates) is sent through GSM to a preset number for immediate rescue and treatment. Recorded data can also be used for forensics, revealing the problems that caused the accident and give manufacturer an idea for improvement. So the motto is to develop an embedded integrated system consisting of a microcontroller, a power supply unit, sensors, memory, a motor driver unit and a GPS/GSM modem.


INTRODUCTION
The Black-box is a digital video-audio event data recorder. The concept is similar to the "black box" data recorders on airplanes. It records all the information, like speed & temperature of the cabin/engine, time and location, before and after the accidents so that it can be used to analyze the accident accordingly. It includes a web-camera, a microphone, a realtime clock, and other electronic components, all controlled by a microprocessor with embedded software and fully selfcontained in a tiny, rugged black box that installs unobtrusively on the dash board [1].
Benefits customers receive are accurate, real time, easy to interpret data, a tamperproof system, and additional security. Other benefits include being able to see what the driver could see, hear, and feel in a crash. The user interface is very simple and has been designed to minimize driver distractions. A green indicator light shows that the system is armed and ready to capture an event. As soon as a collision is detected automatically, the indicator light will turn red and start recording all the relevant data during a pre-defined period before and after the accident.
The black-box is modified accordingly so that the system is triggered automatically as soon as abnormal readings are detected by the sensors and is prioritized as shown in Table I. Collection of audio and video can take place by a camera which can be easily stored in a flash memory/SD card. Captured video and audio is date and time-stamped and can be downloaded to a laptop computer or VCR for viewing and/or long-term storage. Events can be displayed immediately on a television or camcorder, thus offering great ease for viewing recorded information. For more efficiency, the data recorded will get refreshed on every start of the vehicle for managing the limited data storage capacity, unless an accident has taken place. The applications of Car Black-box include: 1. Better crash research that may produce improved driver education programs, safer road designs and improve highway safety.
2. Collision data for research, data to improve vehicle design internally and externally 3. To not only record the relevant data, but also try and prevent a possible collision by limiting the speed of the vehicle in accident-prone areas. The In Vehicle based Car Black-box consists of a Microcontroller 89S52 core of the family 8051 embedded system used widely in the industry with an ARM processor. A web camera and a microphone is present for video and audio recording. The GSM/GPS module is also connected to the processor. Figure 1 shows the entire architecture of the Car Black-box [1][2][3][4][5][6][7].
The data from infrared sensors are given to an encoder converting it from parallel to serial and transmitted wirelessly via a transmitter module. Inside the car, the data is received by

www.etasr.com Pawar and Poddar: Car Black Box with Speed Control in Desired Areas for Collision Avoidance
a receiver module and a decoder converts it back again from serial to parallel to give it to the microcontroller. The accident switch is a circuitry which senses abnormal readings and triggers the system. Various sensors such as the temperature and speed sensor are converted from analog to digital and given to the microcontroller.
Depending on various inputs given and bi-directional connectivity with the ARM processor, the 89S52 controller takes decisions and varies output given to the motor driver assembly which is in direct contact with the motors of the car. The microcontroller not only recognizes the crash through the interrupt pin connected with the accident switch when car collision is detected, but also moves the data of the memory buffer to the SD card. The recording camera comprises of CMOS sensors having advantages like low power consumption, small size, direct digital output and simple design compared to traditional ones. The GPS (Global Positioning System) continuously tracks the vehicle's position and keeps record of accurate time. The SD card used was selected keeping in mind newly emerging audio video consumer electronic devices. It can support easy interface allowing a PC to be connected without any special devices making it more portable. The assembly for this section consists of IR sensors which immediately detect the entry of vehicle in an accident prone zone. As soon as the same happens they send a level high signal which is transmitted wirelessly via the transmitter module. In the next stage, via the receiver module, data are given to the 89S52 microcontroller, which understands the presence of car in the accident zone and hence by pre defined logic it gives signal to the motor driver circuitry to control the speed of the vehicle at demarcated locations.
As seen in Figure 2, as soon as the car enters a predefined zone, e.g. a school as shown, it gets detected by sensors (marked with red dots) and after immediate signal transmission to the microcontroller inside the car, the speed is instantly brought to a preset level, reducing the chances of any accidents taking place. The specific microcontroller was chosen due to various advantages. It's a low-power, high-performance 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The on-chip Flash allows the program memory to be reprogrammed insystem or by a conventional nonvolatile memory programmer. The Atmel AT89S52 is a powerful controller which provides a highly-flexible and cost-effective solution to our project. It is also the most easily available one. The IR sensor unit comprises of IR LED's which emit high intensity red light out of the sensor unit. If the light finds an obstacle in its path it is reflected back and this light it is received by the photo transistor. The reflected signal falls on the photo transistor. This ray excites the base of the transistor and switches the transistor on. Working logic of IR sensors The comparator compares the two voltages and switches its output to indicate which is larger. We are using LM358 IC as a comparator. The non inverting input terminal of comparator is given an input signal detected by photo transistor while the inverting input terminal is given a reference voltage with the help of potentiometer. The comparator is used in non inverting mode i.e. when voltage falls below reference voltage, the output becomes low. On pin 3 i.e. non inverting terminal of

www.etasr.com Pawar and Poddar: Car Black Box with Speed Control in Desired Areas for Collision Avoidance
comparator the voltage is maintained above the reference voltage. Due to which, the output is initially high. The light emitted by the LED falls on the photo diode. The voltage at pin 3 of Op-amp goes low. Hence the output will go low. When the sensor is on the white surface the photo diode receives light and turns on and voltage at non-inverting input terminal decreases. Hence the output becomes low. Whereas when the sensor is on the black surface no light is received by photo transistor and it remains off. So the voltage at non inverting input of op-amp is greater than that of reference voltage at inverting input. So the output of comparator goes high. The Encoder section is a series of CMOS LSIs for remote control system applications. They are capable of encoding information which consists of N address bits and 12_N data bits. Each address/data input can be set to one of the two logic states. The programmed addresses/ data are transmitted together with the header bits via an RF or an infrared transmission medium upon receipt of a trigger signal. The capability to select a TE trigger on the HT12E or a DATA trigger on the HT12A further enhances the application flexibility of the 212 series of encoders. On the other hand the decoders receive serial addresses and data from a programmed 212 series of encoders that are transmitted by a carrier using an RF or an IR transmission medium. They compare the serial input data three times continuously with their local addresses. If no error or unmatched codes are found, the input data codes are decoded and then transferred to the output pins. The VT pin also goes high to indicate a valid transmission. The 212 series of decoders are capable of decoding information that consists of N bits of address and 12_N bits of data. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits, and HT12F is used to decode 12 bits of address information The Microcontroller receives the code for left, right, up, down from ARM processor at port 1. It checks the code and accordingly provides the data on port 0 to motor of the car. To drive the motor we have used the L298 motor driver IC. Two motors on the left side of the car are connected in parallel combination & other two on the right side are connected in parallel combination with respect to the motor driver circuit.
The L298 Motor Driver has 4 inputs to control the motion of the motors and two enable inputs which are used for switching the motors on and off. To control the speed of the motors a PWM waveform with variable duty cycle is applied to the enable pins. Rapidly switching the voltage between Vs and GND gives an effective voltage between Vs and GND whose value depends on the duty cycle of PWM. 100% duty cycle corresponds to voltage equal to Vs, 50% corresponds to 0.5Vs and so on. The 1N4004 diodes are used to prevent back EMF of the motors from disturbing the remaining circuit. Many circuits use L293D for motor control, L298 is chosen here as it has current capacity of 2A per channel at 45V compared to 0.6A at 36V of a L293D. L298 on the other hand also works happily at 16V without a heat sink, though it is always better to use one.
The Embedded software used is executed by 89S52. The software is designed in assembler by Keil software using C language in HEX [6]. The data recording starts as soon as the accident switch is triggered and the code is compiled to set the proper baud rate so that all the data is updated every second. In this paper we present the design of a Car Black Box. We have successfully implemented the embedded system which gave good results and expected functioning. The data can be retrieved as required with great ease. The initial testing was done with connection to a PC instead of an ARM processor for simplicity on trial purposes and later on the actual platform.