Professional Documents
Culture Documents
BACHELOR OF TECHNOLOGY
In
By
ARUN KUMAR-1209731025
ASHUTOSH MANI TRIPATHI-1209731026
BIKASH KR. MISHRA-1209731031
BRIJESH BAJPAI-1209731032
Under the Guidance of
GALGOTIAS COLLEGE OF
ENGINEERING AND TECHNOLOGY
DECLARATION
We hereby declare that this submission is our own work and to the best of our
knowledge and belief, it contains no material previously published or written by
any other person nor material which to a substantial extent has been accepted
for the award of any other degree or diploma of the university or other institute
of higher learning, except where due acknowledgement has been made in the
text.
A) ABSTRACT………………………………………………...……………...1
B) LIST OF SYMBOLS………………………………………..……………...2
1. INTRODUCTION
1.1 BACKGROUND....………………………………………..………..….3
2.1.1 DESCRIPTION…………………………………………………..6
2.1.2 PIN CONFIGRUATION……………………………...…………9
2.1.3 PIN DESCRIPTION………………………………..…....……...10
2.1.4 BLOCK DIAGRAM…………………………….……….……...12
2.1.5 MEMORY ORGANIZATION………………….……….……...13
2.1.6 INTERRUPTS…………………………………….…………….14
2.2 SENSORS
2.2.1 TEMPERATURE SENSOR (LM35)………………….………..15
2.2.2 ULTRASONIC SENSOR (HC-SR04)…………………….……17
2.2.3 GAS SENSOR/ALCOHOL SENSOR (MQ5)…………….……18
2.2.4 INFRARED SENSOR FOR SPEED MEASUREMENT………20
2.3 MOTOR
2.3.1 DESCRIPTION………………………….…………………...…26
2.4 TRANSFORMER
2.4.1 DESCRIPTION………………………………….…………27
2.4.2 TRASFORMER WORKING…………………….………...28
2.4.3 E.M.F. EQUATION OF A TRANSFORMER…….……….30
2.5 LCD
2.5.1 DESCRIPTION……………………………………....……32
2.6 LM741 OPERATIONAL AMPLIFIER…………………………..34
2.7 PIEZOELECTRIC BUZZER……………………………………..35
2.8 L7805CV VOLTAGE REGULATOR……………………………36
2.9 RELAY, POTENTIOMETER, BATTERIES…………………….37
3. PROJECT IMPLEMENTATION
3.1 SOFTWARE DESCRIPTION……………….………………..40
3.2 CIRCUIT DIAGRAM………………………….……………...41
3.3 SIMULATION IN PROTEUS………………….……………..42
3.4 WORKING PRINCIPLE……………………………………...45
4. CONCLUSION……………………………………….………………46
5. FUTURE ENHANCEMENTS………………………...…………….47
6. APPENDIX (CODE)…………………………………………………48
7. REFERENCES………………………………....…………………….51
ABSTRACT
The main purpose of this project is to develop a prototype of Black Box For
vehicle diagnosis that can be installed into any vehicle. This prototype can be
designed with minimum number of circuits. This can contribute to construct
safer vehicles, improving the treatment for crash victims, helping insurance
companies with their vehicle crash investigations, and enhancing road status in
order to decrease the death rate.
1
LIST OF SYMBOLS
SYMBOLS MEANING
2
1. INTRODUCTION
1.1 BACKGROUND
Therefore, with the help of obstacle detection and distance measurement sensor,
a front end collision warning system is developed to prevent vehicle from the
collision is named as VVCAU. Many cases remain pending due to unknown
reason of an accident. To avoid these problems, a design is proposed to enhance
on-board recording device (i.e. Black Box). Car black box is a digital electronic
device, which records and store vehicle speed, real time and vehicle's other
status information. It helps to discover and to analyse the reason of an accident
easily and to settle many disputes related to car accident such as crash litigation,
insurance settlements.
3
1.2 PROBLEM STATEMENT
According to the World Health Organization, more than a million people in the
world die each year because of transportation-related accidents. In order to react
to this situation, the black box system draws the first step to solve problem. Like
flight data recorders in aircraft, "Black Box” technology can now play a key
role in motor vehicle crash investigations.
1.3 OBJECTIVES
The project aims to develop a prototype for a car black box which can perform
the function of data recording for the purpose to help in after crash
investigations and function of collision avoidance which will help in keeping
the driver alert so that any chances of possible collision can be averted. To
realize these two functions in our project we have two units which are explained
below:
I. Vehicle to vehicle collision avoidance unit: This unit will be responsible for
the avoidance of collision at any cost. It consist of sensors such as ultrasonic
sensor which will alert the driver if it approach some other car or border of the
road too close and gas/alcohol sensor which will detect if the driver is under the
influence of alcohol or not; if driver is under the influence of alcohol then it
won’t allow the engine to start. Thus avoiding any possible collision.
4
II. Data recording unit: This function of this unit is to record the necessary
data which can help us in the after crash investigation in any possible way. Such
as engine temperature, speed of the car, distance, seat belt status, alcohol status
etc
(Although we have only used four sensors in our project which are ultrasonic
sensor, infrared sensor, alcohol sensor, temperature sensor. We can add whole
lot of different types of sensor in order to record different parameters.)
Yes, there is a way to do this and much more. We can use current technology to
monitor and educate all drivers everywhere at all times. We can do this without
invading the privacy or civil liberties of drivers. We can do it at a very small
cost compared with the potentially massive direct and indirect savings.
Black box are amazing devices and there is no doubt that the future scope for
these devices is very bright. In fact leading technology enthusiasts believe that
these devices would be one of the primary safety and monitoring devices that
would be installed inside car in the future. It is understandable that in recent
future these devices will become one of the important aspect behind the safety
of personal vehicles such as car and they will become significant part like they
have become in the safety of aeroplanes.
Some of the functions that would be performed by the car black box are given
below:
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.
4. Wireless communication by transmission of alert message in the event of a
collision along with the time and location co-ordinates through GSM.
5
With the increasing pace of technology, internet applications can be added to
the project for making it faster, more efficient, and cost effective.
2.1.1 DESCRIPTION
The Atmel®AVR®ATmega32 is a low-power CMOS 8-bit microcontroller
based on the AVR enhanced RISC architecture. By executing powerful
instructions in a single clock cycle, the ATmega32 achieves throughputs
approaching 1 MIPS per MHz allowing the system designer to optimize power
consumption versus processing speed.
Features
6
5. Peripheral Features
Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
One 16-bit Timer/Counter with Separate Prescalers, Compare Mode, and
Capture Mode
Real Time Counter with Separate Oscillator
Four PWM Channels
8-channel, 10-bit ADC
8 Single-ended Channels
7 Differential Channels in TQFP Package Only
2 Differential Channels with Programmable Gain at 1x, 10x, or
200x
Byte-oriented Two-wire Serial Interface
Programmable Serial USART
Master/Slave SPI Serial Interface
Programmable Watchdog Timer with Separate On-chip Oscillator
On-chip analog Comparator
6. Special Microcontroller Features
Power-on Reset and Programmable Brown-out Detection
Internal Calibrated RC Oscillator
External and Internal Interrupt Sources
Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-
down, Standby and Extended Standby
7. I/O and Packages
32 Programmable I/O Lines
40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF
8. Operating Voltages
2.7V - 5.5V for ATmega32L
4.5V - 5.5V for ATmega32
9. Speed Grades
0 - 8MHz for ATmega32L
0 - 16MHz for ATmega32
10. Power Consumption at 1MHz, 3V, 25°C
Active: 1.1mA
Idle Mode: 0.35mA
Power-down Mode: < 1μA
7
The Atmel®AVR®AVR core combines a rich instruction set with 32 general
purpose working registers. All the 32 registers are directly connected to the
Arithmetic Logic Unit (ALU), allowing two independent registers to be
accessed in one single instruction executed in one clock cycle. The resulting
architecture is more code efficient while achieving throughputs up to ten times
faster than conventional CISC microcontrollers.
8
The Atmel AVR ATmega32 is supported with a full suite of program and
system development tools including: C compilers, macro assemblers, program
debugger/simulators, in-circuit emulators, and evaluation kits.
9
2.1.3 PIN DESCRIPTIONS:
VCC - Digital supply voltage.
GND - Ground.
Port A (PA7..PA0) - Port A serves as the analog inputs to the A/D Converter.
Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not
used. Port pins can provide internal pull-up resistors (selected for each bit). The
Port A output buffers have symmetrical drive characteristics with both high sink
and source capability. When pins PA0 to PA7 are used as inputs and are
externally pulled low, they will source current if the internal pull-up resistors
are activated. The Port A pins are tri-stated when a reset condition becomes
active, even if the clock is not running.
10
Port B (PB7..PB0) - Port B is an 8-bit bi-directional I/O port with internal pull-
up resistors (selected for each bit). The Port B output buffers have symmetrical
drive characteristics with both high sink and source capability. As inputs, Port B
pins that are externally pulled low will source current if the pull-up resistors are
activated. The Port B pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
Port C (PC7..PC0) - Port C is an 8-bit bi-directional I/O port with internal pull-
up resistors (selected for each bit). The Port C output buffers have symmetrical
drive characteristics with both high sink and source capability. As inputs, Port C
pins that are externally pulled low will source current if the pull-up resistors are
activated. The Port C pins are tri-stated when a reset condition becomes active,
even if the clock is not running. If the JTAG interface is enabled, the pull-up
resistors on pins PC5 (TDI), PC3 (TMS) and PC2(TCK) will be activated even
if a reset occurs. The TD0 pin is tri-stated unless TAP states that shift out data
are entered.
Port D (PD7..PD0) - Port D is an 8-bit bi-directional I/O port with internal pull-
up resistors (selected for each bit). The Port D output buffers have symmetrical
drive characteristics with both high sink and source capability. As inputs, Port D
pins that are externally pulled low will source current if the pull-up resistors are
activated. The Port D pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
RESET - Reset Input. A low level on this pin for longer than the minimum
pulse length will generate a reset, even if the clock is not running. Shorter
pulses are not guaranteed to generate a reset.
XTAL1 - Input to the inverting Oscillator amplifier and input to the internal
clock operating circuit.
AVCC - AVCC is the supply voltage pin for Port A and the A/D Converter. It
should be externally connected to VCC, even if the ADC is not used. If the
ADC is used, it should be connected to VCC through a low-pass filter.
AREF - AREF is the analog reference pin for the A/D Converter.
11
2.1.4 BLOCK DIAGRAM
12
2.1.5 MEMORY ORGANIZATION
The five different addressing modes for the data memory cover: Direct, Indirect
with Displacement, Indirect, Indirect with Pre-decrement, and Indirect with
Post-increment. In the Register File, registers R26 to R31 feature the indirect
Addressing Pointer Registers.
The Indirect with Displacement mode reaches 63 address locations from the
base address given by the Y- or Z-register. When using register indirect
addressing modes with automatic pre-decrement and post-increment, the
address registers X, Y, and Z are decremented or incremented.
The 32 general purpose working registers, 64 I/O Registers, and the 2048 bytes
of internal data SRAM in the ATmega32 are all accessible through all these
addressing modes.
13
2.1.6 INTERRUPTS
14
2.2 SENSORS
DESCRIPTION:
The device is used with single power supplies, or with plus and minus supplies.
As the LM35 device draws only 60 µA from the supply, it has very low self-
heating of less than 0.1°C in still air. The LM35 device is rated to operate over a
−55°C to 150°C temperature range, while the LM35C device is rated for a
−40°C to 110°C range (−10° with improved accuracy).
15
The LM35-series devices are available packaged in hermetic TO transistor
packages, while the LM35C, LM35CA, and LM35D devices are available in the
plastic TO-92 transistor package. The LM35D device is available in an 8-lead
surface-mount small-outline package and a plastic TO-220 package
FEATURES:
PINS:
PIN 1 – 4-20V SUPPLY.
PIN 2 – OUTPUT.
PIN 3 – GROUND.
16
2.2.2 ULTRASONIC SENSOR (HC-SR04)
DESCRIPTION:
17
FEATURES:
Power Supply :+5V DC
Quiescent Current : <2mA
Working Current: 15mA
Effectual Angle: <15°
Ranging Distance : 2cm – 400 cm/1″ – 13ft
Resolution : 0.3 cm
Measuring Angle: 30 degree
Trigger Input Pulse width: 10uS
Dimension: 45mm x 20mm x 15mm
Echo Output Signal Input TTL lever signal and the range in proportion
PINS:
VCC: +5VDC
Trig : Trigger (INPUT)
Echo: Echo (OUTPUT)
GND: GND
18
DESCRIPTION:
Gas Sensor (MQ5) module is useful for gas leakage detection (in home and
industry). It is suitable for detecting H2, LPG, CH4, CO, ALCOHOL. Due to its
high sensitivity and fast response time, measurements can be taken as soon as
possible. The sensitivity of the sensor can be adjusted by using the
potentiometer.
FEATURES:
SPECIFICATIONS:
19
2.2.4 INFRARED SENSOR
INTRODUCTION:
The wavelengths of these regions and their applications are shown below.
The frequency range of infrared is higher than microwave and lesser than
visible light.
For optical sensing and optical communication, photo optics technologies are
used in the near infrared region as the light is less complex than RF when
implemented as a source of signal. Optical wireless communication is done with
IR data transmission for short range applications.
20
An infrared sensor emits and/or detects infrared radiation to sense its
surroundings.
Planck’s law states that “every object emits radiation at a temperature not equal
to 00K”. Stephen – Boltzmann law states that “at all wavelengths, the total
energy emitted by a black body is proportional to the fourth power of the
absolute temperature”. According to Wien’s Displacement law, “the radiation
curve of a black body for different temperatures will reach its peak at a
wavelength inversely proportional to the temperature”.
There are five basic elements used in a typical infrared detection system: an
infrared source, a transmission medium, optical component, infrared detectors
or receivers and signal processing. Infrared lasers and Infrared LED’s of
specific wavelength can be used as infrared sources. The three main types of
media used for infrared transmission are vacuum, atmosphere and optical fibers.
Optical components are used to focus the infrared radiation or to limit the
spectral response. Optical lenses made of Quartz, Germanium and Silicon are
used to focus the infrared radiation. Infrared receivers can be photodiodes,
phototransistors etc. some important specifications of infrared receivers are
photosensitivity, detectivity and noise equivalent power. Signal processing is
done by amplifiers as the output of infrared detector is very small.
TYPES OF IR SENSORS:
Infrared sensors can be passive or active. Passive infrared sensors are basically
Infrared detectors. Passive infrared sensors do not use any infrared source and
detects energy emitted by obstacles in the field of view. They are of two types:
quantum and thermal. Thermal infrared sensors use infrared energy as the
source of heat and are independent of wavelength. Thermocouples, pyroelectric
detectors and bolometers are the common types of thermal infrared detectors.
Quantum type infrared detectors offer higher detection performance and are
faster than thermal type infrared detectors. The photosensitivity of quantum
type detectors is wavelength dependent. Quantum type detectors are further
classified into two types: intrinsic and extrinsic types. Intrinsic type quantum
detectors are photoconductive cells and photovoltaic cells.
21
Active infrared sensors consist of two elements: infrared source and infrared
detector. Infrared sources include an LED or infrared laser diode. Infrared
detectors include photodiodes or phototransistors. The energy emitted by the
infrared source is reflected by an object and falls on the infrared detector.
INFRARED TRANSMITTER:
22
There are different types of infrared transmitters depending on their
wavelengths, output power and response time.
23
INFRARED RECEIVERS:
Infrared receivers are also called as infrared sensors as they detect the radiation
from an IR transmitter. IR receivers come in the form of photodiodes and
phototransistors. Infrared Photodiodes are different from normal photo diodes as
they detect only infrared radiation. The picture of a typical IR receiver or a
photodiode is shown below.
24
It consists of an IR phototransistor, a diode, a MOSFET, a potentiometer and an
LED. When the phototransistor receives any infrared radiation, current flows
through it and MOSFET turns on. This in turn lights up the LED which acts as a
load. The potentiometer is used to control the sensitivity of the phototransistor.
PRINCIPLE OF WORKING:
When the IR transmitter emits radiation, it reaches the object and some of the
radiation reflects back to the IR receiver. Based on the intensity of the reception
by the IR receiver, the output of the sensor is defined.
25
2.3 DC MOTOR:
2.3.1 DESCRIPTION
In normal motoring mode, most electric motors operate through the interaction
between an electric motor’s magnetic field and winding currents to generate
force within the motor. In certain applications, such as the transportation
industry with traction motors, electric motor can operate in both motoring and
generating or braking modes to also produce electrical energy from mechanical
energy.
26
or rectifiers, or by alternating current (AC) sources, such as from the power
grid, inverters or generators. Small motors may be found in electric watches.
General purpose motors with highly standardized dimensions and characteristics
provide convenient mechanical power for industrial use. The largest of electric
motors are used for ship propulsion, pipeline compression and pumped storage
application with rating reaching 100 MWatts. Electric motors may be classified
by electric power source type, internal construction, application, type of motion
output and so on.
Electric motors are used to produce linear and rotary force (torque), and should
be distinguished from devices such as magnetic solenoids and loudspeakers that
convert electricity into motion but do not generate usable mechanical powers,
which are respectively referred to as actuators and transducers.
2.4 TRANSFORMER
2.4.1 DESCRIPTION
27
Figure 15- Step-Down Transformer
The transformer has primary and secondary windings. The core laminations are
joined in the form of strips in between the strips you can see that there are some
narrow gaps right through the cross-section of the core. These staggered joints
are said to be ‘imbricated’. Both the coils have high mutual inductance. A
mutual electro-motive force is induced in the transformer from the alternating
flux that is set up in the laminated core, due to the coil that is connected to a
source of alternating voltage. Most of the alternating flux developed by this coil
is linked with the other coil and thus produces the mutual induced electro-
motive force. The so produced electro-motive force can be explained with the
help of Faraday’s laws of Electromagnetic Induction as
e=M*dI/dt
28
If the second coil circuit is closed, a current flows in it and thus electrical
energy is transferred magnetically from the first to the second coil.
The alternating current supply is given to the first coil and hence it can be called
as the primary winding. The energy is drawn out from the second coil and thus
can be called as the secondary winding.
29
2.4.3 E.M.F. EQUATION OF A TRANSFORMER
Let,
30
Therefore, r.m.s value of e.m.f/turn = 1.11 X 4f Ømax = 4.44f Ømax
Now, r.m.s value of induced e.m.f in the whole of primary winding
Therefore,
Input VA = output VA
VAIA = VBIB
Or, IB/IA = VA/VB = 1/K
Hence, currents are in the inverse ratio of the (voltage) transformation ratio.
31
2.5 LCD
2.5.1 DESCRIPTION
LCD (Liquid Crystal Display) screen is an electronic display module and find a
wide range of applications. A 16x2 LCD display is very basic module and is
very commonly used in various devices and circuits. These modules are
preferred over seven segments and other multi segment LEDs. The reasons
being: LCDs are economical; easily programmable; have no limitation of
displaying special & even custom characters (unlike in seven segments),
animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such
lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has
two registers, namely, Command and Data.
The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like initializing
it, clearing its screen, setting the cursor position, controlling display etc. The
data register stores the data to be displayed on the LCD. The data is the ASCII
value of the character to be displayed on the LCD. Click to learn more about
internal structure of a LCD.
32
PIN DIAGRAM:
33
2.6 LM741 OPERATIONAL AMPLIFIER
DESCRIPTION:
The amplifiers offer many features which make their application nearly fool
proof: overload protection on the input and output, no latch-up when the
common-mode range is exceeded, as well as freedom from oscillations.
The LM741C is identical to the LM741 and LM741A except that the LM741C
has their performance ensured over a 0°C to +70°C temperature range, instead
of −55°C to +125°C.
FEATURES:
34
Overload Protection on the Input and Output
No Latch-Up When the Common-Mode Range is exceeded.
The circuit starts by the base receiving a small current from the 220k resistor.
This produces a small magnetic flux in the inductor and after a very short period
of time the current does not increase. This causes the magnetic flux to collapse
35
and produce a voltage in the opposite direction that is higher than the applied
voltage.
3 wires are soldered to pieces of metal on the top and bottom sides of a ceramic
substrate that expands sideways when it sees a voltage. The voltage on the top
surface is passed to the small electrode and this positive voltage is passed to the
base to turn the transistor ON again. This time it is turned ON more and
eventually the transistor is fully turned ON and the current through the inductor
is not an INCREASING CURRENT but a STATIONARY CURRENT and once
again the magnetic flux collapses and produces a very high voltage in the
opposite direction. This voltage is passed to the piezo diaphragm and causes the
electrode to "Dish" and produce the characteristic sound. At the same time a
small amount is "picked-off" and sent to the transistor to create the next cycle.
PIN DESCRIPTION:
36
2. Ground(0V) Ground
3. Regulated output; 5V Output
PIN DIAGRAM:
37
A relay is an electrically operated switch. Many relays use an electromagnet to
mechanically operate a switch, but other operating principles are also used, such
as solid-state relays. Relays are used where it is necessary to control a circuit by
a low-power signal (with complete electrical isolation between control and
controlled circuits), or where several circuits must be controlled by one signal.
The first relays were used in long distance telegraph circuits as amplifiers: they
repeated the signal coming in from one circuit and re-transmitted it on another
circuit. Relays were used extensively in telephone exchanges and early
computers to perform logical operations.
POTENTIOMETER:
38
BATTERIES:
The nine-volt battery, or 9-volt battery, in its most common form was
introduced for the early transistor radios. It has a rectangular prism shape with
rounded edges and a polarized snap connector at the top. This type is commonly
used in walkie-talkies, clocks and smoke detectors. They are also used as
backup power to keep the time in certain electronic clocks. This format is
commonly available in primary carbon-zinc and alkaline chemistry, in primary
lithium iron di-sulfide, and in rechargeable form in nickel-cadmium, nickel-
metal hydride and lithium-ion.
39
3. PROJECT IMPLEMENTATION
INTRODUCTION TO BASCOM-AVR:
BASCOM-AVR is the original Windows BASIC COMPILER for
the AVR family. It is designed to run on XP/VISTA/WIN7 and WIN8
KEY BENEFITS:
40
Many supported programmer like STK500, STK600, MKII, USBASP,
JTAG , Arduino.
Editor with statement highlighting.
41
3.3 SIMULATION IN PROTEUS:
4. The other two parameters which are alcohol concentration and temperature
can be varied and we can see the changes in the graph on the digital
oscilloscope.
42
GRAPH OF VARYING TEMPERATURE PARAMETER ON DIGITAL
OSCILLOSCOPE IS GIVEN BELOW:
TEMPERATURE INCREASING:
TEMPERATURE DECREASING:
43
GRAPH OF VARYING ALCOHOL CONCETRATION PARAMETER,
FIXED DISTANCE PULSE, FIXED SPEED PULSE ON DIGITAL
OSCILLOSCOPE:
44
3.4 WORKING PRINCIPLE
The aim of the project is to develop a device called Black Box which can record
various parameters in car such as engine temperature, speed etc. Apart from that
features for collision avoidance are also added like alcohol sensor which won’t
allow the driver to drive a car if alcohol is detected on the driver’s seat.
Apart from the function of event data recording, system also has collision
avoidance features which is vehicle to vehicle collision avoidance unit. In this
unit we have two sensors which are ultrasonic sensor and gas sensor. Ultrasonic
sensor will continuously monitor the distance between its nearby vehicles and
will alert the driver by buzzer if the driver is in close proximity of another
vehicle or any other object. The gas sensor will sense the alcohol concentration
in the proximity of driver seat. If the alcohol is detected the system will shut
down the motor (engine), thus the driver will unable to drive car under the
influence of alcohol, this will help to stop any unfortunate collision which was
earlier bound to happen. This is vehicle to vehicle collision avoidance unit. The
system Black Box consist of above two units.
45
4. CONCLUSION
This project has presented a new vision for the vehicles industry, which is the
Black Box with Collision Avoidance System used for vehicles. We have
successfully implemented the idea through embedded system which gave good
results and expected functioning. A full and detailed description was made for
every part of this system. This project has also offered a user friendly embedded
program to analyse the data of the accident.
This Black Box system built can be implemented in any vehicle. As soon as the
driver starts the car, this system will also start and begin to collect the data from
all the sensors and stores in EEPROM. This Black Box system is also cheap and
highly efficient.
The data can be retrieved as required with great ease. The initial testing was
done with Proteus design Suite on PC instead of an actual hardware for
simplicity on trial purposes and later on the actual platform.
46
5. FUTURE ENHANCEMENTS
Use of GPS module with this system will be helpful in finding the accident
location and take quick rescue operations. We can enhance the present system
to check other parameters like fuel level, tyre pressure and working of
headlights before starting the vehicle .Many other critical parameters can be
read and stored in the memory.
Another useful add-on to the present system could be cameras on front and
backsides which keep recording live images and storing them in memory. This
video data would be much useful for accident investigation.
47
6. APPENDIX (CODE)
$regfile = "m32def.dat"
$crystal = 8000000
Portd.5 = 1
Portd.3 = 0
Portd.4 = 0
Portb = 255
Portd.7 = 0
Dim Distance As Word , W As Word , I As Byte
Dim A As Integer
Dim B As Word
Dim C As Word
Dim D As Word
Dim Addr1 As Word
Dim Addr2 As Word
Dim Addr3 As Word
Dim Addr4 As Word
Dim Addr5 As Word
Dim Addr6 As Word
Addr1 = 1
Addr2 = 3
Addr3 = 5
Addr4 = 7
Addr5 = 9
Addr6 = 11
Config Adc = Single , Prescaler = Auto
Config Lcd = 16 * 2
Config Lcdbus = 4
Config Lcdpin = Pin , Db7 = Portc.5 , Db6 = Portc.4 , Db5 = Portc.3 , Db4 =
Portc.2 , E = Portc.1 , Rs = Portc.0
Cursor Off
48
Start Adc
Distance = 0
Enable Interrupts
Cls
Locate 1 , 2
Lcd "Car Black Box"
Wait 1
Do
Pulseout Portd , 4 , 20 'Min. 10us pulse
'Waitms 100 'meant for testing error
Pulsein W , Pind , 3 , 1 'read distance
If Err = 0 Then
W = W * 10 'calculate to
W = W / 58 'centimeters
'W = W / 6 'milimeters
Distance = W
Else
Distance = 0
End If
B = Getadc(0)
B=B/4
Pulsein C , Pind , 5 , 0
D = Getadc(1)
D=D/4
C = C / 1000
Cls
Locate 1 , 1
Lcd "D:" ; Distance ; Chr(99) ; Chr(109) ; "Temp:" ; B
Locate 2 , 1
Lcd "RPM:" ; C ; Chr(32) ; "AL:" ; D
49
Writeeeprom B , Addr3
Writeeeprom C , Addr5
Writeeeprom D , Addr6
Portd.7 = 0
Cls
Locate 1 , 1
Lcd "Dist:" ; A ; Chr(32) ; "Temp:" ; B
Locate 2 , 1
Lcd "RPM:" ; C ; Chr(32) ; "Al:" ; D
Wait 5
End If
50
7. REFERENCES
1. Dae Geun Lee, Se Myoung Jung, Myoung Seob Lim, ―System on Chip
design of Embedded Controller for Car Black Box‖, Intelligent Vehicles
Symposium IEEE, Istanbul, 13-15 June 2007, pp 1174-1177, Print ISBN
: 1-4244-1067-3, DOI : 10.1109/IVS.2007.4290277.
6. Dheeraj Pawar, Pushpak Poddar, ―Car Black Box with Speed Control in
Desired Areas for Collision Avoidance‖, ETASR - Engineering,
Technology & Applied Science Research, 2012, pp 281-284, Vol. 2.
8. www.stackoverflow.com
9. www.engineersgarage.com
10. http://en.wikipedia.org
11. www.atmel.com
─────────────────────
51