Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 25

PROJECT REPORT

ON
“DEVELOPMENT OF ADVANCED
EMBEDDED SYSTEM FOR ACCIDENT
AVOIDANCE SYSTEM”

HYDERABAD
TH
(28 MAY 2018 TO 27TH JUNE 2018)

INDIAN INSTITUTE OF TECHNOLOGY (ISM),


DHANBAD, JHARKHAND
SUBMITTED BY:
Siddharth Singh
16JE001954
Dept. of Electrical Engineering
ACKNOWLEDGEMENT

“An engineer with theoretical knowledge is not a complete engineer.


Practical knowledge is very important for an engineer to develop and apply
engineering skills”.

It gives me a great pleasure to have an opportunity to acknowledge and to


express gratitude to those who were associated with my training at Electronics
Corporation of India Ltd, Hyderabad.

Summer training at ECIL-Hyderabad has been an invaluable and enriching


experience for me. During this training I have learnt to apply my theoretical
concepts in practical field. For this I am quite thankful to all people with whom
I got opportunity to interact.

First of all, I express my sincere thanks and gratitude to Computer Education


Division of ECIL for giving me an opportunity to do my Industrial Training in
this prestigious organization.

Special thanks to Ms. Monica who guided me & my discussion with her was
truly enlightening. I would again like to express my sincere thanks to all project
guides for their constant friendly guidance during the entire stretch of this
report. Every new step I took was due to their persistent enthusiastic
cooperation, generosity and superb guidance and I acknowledge this with a
deep sense of gratitude.

I would also like to thank all employees for their friendly and warm attitude,
which helped me in completing the project successfully.
ABSTRACT

Now a days, due to heavy population of vehicles, the drivers are not able to
instantly control the vehicles, when other vehicles or pedestrian come across
suddenly. This may lead to accident, which can also turn to be fatal. The
proposed work aims at designing a system which automatically detects the
presence of any obstacle near the vehicle by using ultrasonic sensors and take
necessary actions. This can prevent human life and also control the traffic
collision efficiently.
PREFACE

Designing an embedded system, requires an appreciation of multidisciplinary


concept and in-depth knowledge or scientific analytical tools, geared to the
solution of real-life problems. No doubt every real situation is unique but a set
of theoretical tools of knowledge can help in developing the mechanism for
handling such situation.

To acquaint me with such challenging situation, I was allowed to go to


CED under ECIL, Hyderabad. The training period was of 1 month which was
too short to find out an efficient feasible solution to the problem of accident
avoidance system, so I have tried my best to collect all relevant data and studied
the details of embedded system prototypes designed and produced at ECIL.

I whole heartedly appreciate the atmosphere provided to me by the staff


of Embedded Systems Department of Computer Education Division. The data
has been collected at primary source through discussions with officers of
different sections. For this nice gesture on their part, I shall ever remain obliged
to them.
Electronics Corporation of India Limited (ECIL)  
ECIL was setup under the Department of Atomic Energy on 11th April, 1967
with a view to generate a strong indigenous capability in the field of
professional grade electronics. The initial accent was on total self-reliance
and ECIL was engaged in the Design, Development, Manufacture and
Marketing of several products with emphasis on three technology lines viz.
Computers, Control Systems and Communications.
Over the years, ECIL pioneered the development of various complex electronic
products without any external technological help and scored several 'firsts' in
these  fields prominent among them being country's

 First Digital Computer


 First Solid-State TV
 First Control & Instrumentation for Nuclear Power Plants
 First Earth Station Antenna
 First Computerized Operator Information System
 First Radiation Monitoring & Detection Systems
 First Automatic Message Switching Systems
 First Operation & Maintenance Centre For E-108 Exchange
 First Programmable Logic Controller
 First Solid-State Cockpit Voice Recorder
 First Electronic Voting Machines

The company played a very significant role in the training and growth of high
calibre technical and managerial manpower especially in the fields
of Computers and Information Technology. Though the initial thrust  was on
meeting the Control & Instrumentation requirements of the Nuclear Power
Program, the expanded scope of self-reliance pursued by ECIL enabled the
company to develop various products to cater to the needs of  Defence, Civil
Aviation, Information & Broadcasting, Telecommunications, Insurance,
Banking, Police, and Para-Military Forces, Oil & Gas, Power, Space Education,
Health, Agriculture, Steel and Coal sectors and various user departments in the
Government domain. ECIL thus evolved as a multi-product company serving
multiple sectors of Indian economy with emphasis on import of country
substitution and development of products & services that are of economic and
strategic significance to the country.

Vision:
To contribute to the country in achieving self-reliance in strategic electronics.

Mission:
ECIL's mission is to consolidate its status as a valued national asset in the area
of strategic electronics with specific focus on Atomic Energy, Defence,
Security and such critical sectors of strategic national importance.

Objectives:
 To continue services to the country's needs for the peaceful uses Atomic
Energy. Special and Strategic requirements of Defence and Space,
Electronics Security Systems and Support for Civil Aviation sector.
 To establish newer technology products such as Container Scanning
Systems and Explosive Detectors.
 To explore new avenues of business and work for growth in strategic
sectors in addition to working for realizing technological solutions for the
benefit of society in areas like Agriculture, Education, Health, Power,
Transportation, Food, Disaster Management etc.
 To progressively improve shareholder value of the company.
 To strengthen the technology base, enhance skill base and ensure
succession planning in the company.
 To re-engineer the company to become nationally and internationally
competitive by paying particular attention to delivery, cost and quality in
all its activities.
 To consciously work for finding export markets for the company's
products.

Present product range of ECIL:

1. Nuclear sector:
 Control and instrumentation products for nuclear power plants.
 Integrated security systems for nuclear installations.
 Radiation monitoring instruments.
 Secured network of all Department of Atomic Energy units
via satellite.

2. Defence Sector:
 Various types of fuses.
 V/UHF Radio communication equipment. 
 Electronics Warfare Systems and derivatives. 
 Thermal batteries and special components for missile projects.
 Precision servo components like gyros. 
 Missile support control and command systems.
 Training Simulators.
 Stabilised antenna and tracking for Light Combat Aircrafts.
 Detection and pre-detonation of explosive devices. 
 Jammers with direction finding abilities.

3. Commercial Sector: 
 Electronic Voting Machines. 
 Voter-verified paper audit trails. 
 Totalizer. 
 Wireless Local Loop (WLL) systems.
 Antenna products.
 Electronic energy meters or electricity meter. 
 X-ray baggage inspection system for airports.
 Computer hardware, software and services.
 Computer education services.
INTRODUCTION
EMBEDDED SYSTEMS:
An embedded system is a combination of computer hardware and software,
either fixed in capability or programmable, designed for a specific function or
functions within a larger system. Industrial machines, agricultural and process
industry devices, automobiles, medical equipment, cameras, household
appliances, airplanes, vending machines and toys, as well as mobile devices, are
possible locations for an embedded system.

Embedded systems are computing systems, but they can range from having no
user interface (UI) for example, on devices in which the system is designed to
perform a single task -- to complex graphical user interfaces (GUIs), such as in
mobile devices. User interfaces can include buttons, LEDs, touchscreen sensing
and more. Some systems use remote user interfaces as well.

History of Embedded Systems

Embedded systems date back to the 1960s. Charles Stark Draper developed an
integrated circuit (IC) in 1961 to reduce the size and weight of the Apollo
Guidance Computer, the digital system installed on the Apollo Command
Module and Lunar Module. The first computer to use ICs, it helped astronauts
collect real-time flight data. By the late 1960s and early 1970s, the price of
integrated circuits dropped and usage surged. The first microcontroller was
developed by Texas Instruments in 1971. The TMS 1000 series, which became
commercially available in 1974, contained a 4-bit processor, read-only memory
(ROM) and random-access memory (RAM), and cost around $2 apiece in bulk
orders. In 1987, the first embedded operating system, the real-time VxWorks,
was released by Wind River, followed by Microsoft's Windows Embedded CE
in 1996. By the late 1990s, the first embedded Linux products began to appear.
Today, Linux is used in almost all embedded devices.
Embedded system hardware (microprocessor/microcontroller-based)

Embedded system hardware can be microprocessor- or microcontroller-based.


In either case, an integrated circuit is at the heart of the product that is generally
designed to carry out computation for real-time operations. Microprocessors are
visually indistinguishable from microcontrollers, but while the microprocessor
only implements a central processing unit (CPU) and, thus, requires the addition
of other components such as memory chips, microcontrollers are designed as
self-contained systems. Microcontrollers include not only a CPU, but also
memory and peripherals such as flash memory, RAM or serial communication
ports. Because microcontrollers tend to implement full (if relatively low
computer power) systems, they are frequently put to use on more complex tasks.
For example, microcontrollers are used in the operations of vehicles, robots,
medical devices and home appliances, among others. At the higher end of
microcontroller capability, the term system on a chip (SoC) is often used,
although there's no exact delineation in terms of RAM, clock speed and so on.

Embedded firmware
The firmware on embedded systems, referred to as embedded firmware, is
specific software written into the memory of a device that serves the purpose of
ROM, but can be updated more easily. Firmware can be stored in non-volatile
memory devices including ROM, programmable ROM, erasable PROM or flash
memory. Embedded firmware is used to control various device and system
functions, for example, telling the device how to communicate with other
devices, perform specific functions and provide input and output functionality.

The delineation between the terms embedded firmware and embedded


software are blurring, but embedded software often refers to the only code
running on a piece of hardware, while firmware can also refer to the chip that
houses a device's basic input/output system (BIOS) or Unified Extensible
Firmware Interface, which connect software and a system's operating system.
ROAD ACCIDENTS SCENARIO
Even though there are several advanced technological innovations are available
today for vehicle safety, the growth in the number of accidents is continues
regularly. And most of these accidents are especially due to collision or
intersectional accidents. Major reasons of accidents are bad weather, human
negligence, sudden encounters on blind spots etc. The following plot shows the
fatality risk of accidents in India over the years;

This is very high compared to other countries according to an excerpt from a


report from 2015.
Thus, it is a very serious problem that needs to be checked globally for the
safety of the citizens of the nations of the world.
SOLUTION:
An accident avoidance system is an automobile safety system designed to
reduce the severity of an accident. Also known as pre-crash system, forward
collision warning system or collision mitigating system, it uses radar and
sometimes laser and camera sensors to detect an imminent crash. Once the
detection is done, these systems either provide a warning to the driver when
there is an imminent collision or take action autonomously without any driver
input (by braking or steering or both).

In 2009, the U.S. National Highway Traffic Safety Administration (NHTSA)


began studying whether to make frontal collision warning systems and lane
departure warning systems mandatory.

In 2011, a question was submitted to the European Commission regarding


stimulation of these "collision mitigation by braking" systems. The mandatory
fitting of Advanced Emergency Braking Systems in commercial vehicles will be
implemented on 1 November 2013 for new vehicle types and on 1 November
2015 for all new vehicles in the European Union. This could, according to the
impact assessment, ultimately prevent around 5,000 fatalities and 50,000 serious
injuries per year across the EU.

In an important 2012 study by the non-profit research organization Insurance


Institute for Highway Safety, researchers examined how particular features of
crash avoidance systems affected the number of claims under various forms of
insurance coverage. They found that autonomous braking that would brake on
its own, if the driver does not, to avoid a forward collision; provide the biggest
benefits.

Collision avoidance features are rapidly making their way into the new vehicle
fleet.
PROTOTYPE DEVELOPED AT ECIL
For mimicking the real-life application, we developed an autonomous mobile
controlled robot which was our prototype of a car. To avoid early accidents, we
used small radar sensors around an autonomous robot to detect objects and their
relative speeds and distances. Generally, these sensors are IR sensors and
Ultrasonic sensors. In our prototype model we used IR sensors to detect the in
front vehicles and ultrasonic sensors to detect adjacent vehicles. These sensors
regularly transmitted bursts of radar waves with high frequency. The
transmitted high frequency bursts bounce off the nearest vehicles and return
back to the sensor. At sensor, another unit connected to the sensor to estimate
the time between signal leave and bounce back. This information is used to
estimate the relative velocity, distance and position of the vehicle immediately.
Thus, if any abrupt changes are happening in these factors which intentionally
cause an accident, then they will assist the driver to avoid the collision. In this
project we effectively avoid the collision by properly applying the brake at right
time in right direction i.e. if driver turns right without accurately observing the
oncoming vehicles, this system will issue a throttle command to the vehicle and
at same time a brake command is applied. Same process will be applied in every
turn of the vehicle. These commands are issued in a manner that does not cause
the violation of predefined speed limits (either traffic laws or comfort levels),
more precisely, the braking command will not cause the vehicle velocity to
become less than a minimum speed, while the accelerating command will not
cause the vehicle velocity to become greater than a maximum speed. This
implies that automatic control commands applied to prevent collisions at the
intersection do not create hazardous driving conditions for other vehicles not
directly involved.
HARDWARE USED
AT89S52 Microcontroller
It can be called the brain of the prototype. It is
the main control unit, processing and
executing all the commands.
The AT89S52 comes from the popular 8051
family of Atmel Microcontrollers. It is an 8-
bit CMOS microcontroller with 8K as Flash
memory and 256 bytes of RAM. Since it is
similar to the trust worthy 8051 architecture
these microcontrollers are as per industry
standard. It has 32 I/O pins comprising of
three 16-bit timers, external interrupts, full-
duplex serial port, on-chip oscillator and clock
circuitry.
The Microcontroller also has Operating mode,
Idle Mode and Power down mode which
makes it suitable for battery operated
applications. Few considerable drawbacks of
the microcontroller are that it does not have
in-built ADC and does not support SPI or I2C
protocols. However, the external modules can be utilised for the same.
AT89S52 –Simplified Features:
 CPU: 8-bit PIC
 Number of Pins: 40
 Operating Voltage (V): 4 to 5.5 V
 Number of Programmable I/O pins: 32
 Timer Module: 16-bit (1)
 Communication Peripherals: UART (1)
 External Oscillator: Up to 23Mhz
 Internal Oscillator: Nil
 Program Memory Type: Flash
 Program Memory (KB): 8kB
 RAM Bytes: 256 x 8-bit
HC-SR04 Ultrasonic Sensor
It is the major distance measuring sensor that
senses the distance between the prototype and
the object in its vicinity. HC-SR04 Ultrasonic
(US) sensor is a 4-pin module, whose pin
names are Vcc, Trigger, Echo and Ground
respectively. This sensor is a very popular
sensor used in many applications where
measuring distance or sensing objects are
required. The module has two eyes like
projects in the front which forms the Ultrasonic transmitter and Receiver. The
sensor works with the simple high school formula that
Distance = Speed × Time
The Ultrasonic transmitter transmits an ultrasonic wave, this wave travels in air
and when it gets objected by any material it gets reflected back toward the
sensor this reflected wave is observed by the Ultrasonic receiver module as
shown in the picture below

HC-SR04 Sensor Features:

 Operating voltage: +5V


 Theoretical Measuring Distance: 2cm to 450cm
 Practical Measuring Distance: 2cm to 80cm
 Accuracy: 3mm
 Measuring angle covered: <15°
 Operating Current: <15mA
 Operating Frequency: 40kHz
IR Sensor:
It is an obstacle detecting sensor that detects the object in its
vicinity.
IR sensor module features:
 5VDC Operating voltage
 I/O pins are 5V and 3.3V compliant
 Range: Up to 20cm
 Adjustable Sensing range
 Built-in Ambient Light Sensor
 20mA supply current

L293D Motor Drive


The L293D is a popular 16-Pin Motor Driver IC. As
the name suggests it is mainly used to drive motors. A
single L293D IC is capable of running two DC motors
at the same time; also, the direction of these two
motors can be controlled independently.
Features:
 Can be used to run Two DC motors with the
same IC.
 Speed and Direction control is possible
 Motor voltage Vcc2 (Vs): 4.5V to 36V
 Maximum Peak motor current: 1.2A
 Maximum Continuous Motor Current: 600mA
 Supply Voltage to Vcc1(vss): 4.5V to 7V
 Transition time: 300ns (at 5Vand 24V)
 Automatic Thermal shutdown is available

DC Motors
Two 12V, 200RPM DC motors were used to drive the prototype. The DC motors
were controlled by the L293D Motor Drive.
HC-05 Bluetooth Module
This module acts as a transceiver for the microcontroller
and allows it to be controlled by mobile wirelessly
using Bluetooth technology.
Features:
 Operating Voltage: 4V to 6V (Typically +5V)
 Operating Current: 30mA
 Range: 10m
 Works with Serial communication (USART) and TTL compatible
 Follows IEEE 802.15.1 standardized protocol
 Uses Frequency-Hopping Spread spectrum (FHSS)
 Can operate in Master, Slave or Master/Slave mode
 Can be easily interfaced with Laptop or Mobile phones with Bluetooth

16×2 LCD Module


Any action executed by the
microcontroller was shown on the LCD
display. LCD modules are very
commonly used in most embedded
projects, the reason being its cheap
price, availability and programmer
friendly. 16×2 LCD is named so
because; it has 16 Columns and 2
Rows. 
Features:

 Operating Voltage is 4.7V to 5.3V


 Current consumption is 1mA without backlight
 Alphanumeric LCD display module, meaning can display alphabets and
numbers
 Consists of two rows and each row can print 16 characters.
 Each character is built by a 5×8-pixel box
 Can work on both 8-bit and 4-bit mode

Power Supply
A 12V DC battery was used to supply power to the prototype.
BASIC FLOW DIAGRAM:

KEIL μVision IDE:


Keil is a software development tool which supports microcontroller version,
Dallas version and also the operations involved with different processors and
also with embedded C platform. With the help of Keil the code generation can be
done easily and also the interfacing with the hardware can be done smoothly
with the help of run time environment present in Keil. It is such a sophisticated
platform which contains different optimizing parameters like source code
compilation part, project wizard window and build in facility, library function,
documentation. With the help of this simulation and synthesis part becomes
easier for the user to make error free code generation and also to have a proper
output.
Embedded C: This platform is a simple extension of the C language
programming topology where we visualize the clear bit of study about the
interface between the hardware and the software domain. Generally, compared to
the simple architecture of c program Embedded C has its most wide range of
application in this modern-day scenario. As a programmer we need to know
about the basic structure of c programming and with the help of this we can
design any sort of code according to the user point of view. Embedded C
programming has its graph going on due to the presence of different optimizing
parameters like main function, structural definition, data type declaration and
syntax specifications. It has its extensive configuration specified due to the
presence fixed point arithmetic and floating-point arithmetic. With the help of
this different manipulations involving mathematical calculations can be solved
out, which is an important criterion in designing and implementation of code in
the software domain.

The driver embedded C program:


#include <xc.h>
#pragma config FOSC = HS // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled)
#pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = OFF // Low-Voltage (Single-Supply) In-Circuit Serial
//Programming Enable bit (RB3 is digital I/O, HV on MCLR must be used for programming)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data
//EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write
//protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code
//protection off)
#define _XTAL_FREQ 20000000
#define Trigger RB1 //34 is Trigger
#define Echo RB2 //35 is Echo
int time_taken;
int distance;
void back_off() { //used to drive the robot backward
RC4=1; RC5=0; //Motor 1 reverse
RC6=0; RC7=1; //Motor 2 reverse
__delay_ms(1000);
}

void calculate_distance() { //function to calculate distance of US


TMR1H =0; TMR1L =0; //clear the timer bits
Trigger = 1;
__delay_ms(10);
Trigger = 0;

while (Echo==0);
TMR1ON = 1;
while (Echo==1);
TMR1ON = 0;

time_taken = (TMR1L | (TMR1H<<8));


distance= (0.0272*time_taken)/2;
}

void main()
{
TRISD = 0x00; //PORTD declared as output for interfacing LCD
TRISB1 = 0; //Trigger pin of US sensor is sent as output pin
TRISB2 = 1; //Echo pin of US sensor is set as input pin
TRISB3 = 0; //RB3 is output pin for LED

TRISD2 = 1; TRISD3 = 1; //Both the IR sensor pins are declared as input


TRISC4 = 0; TRISC5 = 0; //Motor 1 pins declared as output
TRISC6 = 0; TRISC7 = 0; //Motor 2 pins declared as output

T1CON=0x20;

while(1)
{

calculate_distance();
if (distance>5)
{
RC4=0; RC5=1; //Motor 1 forward
RC6=1; RC7=0; //Motor 2 forward
}

calculate_distance();
if (RD2==0 && RD3==1 && distance<=5) //Left sensor is blocked
{
back_off();
RC4=1; RC5=1; //Motor 1 stop
RC6=1; RC7=0; //Motor 2 forward
__delay_ms(500);
}

calculate_distance();
if (RD2==1 && RD3==0 && distance<=5) //Right sensor is blocked
{
back_off();
RC4=0; RC5=1; //Motor 1 forward
RC6=1; RC7=1; //Motor 2 stop
__delay_ms(500);
}

calculate_distance();
if (RD2==0 && RD3==0 && distance<=5) //Both sensors are open
{
back_off();
RC4=0; RC5=1; //Motor 1 forward
RC6=1; RC7=1; //Motor 2 stop
__delay_ms(500);
}

calculate_distance();
if (RD2==1 && RD3==1 && distance<=5) //Both sensors are blocked
{
back_off();
RC4=1; RC5=0; //Motor 1 reverse
RC6=1; RC7=1; //Motor 2 stop
__delay_ms(1000);
}

}
}
Final Result

A prototype of accident avoidance system using embedded system was


successfully designed and tested. The prototype robot took the necessary actions
on encountering objects on its path. Autonomous decisions were made by the bot
weather to slow down or completely stop based on the relative speed of the bot
and the object. The undertaken action was then showcased on the LCD screen.

The following are the advantages of this system:


 Low cost, less complexity.
 Speed control is easily achieved using this system.
 Reliable
 Easy to implement

Limitations found in this system:


 Range of sensors are very limited. So safety on large scale is
compromised.
MODERN DAY APPLICATIONS AND FUTURE SCOPE
 All new Tesla cars come standard with advanced hardware capable of
providing Autopilot features today, and full self-driving capabilities in the
future—through software updates designed to improve functionality over
time.
 With the development of Unmanned Ground Vehicles (UGV) for military
application, accident avoidance technology plays a vital role in the
autonomous vehicles to avoid collisions.
 Large industries in the developed countries are going autonomous, which
too requires the advance obstacle detection systems so that the machines
can transport goods or may work without damaging themselves or the
surroundings.
BIBLIOGRAPHY
1. ECIL manuals.
2. www.ecil.co.in
3. 101components.com
4. www.atmel.com
5. Geeksforgeeks.com
6. Tesla autopilot courtesy www.tesla.com
7. Ministry of road transport and highways www.morth.nic.in
8. www.designmews.com

You might also like