Вы находитесь на странице: 1из 45

CAR BLACK BOX

PROJECT REPORT

SUBMITTED BY

ADHIL P P (GCAOEAE002)
ALAKA K (GCAOEAE003)
BILAL Y (GCAOEAE015)
PREJITH R (GCAOEAE036)
RESHMA RAJ D (GCAOEAE039)

GUIDED BY,

DR. MEENAKSHI K
Assistant Professor

Department Of Applied ElectronicsAnd InstrumentationEngineering

GOVERNMENT ENGINEERING COLLEGE, KOZHIKODE

MARCH - 2018
CERTIFICATE

GOVERNMENT ENGINEERING
COLLEGE
KOZHIKODE

Department of Applied Electronics &Instrumentation


Engineering
This is to certify that this is the bonafide record of project titled “CAR
BLACKBOX” done by ADHIL P P(GCAOEAE002), ALAKA K(GCAOEAE003),
BILAL Y(GCAOEAE015), PREJITH R (GCAOEAE036),, RESHMA RAJ D
(GCAOEAE039) during the academic year 2017
2017-2018 for partial fulfillment
fulfil of
requirement
ent for award of degree of bachelor of technology, AE & I Engineering of
University of Calicut.

Guided by Project Coordinator Head of the department

Dr.Meenakshy K Dr. Agnes Jacob Dr.Celine Mary Stuart

Assistant Professor Associate Professor Associate professor


Dept. Of AEI Dept. Of AEI Dept. Of AEI

Place:
Date:
Car black box

ACKNOWLEDGEMENT

At the outset we would like to express our sincere gratitude to God Almighty for his
abundant grace and guidance without which this project would not have been
successfully completed. We would like to thank Prof. Dr. Celine Mary Stuart (Head
of Department, Dept. of AE&I) for her encouragement. Our earnest thanks to our
project coordinators Dr.Agnes Jacob(Associate Professor, Dept. of AE&I) and
Prof.Sreeraj S (Assistant Professor, Dept. of AE&I) for their timely advice and
support that give us confidence to complete the project successfully. Our earnest
thanks to our project guide Dr.Meenakshy K (Assistant Professor, Dept. of AE&I)
for her timely advice and support that give us confidence to complete this venture
successfully. Our sincere thanks to all other faculties of Applied Electronics and
Instrumentation Department, for their co-operation and guidance. We convey our
honest gratitude and thanks to all our classmates and friends for being at hand when
needed them the most.

I
Car black box

ABSTRACT

Car black box is a device to record driving history which can be used for car forensics
in case of car accident or related crimes. It records driving data, visual data, collision
data before the accident so that it can be used to analyze the accident easily and to
settle many disputes related to car accidents such as crash litigation and insurance
settlement. It can be used to not only reconstruct what happened before an accident by
Insurance agents and police but improve vehicle design, roadway design and
emergency medical service by automakers, government and hospital. It consists of
data collection devices for collecting the information about car’s status and driver’s
action, a non-volatile memory device for recording, a microprocessor for controlling
the unit. When two cars collide, the sensor detects an accident and stores information
regarding the car's speed, whether the seatbelts are fastened, the status of indicators
and headlights and whether the driver was drunk or not. The number plate of the
nearby vehicle is extracted from the captured images when accident was detected and
the data is stored.

II
Car black box

CONTENTS

ACKNOWLEDGEMENT i

ABSTRACT ii
LIST OF FIGURES iv

CHAPTER 1
1.1 INTRODUCTION 1
1.2 PROJECT MOTIVATION 2
1.3 PROBLEM STATEMENT 2
1.4 PROJECT OBJECTIVES 2
CHAPTER 2
2.1 LITERARY SURVEY 3
CHAPTER 3
3.1 INTRODUCTION 5
3.2 PROPOSED SYSTEM 5
3.3 RASPBERRY PI 3 5
3.4 BLOCK DIAGRAM 7
3.5 HARDWARE DETAILS 9
3.6 SOFTWARE REQUIREMENTS 19
3.7 FLOW CHART 21
CHAPTER 4
CONCLUSION 26
REFERENCES 27
APPENDIX 28

III
Car black box

LIST OF FIGURES

1. POWER 6
2. USB CONNECTOR 6
3. RASPBERRY PI 10
4. ARDUINO 11
5. HALL SENSOR 13
6. LM 35 15
7. MQ3 17
8. ULTRASONIC SENSOR 18
9. WEB CAMERA 19

IV
Car black box

CHAPTER 1
INTRODUCTION

1.1 INTRODUCTION

The term black box refers to collection of several different recording devices used in
transportation: the flight recorders (flight data recorder and cockpit voice recorder) in
aircraft, the event recorder in railway diesel locomotives, the event data recorder in
automobiles and the voyage data recorder in ships. If an airplane crash, there are
many unanswered questions as to what brought the plane down. Investigators turn to
the plane’s flight data recorder (FDR) and cockpit voice recorder (CVR) also known
as “BLACK BOXES” for answers.

Like Black Box of airplane, Car Black Box (known as Event Data Recorder) is used
to record information related to accidents. Car black box is a device to record driving
history which can be used for car forensics in case of car accident or related crimes. It
records driving data, visual data, collision data before the accident so that it can be
used to analyze the accident easily and to settle many disputes related to car accidents
such as crash litigation and insurance settlement.

It can be used to not only reconstruct what happened before an accident by Insurance
agents and police but improve vehicle design, roadway design and emergency medical
service by automakers, government and hospital. It consists of data collection devices
for collecting the information about car’s status and driver’s action, a non-volatile
memory device for recording, a microprocessor for controlling the unit.

When two cars collide, the sensor detects an accident and stores information
regarding the car's speed, whether the seat belts are fastened, the status of indicators
and headlights and whether the driver was drunk or not. The number plate of the
nearby vehicle is extracted from the captured images when accident was detected and
the data is stored.

Car black boxes are also ideal solution for young drivers below the age of 25 who are
at increased risk of getting involved into an accident. This small device that is
installed in the vehicle records several key actions that have been made by the driver

Dept. Of AEI ,GEC Kozhikode 1


Car black box

before the collision including the speed of engine, accelerating, braking, turning, etc.
which typically reveals enough information. Also, with a car black box that includes a
camera, there will be no longer any word against the police while insurance claims
will be approved a lot faster.

1.2 PROJECT MOTIVATION


i. Car Black Boxes seem quite logical feature in vehicles considering that more people
die in car accidents than in airplane crashes.

ii. The causes of car accidents are not that difficult to investigate as plane crashes but
there are cases that are very difficult to solve due to contradictory stories of the
drivers or/and absence of witnesses of the accident. And in these cases, a car black
box can be crucial piece of evidence for the investigators as well as the insurance
companies.

1.3 PROBLEM STATEMENT


i. It is possible to incorporate BLACK BOXES monitoring devices into motorcycles,
as well as in buses, Lorries and cars.

ii. The various sensors are controlled using the microcontroller ATmega 328.

iii. The processing of data is done by Raspberry pi.

1.4 PROJECT OBJECTIVES


The objectives of this project are:

 To design a Black Box, which will keep a record of the events that took place
just before the accident.
 To save the collected data for a predetermined time for verification.

Dept. Of AEI ,GEC Kozhikode 2


Car black box

CHAPTER 2

LITERATURE SURVEY

2.1 LITERARY SURVEY


Just like black boxes in aircrafts help determine the cause of an airplane accident, car
black boxes help determine what has caused a car accident and the events that led to
collision. They are particularly valuable when no witnesses are present at the scene of
the accident and when each driver has his/her own version of the events. The benefits
of car black boxes for reconstruction of the events before accident are also
emphasized by accident investigators, the police and increasing number of insurance
companies which now have a powerful tool to determine whether the claim is justified
or not. The benefits of a car black box outweigh the drawbacks in virtually all aspects.

This small device that is installed in the vehicle, under the seat, behind the dashboard
or even better on the windshield records several key actions that have been made by
the driver before the collision including the speed of engine, accelerating, braking,
turning, etc. which typically reveals enough information. Also, with a car black box
that includes a camera there will be no longer any word against the police while
insurance claims will be approved a lot faster.

Insurance companies have shown a great interest in widespread use of car black boxes
because the data obtained from the device reveal a great deal about the drivers. In fact,
some insurance companies have even offered a discount for drivers who have
installed a car black box because it enables them to evaluate which drivers that are
less likely to get involved into an accident and lower their premiums, while increasing
the rates to risky drivers. This also means that the device can help save money for car
insurance if we drive safely.

In addition to insurance companies and car accident investigators, car black boxes are
also very useful for car rentals because any disputes about car damage can be easily
resolved by reviewing the data from the device. These are typically stored on a secure
digital (SD) card, while all accidents are stored automatically. However, this is good
news for the customers as well because they will no longer be charged for car damage
they have not done.

Dept. Of AEI ,GEC Kozhikode 3


Car black box

Car black boxes are also ideal solution for young drivers below the age of 25 who are
at increased risk of getting involved into an accident. Studies have shown that young
drivers are involved in about 40% of all accidents. With a car black box, parents can
easily monitor their child's driving style and habits over the computer.

Dept. Of AEI ,GEC Kozhikode 4


Car black box

CHAPTER 3
METHODOLGY

3.1 INTRODUCTION
The car black box as a whole is a combination of several modules each provides some
necessary information to be stored. The modules are constructed using suitable
sensors and the sensor readings are interfaced with the processor so as to perform the
necessary action depending on the sensor readings. It also has a camera section to
capture images and extract data from the images.

3.2 PROPOSED SYSTEM


Black box is an Event Data Recorder (EDR) commonly used in airplane for recording
different events as well as parameters inside aircraft. A car black box is the one
implemented in cars and serve the same purpose with minimum features. It contains a
set of sensor.

 Speed sensor
 Temperature sensor
 Gas sensor
 Light status sensor
 Seat belt status sensor
 Webcam

All sensors are interfaced to the processor and the data are recorded to the memory.
RTC module is used to keep track of time and date of the events. Cameras placed at
different positions of the vehicle are used to capture pictures. When collision occurs
previous images are processed to localize the number plate. The data is stored in the
raspberry pi.The datas are real time monitored and saved as a txt file.

3.3 RASPBERRY PI 3
Latest version of the Raspberry Pi computer. The Pi isn't like the typical machine, in
its cheapest form it doesn't have a case, and is simply a credit-card sized electronic

Dept. Of AEI ,GEC Kozhikode 5


Car black box

board -- of the type you might find inside a PC or laptop but much smaller.It Runs at
1.2 GHz, has an upgraded power system, four USB ports and extendable 'naked
board' design.It comes with on-board wireless LAN and Bluetooth, 50 percent more
processing power, and a Quad Core 64bit processor.

3.3.1 POWER

The Raspberry pi 3 uses a micro USB power connector, as used by most modern
smart phones.The PSU (Power supply Unit) must supply 5V and at least 700mA (0.7
A). Most plug in PSUs will be marked with their rating.

Fig 1 Power

3.3.2 DISPLAY

Your display will depend on what you have available to you. Most digital TVs will
have an HDMI connection and newer LCD monitors will often have DVI connections
(you will need to use an HDMI to DVI adaptor).

Fig 2 USB Connector


Car black box

3.4 BLOCK DIAGRAM


Car black box

3.4.1 BLOCK DIAGRAM EXPLANATION

The each block has some particular information to be provided to the BBB for
creating the database with the essential information and provide the same to the
authorized user.

Speed measurement

It is done by using Hall Effect sensor. To measure speed (e.g. the angular speed of a
turning shaft) a magnet is attached to the shaft, and then the sensor is placed near this
moving magnet. The sensor produces a pulse, each time the magnet comes near it,
once every revolution of the shaft. The pulses are fed to some sort of counter, and the
number of pulses in a specific time interval is counted.

Temperature sensor

It is used to measure the temperature inside the engine. It helps to find the engine
damage if any.

Seat belt status sensor

It indicates whether seat belts are fastened. This is ensured by checking if the button
connected is pressed or not.

Light status checking sensor

The status of indicators can be checked using a three way switch with each position
corresponding to the three required status of head light viz bright, dim, dark.

Alcohol sensor

It is used to know whether the driver was drunk or not.

Web cam

Camera is used to capture pictures. When collision occurs previous images are
processed to localize the number plate.

Raspberry pi

In the proposed system Raspberry pi is the heart of the system. It works on an


installed operating system. It is the central controlling unit and co-ordinates the
activities of all other units in the system. With highly advanced features available and
ease of interfacing peripherals, this board is the most important unit in the system and

Dept. Of AEI ,GEC Kozhikode 8


Car black box

generates the necessary controls to manage the working of the user interface as well
as the flow control and database management mechanisms.

Arduino

It is a microcontroller is a small computer on a single integrated circuit containing a


processor core, memory and programmable input/output peripherals. At mega 328P is
high-performance, low power Atmel 8-bit AVR RISC based microcontroller.

Power supply

The camera needs no external power supply when connected to the central processor.
The various sensing circuits are powered from the power supply we have designed
which consists of a 9V battery from which the 5V required for the working of the
sensors and ATmega 328P is obtained through a 7805 voltage regulator.

3.5 HARDWARE DETAILS


1. Raspberry pi

2. Arduino

3. Speed sensor(Hall sensor)

4. Temperature sensor(LM35)

5. Seatbelt sensor(switch)

6. Light status sensor(Three way mechanical switch)

7. Gas sensor(MQ3)

8. Ultrasonic sensor

9. Webcam

3.5.1 Raspberry pi

The Raspberry Pi is a series of small single-board computers developed in the United


Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer
science in schools and in developing countries. The original model became far more
popular than anticipated, selling outside its target market for uses such as robotics. It

Dept. Of AEI ,GEC Kozhikode 9


Car black box

does not include peripherals (such as keyboards, mice and cases). However, some
accessories have been included in several official and unofficial bundles.

Performance

The Raspberry Pi 3, with a quad-core ARM Cortex-A53 processor, is described as 10


times the performance of a Raspberry Pi 1. This was suggested to be highly dependent
upon task threading and instruction set use. Benchmarks showed the Raspberry Pi 3 to
be approximately 80% faster than the Raspberry Pi 2 in parallelised tasks.

Raspberry Pi 2 V1.1 included a quad-core Cortex-A7 CPU running at 900 MHz and 1
GB RAM. It was described as 4–6 times more powerful than its predecessor. The
GPU was identical to the original. In parallelised benchmarks, the Raspberry Pi 2
V1.1 could be up to 14 times faster than a Raspberry Pi 1 Model B+.

While operating at 700 MHz by default, the first generation Raspberry Pi provided a
real-world performance roughly equivalent to 0.041 GFLOPS.On the CPU level the
performance is similar to a 300 MHz Pentium II of 1997–99. The GPU provides 1
Gpixel/s or 1.5 Gtexel/s of graphics processing or 24 GFLOPS of general purpose
computing performance. The graphical capabilities of the Raspberry Pi are roughly
equivalent to the performance of the Xbox of 2001.

Fig 3 Raspberry PI
Car black box

3.5.2 ARDUINO

Fig 4 ARDUINO

Arduino is an open-source platform used for building electronics projects. Arduino


consists of both a physical programmable circuit board (often referred to as a
microcontroller) and a piece of software, or IDE (Integrated Development
Environment) that runs on your computer, used to write and upload computer code to
the physical board.

The Arduino platform has become quite popular with people just starting out with
electronics, and for good reason. Unlike most previous programmable circuit boards,
the Arduino does not need a separate piece of hardware (called a programmer) in
order to load new code onto the board – you can simply use a USB cable.
Additionally, the Arduino IDE uses a simplified version of C++, making it easier to
learn to program. Finally, Arduino provides a standard form factor that breaks out the
functions of the micro-controller into a more accessible package.

FEATURES

 It is an easy USB interface. This allows interface with USB as this is like a
serial device.
 The chip on the board plugs straight into your USB port and supports on your
computer as a virtual serial port. The benefit of this setup is that serial
Car black box

communication is an extremely easy protocol which is time-tested and USB


makes connection with modern computers and makes it comfortable.
 It is easy to find the microcontroller brain which is the ATmega328 chip. It
has more number of hardware features like timers, external and internal
interrupts, PWM pins and multiple sleep modes.
 It is an open source design and there is an advantage of being open source is
that it has a large community of people using and troubleshooting it. This
makes it easy to help in debugging projects.
 It is a 16 MHz clock which is fast enough for most applications and does not
speeds up the microcontroller.
 It is very convenient to manage power inside it and it had a feature of built-in
voltage regulation. This can also be powered directly off a USB port without
any external power. You can connect an external power source of upto 12v
and this regulates it to both 5v and 3.3v.
 13 digital pins and 6 analog pins. This sort of pins allows you to connect
hardware to your Arduino Uno board externally. These pins are used as a key
for extending the computing capability of the Arduino Uno into the real world.
Simply plug your electronic devices and sensors into the sockets that
correspond to each of these pins and you are good to go.
 This has an ICSP connector for bypassing the USB port and interfacing the
Arduino directly as a serial device. This port is necessary to re-bootload your
chip if it corrupts and can no longer used to your computer.
 It has a 32 KB of flash memory for storing your code.
 An on-board LED is attached to digital pin 13 to make fast the debugging of
code and to make the debug process easy.
 Finally, it has a button to reset the program on the chip.

3.5.3 SPEED SENSOR (HALL SENSOR)

A Hall Effect sensor is a transducer that varies its output voltage in response to a
magnetic field. Hall Effect sensors are used for proximity switching, positioning,
speed detection, and current sensing applications.

In its simplest form, the sensor operates as an analog transducer, directly returning a
voltage. With a known magnetic field, its distance from the Hall plate can be

Dept. Of AEI ,GEC Kozhikode 12


Car black box

determined. Using groups of sensors, the relative position of the magnet can be
deduced.

Frequently, a Hall sensor is combined with circuitry that allows the device to act in a
digital (on/off) mode, and may be called a switch in this configuration. Commonly
seen in industrial applications such as the pictured pneumatic cylinder, they are also
used in consumer equipment; for example some computer printers use them to detect
missing paper and open covers. When high reliability is required, they are used in
keyboards.

Hall sensors are commonly used to time the speed of wheels and shafts, such as for
internal combustion engine ignition timing, tachometers and anti-lock braking
systems. They are used in brushless DC electric motors to detect the position of the
permanent magnet. In the pictured wheel with two equally spaced magnets, the
voltage from the sensor will peak twice for each revolution. This arrangement is
commonly used to regulate the speed of disk drives.

Fig 5 Hall sensor

Working principle

When a beam of charged particles passes through a magnetic field, forces act on the
particles and the beam is deflected from its straight line path. The beam of charged
particles refers to the electrons flowing through a conductor. When a current carrying
conductor is placed in a magnetic field perpendicular to the path of the electrons, the
electrons are deflected from its straight line path. Therefore, one side of the conductor
Car black box

becomes negative portion and the other side becomes positive one. The transverse
voltage is measured and is known as Hall Voltage.

The charge separation continues until the force on the charged particles from the
electric field balances the force produced by magnetic field. If the current is constant,
then the Hall voltage is a measure of the magnetic flux density. There are two forms
of Hall Effect Sensors. One is linear where the output voltage linearly varies with the
magnetic flux density. The other is known as threshold where there is a sharp drop of
output voltage at a particular magnetic flux density.

When no magnetic field is applied to the current carrying thin semiconductor material
(hall element) the hall voltage(Vh) is zero. When an external magnetic field is applied
to the current carrying hall element perpendicular to the current flow a Lorentz force
acts on the current due to which a voltage called hall voltage(Vh) is generated
perpendicular to both the current and the magnetic field. This voltage is very small (in
uV) and needs amplification.

3.5.4 TEMPERATURE SENSOR (LM35)

The LM35 is an integrated circuit sensor that can be used to measure temperature with
an electrical output proportional to the temperature (in °C).It can measure temperature
more accurately than a using a thermistor. The sensor circuitry is sealed and not
subject to oxidation.The LM35 generates a higher output voltage than thermocouples
Car black box

and may not require that the output voltage be amplified.The LM35 has an output
voltage that is proportional to the Celsius temperature.The scale factor is .01V/°C.

Features

 Calibrated directly in Degree Celsius (Centigrade)


 Linear at 10.0 mV/°C scale factor
 0.5°C accuracy guarantee-able (at a25°C)
 Rated for full -55°C to a 150°C range
 Suitable for remote applications
 Low cost due to wafer-level trimming
 Operates from 4 to 30 volts
 Less than 60 mA current drain
 Low self-heating, 0.08°C instill air
 Non-linearity only 0.25°C typical
 Low impedance output, 0.1Ωfor 1 mA load

Fig 6 LM 35

3.5.5 SEAT BELT STATUS SENSOR (SWITCH)

In electrical engineering, a switch is an electrical component that can break an


electrical circuit, interrupting the current or diverting it from one conductor to another.
The mechanism of a switch may be operated directly by a human operator to control a
circuit (for example, a light switch or a keyboard button), may be operated by a
Car black box

moving object such as a door-operated switch, or may be operated by some sensing


element for pressure, temperature or flow. A relay is a switch that is operated by
electricity. Switches are made to handle a wide range of voltages and currents; very
large switches may be used to isolate high-voltage circuits in electrical substations. If
the driver is wearing the seatbelt then the switch is closed else an open switch shows
the condition.

3.5.6 LIGHT STATUS SENSOR(THREE WAY MECHANICAL SWITCH)

The function of Light status checking is done by a three way mechanical switch.
Accordingly there are three conditions for headlight viz bright, dim and dark. These
status are indicated by the three positions of the switch.

3.5.7 MQ3 GAS SENSOR

This is an alcohol sensor from futurelec, named MQ-3, which detects ethanol in the
air. It is one of the straightforward gas sensors so it works almost the same way with
other gas sensors. It costs $6.90.Typically, it is used as part of the breathanalyzers or
breath testers for the detection of ethanol in the human breath.

it has 6pins, the cover and the body. Even though it has 6 pins, we can use only 4 of
them. Two of them are for the heating system, which are called H and the other 2 are
for connecting power and ground, which are called A and B.

If we look at the inside of the sensor, we will find the little tube. Basically, this tube is
a heating system that is made of aluminum oxide and tin dioxide and inside of it there
are heater coils, which practically produce the heat. And we can also find 6 pins. 2
pins that are called Pin H are connected to the heater coils and the other ones are
connected to the tube.

The core system is the cube. Basically, it is an Alumina tube cover by SnO2, which is
tin dioxide. And between them there is an Aurum electrode. Basically, the alumina
tube and the coils are the heating system. If coil is heated SnO2 ceramics will become
the semi - conductor, so there are more movable electrons, which means that it is
ready to make more current flow.

Then, when the alcohol molecules in the air meet the electrode that is between
alumina and tin dioxide, ethanol burns into acetic acid then more current is produced.

Dept. Of AEI ,GEC Kozhikode 16


Car black box

So the more alcohol molecules there are, the more current we will get. Because of this
current change, we get the different values from the sensor.

Fig 7 MQ3

3.5.8 ULTRASONIC SENSOR

Ultrasonic sensors (also known as transceivers when they both send and receive, but
more generally called transducers) work on a principle similar to radar or sonar,
which evaluate attributes of a target by interpreting the echoes from radio or sound
waves respectively. Active ultrasonic sensors generate high frequency sound waves
and evaluate the echo which is received back by the sensor, measuring the time
interval between sending the signal and receiving the echo to determine the distance
to an object. Passive ultrasonic sensors are basically microphones that detect
ultrasonic noise that is present under certain conditions.

Ultrasonic sensor provides an easy method of distance measurement. This sensor is


perfect for any number of applications that require you to perform measurements
between moving or stationary objects.
Car black box

Fig 8 Ultrasonic Sensor

FEATURES

 Provides precise, non-contact distance measurements within a 2 cm to 3 m


range. Ultrasonic measurements work in any lighting condition, making
this a good choice to supplement infrared object detectors Simple pulse
in/pulse out communication requires just one I/O pin Burst indicator LED
shows measurement in progress
 3-pin header makes it easy to connect to a development board, directly or with
an extension cable, no soldering required.

3.5.9 WEBCAM

Webcam is a video came that feeds or streams its image in real time to or through a
computer to computer network. When "captured" by the computer, the video stream
may be saved, viewed or sent on to other networks via systems such as the internet,
and email as an attachment. When sent to a remote location, the video stream may be
saved, viewed or on sent there. Unlike an IP camera (which connects using Ethernet
or Wi-Fi), a webcam is generally connected by a USB cable, or similar cable, or built
into computer hardware, such as laptops.

The camera used is high resolution Logitech C270 camera. It is made to capture the
image of nearby vehicles and the images are stored for some time and overwritten at a
latter point of time when new images are captured. On occurrence of an accident, the
just before captured images are processed for number plate extraction.
Car black box

Fig 9 Web camera

FEATURES

 1.1 Interpolated 2.0 mega pixel still image resolution


 12-bit
bit intensity dynamic range
 Multi utility camera for use on Monitors, LCDs and Laptops
 Frame rates : 30 frames per second
 Interface :USB 2.0, backward compatible to USB

3.6 SOFTWARE REQUIREMENTS


3.6.1 PYTHON PROGRAMMING LANGUAGE

Python was found to be the optimum choice for programming among


among the various
other languages considered. As it is a widely used general
general-purpose,
purpose, high
high-level
programming language. It is easy to use in GUI applications, database management
and networking.

FEATURES

 Simple: Python is a simple and minimalistic language. Reading a good Python


program feels almost like reading English, although very strict English! This
pseudo-code
code nature of Python isone of its greatest strengths. It allows you to
concentrate on the solution to the problem rather than the language itself.
 Easy
asy to Learn: As you will see, Python is extremely
extremely easy to get started with.
Python has an extraordinarily simple syntax, as already mentioned.

 Free and Open Source : Python is an example of a FLOSS (Free/Libré and


Open Source Software). In simple terms, you can freely distribute copies of
Car black box

this software, read it's source code, make changes to it, use pieces of it in new free
programs, and that you know you can do these things. FLOSS is based on the concept
of a community which shares knowledge. This is one of the reasons why Python is so
good - it has been created and is constantly improved by a community who just want
to see a better Python.
 High-level Language: When you write programs in Python, you never need to
bother about the low-level details such as managing the memory used by your
program, etc.
 Portable: Due to its open-source nature, Python has been ported (i.e. changed
to make it work on) to many platforms. All your Python programs can work
on any of these platforms without requiring any changes at all if you are
careful enough to avoid any system-dependent features. You can use Python
on Linux, Windows, FreeBSD, Macintosh, Solaris, OS/2, Amiga, AROS,
AS/400, BeOS, OS/390, z/OS, Palm OS, QNX, VMS, Psion, Acorn RISC OS,
VxWorks, PlayStation, Sharp Zaurus, Windows CE and even PocketPC !
 Extensible: If you need a critical piece of code to run very fast or want to have
some piece of algorithm not to be open, you can code that part of your
program in C or C++ and then use them from your Python program.
 Embeddable: You can embed Python within your C/C++ programs to give
'scripting' capabilities for your program's users.
 Extensive Libraries: The Python Standard Library is huge indeed. It can help
you do various things involving regular expressions, documentation
generation, unit testing, threading, databases, web browsers, CGI, ftp, email,
XML, XML-RPC, HTML, WAV files, cryptography, GUI (graphical user
interfaces), Tk, and other system-dependent stuff.

3.6.2 ARDUINO PROGRAMMING

The Arduino Integrated Development Environment - or Arduino Software (IDE) -


contains a text editor for writing code, a message area, a text console, a toolbar with
buttons for common functions and a series of menus. It connects to the Arduino and
Genuino hardware to upload programs and communicate with them.Programs written
using Arduino Software (IDE) are called sketches. These sketches are written in the

Dept. Of AEI ,GEC Kozhikode 21


Car black box

text editor and are saved with the file extension .ino. The editor has features for
cutting/pasting and for searching/replacing text. The message area gives feedback
while saving and exporting and also displays errors. The console displays text output
by the Arduino Software (IDE), including complete error messages and other
information. The bottom righthand corner of the window displays the configured
board and serial port. The toolbar buttons allow you to verify and upload programs,
create, open, and save sketches, and open the serial monitor.

3.7 FLOW CHART

SENSOR SIDE FLOWCHART

START

INIINPUT THE VALUE


FROM THE SEATBELT
STATUS SENSOR

IF SENSOR SEAT BELT=”NO”


VALUE>1

SEAT BELT=”YES”

INPUT THE PULSE OUTPUT


FROM THE ULTRASONIC
SENSOR

CALCULATE THE DISTANCE


IN cm

Dept. Of AEI ,GEC Kozhikode 22


Car black box

If
NO ACTION
DISTANCE>
20

“TAKE PHOTO”

INPUT THE VALUE FROM THE

ALCOHOL SENSOR

If SENSOR
“NON ALCOHOLIC”
>>!VALUE>25
0

“ALCOHOLIC”

INPUT THE VALUE FROM THE

HALL SENSOR

Dept. Of AEI ,GEC Kozhikode 22


Car black box

CALCULATE THE SPEED IN km/hr

INPUT THE VALUE FROM THE

TEMPERATURE SENSOR

CALCULATE TEMPERATURE FROM


THE SENSOR VALVE

IINPUT THE VALUE


FROM THE LIGHT
SENSOR

IF
BUTTONSTATE3==1 “OFF”

Dept. Of AEI ,GEC Kozhikode 23


Car black box

IF
“DIM”
BUTTONSTATE1==1

“BRIGHT”

CONCATENATE THE
PROCESSED DATA OF
SENSOR OUTPUTS

SEND THE CONCATENATED


DATA TO RASPBERY

STOP

Dept. Of AEI ,GEC Kozhikode 24


Car black box

Raspberry Pi side

START

IMPORT TIME

IMPORT SERIAL DATA FROM


ARDUINO

If YES
RUN THE
COMMAND TO
TAKE PHOTO
TAKE PHOTO
APPEARS

NO
SAVE THE FILE
AS .jpg

SAVE DATA TO CAR


BLACKBOX

STOP

Dept. Of AEI ,GEC Kozhikode 25


Car black box

CHAPTER 4
CONCLUSION

Black box refers to collection of several different recording devices used in transportation: the
flight recorders (flight data recorder and cockpit voice recorder) in aircraft, the event recorder in
railway diesel locomotives, the event data recorder in automobiles and the voyage data recorder
in ships. Car black box is an Event Data Recorder. When two cars collide, the sensor detects an
accident and stores information regarding the car's speed, whether the seatbelts are fastened, the
status of indicators and headlights and whether the driver was drunk before a collision. The
number plate of the nearby vehicle is extracted from the captured images when accident was
detected and the data is stored.
Just like black boxes in aircrafts help determine the cause of an airplane accident, car black
boxes help determine what has caused a car accident and the events that led to collision. They are
particularly valuable when no witnesses are present at the scene of the accident and when each
driver has his/her own version of the events. The benefits of car black boxes for reconstruction of
the events before accident are also emphasized by accident investigators, the police and
increasing number of insurance companies which now have a powerful tool to determine
whether the claim is justified or not. The benefits of a car black box outweigh the drawbacks in
virtually all aspects. In addition to insurance companies and car accident investigators, car black
boxes are also very useful for car rentals because any disputes about car damage can be easily
resolved by reviewing the data from the device. Car black boxes are also ideal solution for young
drivers below the age of 25 who are at increased risk of getting involved into an accident.
The system proposed can be further expanded in future to accommodate more number of
functionalities. By incorporating GPS module, the location of the vehicle can be traced and using
Google map, they path traversed can be routed. Using GSM module, the black box can be
designed so as to send a message to the authority in case of an accident and with the help for
GPS location of vehicle can also be provided with the alert message.

Dept. Of AEI ,GEC Kozhikode 26


Car black box

REFERENCES

 INDIA,” Vehicle Accident Automatic Detection and Remote Alarm Device”, International
Journal of Reconfigurable and Embedded Systems (IJRES) Vol. 1, No. 2, July 2012, pp.
49~54 ISSN: 2089-4864 _ 49 Journal homepage:
http://iaesjournal.com/online/index.php/IJRES

 Deepak Punetha, Vartika Mehta Electronics Engineering Dept. PEC University of


Technology Chandigarh, India “Design and Realization of the Accelerometer based
Transportation System”, International Journal of Computer Applications (0975 – 8887)
Volume 49– No.15, July 2012 17

 P. Ajay Kumar Reddy ,P.Dileep Kumar , K. Bhaskarreddy, E.Venkataramana ,


M.Chandrasekhar Reddy, “BLACK BOX FOR VEHICLES”International Journal of
Engineering Inventions ISSN: 2278-7461, www.ijeijournal.com Volume 1, Issue
7(October2012) PP: 06-12 ISSN: 2278-7461 www.ijeijournal.com P a g e | 6

 https://learn.adafruit.com/category/raspberry
 http://en.wikipedia.org
 htttp://github.com
 electrical4u.com
 Arduino.forum

Dept. Of AEI ,GEC Kozhikode 27


Car black box

APPENDIX

PROGRAM

//TEMP SENSOR

int VA1;

inttempPin = A1;

//HALL SENSOR

volatile byte half_revolutions;

unsignedint rpm;

unsigned long timeold;

//SEAT BELT

constintbuttonPin = 3; // the number of the pushbutton pin

//ultrasonic

constinttrigPin = 9;

constintechoPin = 10;

// defines variables

long duration;

int distance;

//toggle

constint buttonpin1 = 4; // the number of the pushbutton pin

constint buttonpin2 = 5;

// variables will change:

int buttonstate1 = 0; // variable for reading the pushbutton status

Dept. Of AEI ,GEC Kozhikode 28


Car black box

int buttonstate2 = 0;

//one way

// variables will change:

int state = 0;

//alcohol

constint mq3 = A0;

float value;

int limit;

void setup()

Serial.begin(9600);

//HALL SENSOR

attachInterrupt(0, magnet_detect, RISING); //Initialize the intterrupt pin (Arduino digital pin 2)

half_revolutions = 0;

rpm = 0;

timeold = 0;

//SEAT BELT

pinMode(buttonPin, INPUT);

//ultra

pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output

pinMode(echoPin, INPUT); // Sets the echoPin as an Input

//toggle

pinMode(buttonpin1, INPUT);

Dept. Of AEI ,GEC Kozhikode 29


Car black box

pinMode(buttonpin2, INPUT);

void loop()

//TEMPRATURE SENSOR

VA1 = analogRead(tempPin);

float mv = ( VA1 / 1024.0) * 5000;

floatcel = mv / 10;

Serial.println();

Serial.print("TEMPRATURE = ");

Serial.print(cel);

Serial.print("*C");

delay(1000);

//SEAT BELT

// read the state of the pushbutton value:

state = digitalRead(buttonPin);

// check if the pushbutton is pressed. If it is, the buttonState is HIGH:

if (state == HIGH)

Dept. Of AEI ,GEC Kozhikode 30


Car black box

Serial.print("SEATBELT FASTENED");

else

Serial.print("SEATBELT UNFASTENED");

//HALL SENSOR

if (half_revolutions>= 1)

rpm = 30 * 1000 / (millis() - timeold) * half_revolutions;

timeold = millis();

half_revolutions = 0;

Serial.print(rpm);

//ultra

// Clears the trigPin

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds

duration = pulseIn(echoPin, HIGH);

Dept. Of AEI ,GEC Kozhikode 31


Car black box

// Calculating the distance

distance = duration * 0.034 / 2;

// Prints the distance on the Serial Monitor

Serial.print("Distance: ");

Serial.print(distance);

if (distance <= 20)

Serial.print("Take photo");

//toggle

// read the state of the pushbutton value: buttonstate1= digitalRead(buttonpin1);

buttonstate1 = digitalRead(buttonpin1);

buttonstate2 = digitalRead(buttonpin2);

// check if the pushbutton is pressed. If it is, the buttonState is HIGH:

if (buttonstate1 == HIGH)

Serial.print("off");

else if (buttonstate2 == HIGH)

Serial.print("bright");

else

Serial.println("dim");

Dept. Of AEI ,GEC Kozhikode 32


Car black box

value=analogRead(A0);

Serial.print("alcohol value:");

if (value<150)

Serial.print("safe");

delay(100);

if (value>250)

Serial.print("alcoholic") ;

Serial.print(value);

voidmagnet_detect()//This function is called whenever a magnet/interrupt is detected by the


arduino

half_revolutions++;

Dept. Of AEI ,GEC Kozhikode 33


Car black box

Raspberry Pi side
import serial
import time
import os

ser=serial.Serial("/dev/ttyACM0",9600)
ser.baudrate=9600
while True:
read_ser=ser.readline()
print(read_ser)
f=open('carblackbox.txt','a')
f.write(str(read_ser))
f.close
m=read_ser[0];
if m==84:
os.system('fswebcam /home/pi/webcam/%H%M%S.jpg')

Dept. Of AEI ,GEC Kozhikode 34


Car black box

DATASHEETS

Dept. Of AEI ,GEC Kozhikode 35


Car black box

Dept. Of AEI ,GEC Kozhikode 36


Car black box

Dept. Of AEI ,GEC Kozhikode 37


Car black box

Dept. Of AEI ,GEC Kozhikode 38


Car black box

Dept. Of AEI ,GEC Kozhikode 39

Вам также может понравиться