1.1 Overview of Embedded System
1.1 Overview of Embedded System
1.1 Overview of Embedded System
INTRODUCTION
It has hardware.
RTOS defines the way the system works. It sets the rules during the
execution of application program. A small scale embedded system
may not have RTOS.
1
1.1.1BASIC STRUCTURE OF AN EMBEDDED SYSTEM
2
ICSP header, a 16 MHz ceramic resonator, a USB connection, 6 analog
inputs, a power jack and a reset button.
"Uno" means one in Italian and is named to mark the upcoming release
of Arduino 1.0. The Arduino Uno and version 1.0 will be the reference
versions of Arduino, moving forward. The Uno is the latest in a series of USB
Arduino boards, and the reference model for the Arduino platform.
3
1.1.4 PIN DIAGRAM
4
Connected devices also generate massive amounts of Internet traffic,
including loads of data that can be used to make the devices useful, but can
also be mined for other purposes. All this new data, and the Internet-
accessible nature of the devices, raises both privacy and security concerns.
5
1.2.2 IoT COMPONENTS
Four fundamental components of IoT system, which tells us how IoT
works.
Sensors/Devices
Sensors or devices help in collecting very minute data from the
surrounding environment. All of this collected data can have various degrees
of complexities ranging from a simple temperature monitoring sensor or a
complex full video feed.
A device can have multiple sensors that can bundle together to do more
than just sense things. For example, our phone is a device that has multiple
sensors such as GPS, accelerometer, camera but our phone does not simply
sense things.
Connectivity
Next, that collected data is sent to a cloud infrastructure but it needs a
medium for transport. The sensors can be connected to the cloud through
various mediums of communication and transports such as cellular networks,
satellite networks, Wi-Fi, Bluetooth, wide-area networks (WAN), low power
wide area network and many more. Every option we choose has some
specifications and trade-offs between power consumption, range, and
bandwidth. So, choosing the best connectivity option in the IOT system is
important.
Data Processing
Once the data is collected and it gets to the cloud, the software
performs processing on the acquired data. This can range from something
very simple, such as checking that the temperature reading on devices such as
AC or heaters is within an acceptable range. It can sometimes also be very
complex, such as identifying objects (such as intruders in your house) using
computer vision on video.
6
User Interface
Next, the information made available to the end-user in some way. This
can achieve by triggering alarms on their phones or notifying through texts or
emails. Also, a user sometimes might also have an interface through which
they can actively check in on their IOT system. For example, a user has a
camera installed in his house; he might want to check the video recordings
and all the feeds through a web server.
However, it’s not always this easy and a one-way street. Depending on the
IoT application and complexity of the system, the user may also be able to
perform an action that may backfire and affect the system. For example, if a
user detects some changes in the refrigerator, the user can remotely adjust the
temperature via their phone.
Intelligence
Together algorithms and compute (i.e. software & hardware) provide the
“intelligent spark” that makes a product experience smart. Consider Misfit
Shine, a fitness tracker, compared to Nest’s intelligent thermostat. The Shine
experience distributes compute tasks between a smart phone and the cloud.
The Nest thermostat has more compute horsepower for the AI.
Connectivity
7
common ability to consume and produce data. If this sounds familiar, that’s
because it is Metcalfe’s Law and it rings true for IoT.
Sensing
We tend to take for granted our senses and ability to understand the
physical world and people around us. Sensing technologies provide us with
the means to create experiences that reflect a true awareness of the physical
world and the people in it. This is simply the analog input from the physical
world, but it can provide rich understanding of our complex world.
Expressing
Energy
Safety
8
data and the safety of our physical well-being. Securing the endpoints, the
networks, and the data moving across all of it means creating a security
paradigm that will scale. By framing IoT design with these characteristics,
multi-discipline teams can work across their domains to make tradeoffs in
interaction design, software architectures, and business models. Naturally a
single product or service may choose to dial up or dial down these
characteristics depending on the nature of user experience and constraints
imposed by environmental and business factors.
The Internet of Things (IoT) has not been around for very long.
However, there have been visions of machines communicating with one
another since the early 1800s. Machines have been providing direct
communications since the telegraph (the first landline) was developed in the
1830s and 1840s. Described as “wireless telegraphy,” the first radio voice
transmission took place on June 3, 1900, providing another necessary
component for developing the Internet of Things. The development of
computers began in the 1950s. The Internet, itself a significant component of
the IoT, started out as part of DARPA (Defense Advanced Research Projects
Agency) in 1962, and evolved into ARPANET in 1969. In the 1980s,
commercial service providers began supporting public use of ARPANET,
allowing it to evolve into our modern Internet. Global Positioning Satellites
(GPS) became a reality in early 1993, with the Department of Defense
providing a stable, highly functional system of 24 satellites. Satellites and
landlines provide basic communications for much of the IoT. One additional
and important component in developing a functional IoT was IPV6’s
remarkably intelligent decision to increase address space.
9
Customer Privacy : As sensors and video cameras become more common
place, especially in public spaces, consumers have less and less knowledge
about the information being collected, and no way to avoid it. Many people
are uncomfortable with the idea of companies collecting information about
them, and even more uncomfortable having that information sold to anyone
and everyone. Generally speaking, older people dislike having information
about themselves collected more than younger people, but according to one
survey, about 45% of all respondents did not trust companies to use the data
they collected to protect their privacy. Currently, choices regarding privacy
are very black and white, or on/off. The customer is forced to give up all
privacy, or the customer simply cannot access the service.
Security: While there are steps to take to help ensure security, it should come
as no surprise this issue has become a significant concern with the growth of
the IoT. Literally billions of devices are being interconnected together,
making it possible (eventually) for someone to hack into your coffee maker,
and then access your entire network. The Internet of Things also makes
businesses all around the world more open to security threats. Additionally,
data sharing and privacy becomes issues when using the Internet of Things.
Consider how concerns will grow when billions of devices are
interconnected. Some businesses will be faced with storing the massive
amounts of information these devices will be producing. They will need to
find a method of securely storing the data, while still being able to access,
track, and analyze the huge amounts of it being generated.
10
CHAPTER 2
LITERATURE SURVEY
2.1 CONCEPTS
11
minutes, 356 lives would be saved annually. While it is easy to claim a
reduction in lives due to reduction in response time, an actual example helps
in the cementing of the argument: a reduction in accident notification time
from 5.2 minutes to 4.28 minutes has led to an 18% reduction of fatalities.
ASAD functions as a detection and notification service that can be
installed in a vehicle and in case of accident detection, requires the smart
phone of the driver to send a text message to the response team. The detection
of an accident is based on Mamdani fuzzy logic that evaluates, using four
parameters (force, acceleration, rotation and speed) to calculate a collision
index and if the threshold of the index is met, the smart phone issues and
sends a notification text message. This eliminates the need of the passing by
drivers or bystanders to notify the police of the accident. In addition, ASAD
records the sensor data over a specific time interval (for instance 5 minutes)
as a text file in the smart phone to be used for verification/diagnosis purposes
by the police/ambulance.
Accident detection and reporting system using GPS, GPRS and GSM
technology [2], the Global Positioning System (GPS) is a popular technology
which was developed by American Department of Defense for military use.
Later on it was available for civilian use. It is utilized for wide range of
applications such as location, direction, speed, timing, surveying, logistics,
traffic management, security etc. Nowadays, it has become an integral part of
a vehicle system for tracking and navigation system. It can provide accurate
time, location coordinate and speed. On the other hand, Global System for
Mobile communications (GSM) is a digital mobile telephony system that is
widely used. More than 690 mobile networks provide GSM services across
213 countries and GSM represents 82.4% of all global mobile connections.
Besides the voice communication it also offers Short Message Service (SMS)
and General packet radio service (GPRS) to transfer data.
12
This paper proposes to utilize the capability of a GPS receiver to
monitor the speed of a vehicle and detect an accident basing on the monitored
speed and send the location and time of the accident from the GPS data
processed by a microcontroller by using the GSM network to the Alert
Service Center. The rest of the paper is organized as follows. The Related
Work section discusses about the researches related to the accident detection
system, the Equipment and Proposed Methodology section describes the
required equipments and algorithm to detect the accident, the Accident
Detection and Reporting Procedure describes the procedure to calculate the
speed to detect accident and sending procedure and finally the paper is
concluded.
Nowadays, GPS has become an integral part of a vehicle system. These
papers propose to utilize the capability of a GPS receiver to monitor speed of
a vehicle and detect accident basing on monitored speed and send accident
location to an Alert Service Center. The GPS will monitor speed of a vehicle
and compare with the previous speed in every second through a
Microcontroller Unit. Whenever the speed will be below the specified speed,
it will assume that an accident has occurred. The system will then send the
accident location acquired from the GPS along with the time and the speed by
utilizing the GSM network. This will help to reach the rescue service in time
and save the valuable human life.
Automatic accident detection and reporting frame work for two wheelers
[3], today, there are many technologies available for accident detection. Most
of these technologies target four wheelers and are costly. Low cost solution
targeting the two wheelers is mostly missing. Traditional solution for accident
detection uses the Global Positioning System (GPS) to get the location of the
accident and a message is sent through a microcontroller or a mobile device.
13
This paper proposes a distributed framework which utilizes the
contextual state of the two-wheeler for detecting the occurrence of an
accident. The framework is also capable of identifying possible accidental
scenarios based on the feed coming from the microcontroller based device
mounted on the two-wheeler the suggested solution utilizes proximity ground
sensor, a GSM network and Global Positioning system to send the actual feed
to the server. Server process the feed along with previous state of the two-
wheeler for identification of accidental scenarios. The rest of the paper is
divided as follows. The Related works section tells the existing system. The
Proposed Work describes the detailed algorithm for accident detection and
reporting and finally the paper is concluded.
Technology must work for human race and improve the way help
reaches a person in distress in the shortest possible time. In a developing
nation like India, with the advancement in the transportation technology and
rise in the total number of vehicles, road accidents are increasing at an
alarming rate. If an accident occurs, the victim's survival rate increases when
you give immediate medical assistance. You can give medical assistance to
an accident victim only when you know the exact location of the accident.
This paper presents an inexpensive but intelligent framework that can identify
and report an accident for two-wheelers. This paper targets two-wheelers
because the mortality ratio is highest in two-wheeler accidents in India. This
framework includes a microcontroller-based low-cost Accident Detection
Unit (ADU) that contains a GPS positioning system and a GSM modem to
sense and generate accidental events to a centralized server. The ADU
calculates acceleration along with ground clearance of the vehicle to identify
the accidental situation. On detecting an accident, ADU sends accident
detection parameters, GPS coordinates, and the current time to the Accident
Detection Server (ADS). ADS maintain information on the movement of the
vehicle according to the historical data, current data, and the rules that you
14
configure in the system. If an accident occurs, ADS notifies the emergency
services and the preconfigured mobile numbers for the vehicle that contains
this unit.
Automatic accident detection and rescue system [4], detecting the accident
alone may not help for rescue. We need to analyze the health status of the
passengers in the vehicle or the victims of the accident. Many sensors are
available to sense the health information of people. Human wearable sensors
may send information about person’s blood pressure, heart beat, breath rate,
eye blink rate, movement details and other information. If we analyze this
health data along with vehicle mounted sensor data, we can assess the impact
of the accident and thus we can understand the picture in a better way. There
is a thirsty need for architecture to analyze this data to detect and react to
accidents appropriately. Domain experts will have knowledge about how to
detect accidents, how to react in accident situations, whom to alert in which
situation and what automated actions to be taken. When we are developing an
automated accident and rescue system, our
architecture should facilitate a method to formally communicate the
knowledge of domain experts so that system can understand and act
according to it. Accident detection and rescue operation is time critical
operation. Real time action is required. System should be able to detect and
react to the situations in real time. Real time response should be considered
while designing the architecture. Traffic density now a day is huge. Accident
detection and rescue system is essential for every vehicle. To scale well and
to reach to masses, its architecture should address 4 V’s of Big Data
(Volume, Variety, Velocity and Veracity). System development should not be
one time job. It should improve continuously. It should learn from its
experience and with the feedback given by the domain experts so that it can
act better in the future. Required architecture needs a learning module to learn
15
and improve. By considering all these features, architecture has to be built.
Right technologies have to be chosen for implementation.
16
Location Detection System (AALDS) includes an accident locator device,
accident management website and SMS system. A hardware prototype was
developed using components like auto-dialer, accelerometer, GPS and GSM
components. Halverson algorithm was modified to enable better efficiency in
searching the nearest hospital to the accident location.
17
Intelligent system for vehicular accident detection and notification [7],
road accidents are a human tragedy. They involve high human suffering and
monetary costs in terms of untimely deaths, injuries and loss of potential
income. There are so many new techniques such as Antilock Breaking
System (ABS), Adaptive Cruise Control (ACC), Anti Collision System
(ACS) to avoid accidents and in spite of all this, such large number of
accidents takes place. Hence this paper presents a system which gives an idea
about what can be done to provide medical help and other facilities after
accident as soon as possible. Accident can be detected using flex sensor and
accelerometer, while location of Accident will be informed to desired persons
such as nearest hospital, police and owner of vehicle through SMS sent using
GSM modem containing co-ordinates obtained from GPS along with time of
accident and vehicle number. Camera located inside vehicle will transmit real
time video to see current situation of passengers inside vehicle. Thus this
paper emphasizes on post accident system for detecting and informing about
it. Simulation result on hyper terminal is also presented in this paper. An
effective approach for reducing traffic fatalities, therefore, is to reduce the
time between when an accident occurs and when first responders, such as
medical personnel, are dispatched to the scene of the accident. Automatic
Collision notification systems use sensors embedded in a car to determine
when an accident has occurred. These systems immediately dispatch
emergency medical personnel to serious accidents. Eliminating the time
between accident occurrence and first responder dispatch reduces fatalities by
6%.
18
accidents influences the current traffic conditions directly, leading to
congestion. In addition, there is a great possibility of causing more serious
secondary damages because of shortage of early warning on roads where
speed is fast and traffic is sparse like the highways or city roads, which makes
up 20% of traffic accidents according to FHWA.
They propose an intelligent traffic accident detection system based on
Mobile Edge Computing (MEC) platform. Because of the MEC server, our
system can detect the traffic accident and send the information to drivers and
departments around the accident in real time, with low latency, high
bandwidth and huge computing power. Our system can reach low latency
because the client is within the proximity of servers in one hop and
communicates only with closing clients corresponding to the same or similar
server. Besides, offloading some huge computation of image recognition to
MEC servers also saves energy and judgment time for smart phones.
Usually, accident detection is to use equipment in vehicles to detect
accidents and send accident information to related people by SMS containing
texts only, which is expensive, inconvenient and cannot avoid secondary
accidents. This paper proposes an intelligent traffic accident detection system
based on Mobile Edge Computing with proximity, low latency and
computing and vehicle identification. Our system utilizes common smart
phones to obtain acceleration and speed, and identifies images showing
accident scenes mainly at servers in case of false positives, realizing
automation of accident detection and notifying surroundings and departments
like hospitals and department of transportation in real time. Besides, our
system can also report the finishing of accidents according to crowd sensing.
The experimental results demonstrate our system can work in real time with
simulated data.
19
Prototype of automatic accident detection and management in vehicular
environment using VANET and IoT [9], World Health Organization
(WHO) report presents the current state of global road safety. It states that the
road traffic death rate around the globe is 1.24 million per year, which is still
high and unacceptable. Figure 1 shows that highest fatality rate is in African
region per 100, 000 population, while European region has the lowest fatality
rate. This risk of dying as a road accident is three times greater in low-income
countries than high-income countries, where the considerable disparity exists
between countries in the same region. These accidents can be reduced by
applying appropriate precautions and safety measurements. Half of the
fatalities are due to lack of quick medical aid on the accident locations.
Apart from these efforts, automobile manufacturing companies are
producing advance vehicles that provide safety and comfort to the customers.
In last few years, a number of research and development projects have been
launched, which have several goals to achieve e.g., improving traffic
management, road safety, security, navigation system, environmental friendly
usage etc., with the help of Vehicular Adhoc Networks (VANETs) and its
combination with Wireless Sensor Networks (WSNs), Internet of
Things(IoT). The growth in development is also because of the low cost of
IEEE 802.11 technologies, and the attractive features and the potential use in
the development of safety, informative, and environmentally friendly
applications in vehicles manufacturing companies. Although cellular
networks have provided several voice and infotainment services to the
customers even in vehicular environments, there are certain direct
communications in Vehicle-to-Vehicle (V2V) or Vehicle-to-Infrastructure
(V2I), where these networks have high latency and are not well suited.
However, Vehicular Adhoc Networks (VANETs) offers minimal latency in
sending hazard warnings, alerts and information messages in V2V and V2I
communications. In the context of pre-accident prevention and post-accident
20
care, the both, research community and industries are working together to
develop such applications that can reduce accidents on road, and this trend is
growing with the needs of applications.
In this paper, our research work is focusing in developing a prototype that can
detect an accident on road and contact for emergency services automatically.
Our application uses sensors in vehicles to detect accident and driver
situations with the option of manual emergency call as well. The objective of
this project is the provision of medical services on the accident location as
soon as possible. We choose IoT for the communication of small onboard
devices (inside vehicle) to get rid of wired connections between sensors and
VANET for the communication among vehicles, road side units and medical
centers.
Real time embedded system for accident prevention [10], this paper
presents autonomous accident prevention with security enabling techniques,
speed control and accident detection system .The main objective is to design
an Atmega328P controller to monitor the zones, which can run on an
embedded system and to automatically locate the site of accident and alert
concerned people. It should be done automatically as the person involved in
the accident may not be in a circumstance to send the information .The
proposed system is composed of two separate design units: transmitter unit
and receiver unit .Just before the vehicle is in the transmitter zone, the vehicle
speed is controlled by receiving the signal from the RF transmitter. For this,
RF transmitter can be kept at a few meters before the zone. Security system
includes alcohol sensor, eye sensor and smoke sensor. Accident detection
system comprises of GPS and GSM in cell phones .As collision occurs,
piezoelectric sensor will detect the signal and sends it to ATmega328P
microcontroller.
21
The GPS available in the smart phone will start communicate with the
satellite and get the latitude and longitude values and name of place of
accident will be send to the previously set phone numbers of relatives,
ambulance services etc,.
22
CHAPTER 3
EXISTING MODEL
3.1 INTRODUCTION
World Health Organization (WHO) report presents the current state of
global road safety. It states that the road traffic death rate around the globe is
1.24 million per year, which is still high and unacceptable. Figure 3.1 shows
that highest fatality rate is in African region per 100, 000 population, while
European region has the lowest fatality rate. This risk of dying as a road
accident is three times greater in low-income countries than high-income
countries, where the considerable disparity exists between countries in the
same region. These accidents can be reduced by applying appropriate
precautions and safety measurements. Half of the fatalities are due to lack of
quick medical aid on the accident locations. In last few years, a number of
research and development projects have been launched, which have several
goals to achieve e.g., improving traffic management, road safety, security,
navigation system, environmental friendly usage etc., with the help of
Vehicular Adhoc Networks (VANETs) and its combination with Wireless
Sensor Networks (WSNs), Internet of Things (IoT).
The growth in development is also because of the low cost of IEEE
802.11 technologies, and the attractive features and the potential use in the
development of safety, informative, and environmentally friendly
applications in vehicles manufacturing companies. Although cellular
networks have provided several voice and infotainment services to the
customers even in vehicular environments, there are certain direct
communications in Vehicle-to-Vehicle (V2V) or Vehicle-to-Infrastructure
(V2I), where these networks have high latency and are not well suited.
However, Vehicular Adhoc Networks (VANETs) offers minimal latency in
sending hazard warnings, alerts and information messages in V2V and V2I
communications.
23
Figure 3.1 Road traffic deaths per 100 000 population, by WHO region
24
3.3 WORKING
25
outputting 0-Vs Volts depending the amount of activity in the selected
muscle, where Vs signifies the voltage of the power source.
5) GPS Module: The GPS module is found in recent technologies like smart-
phones, automobiles, where it is used to track commerce all over the globe.
These modules are getting cheaper and small in size with the passage of time.
These tiny GPS modules are receiving GPS coordinates from satellites. It
includes tiny processors and antennas that directly receive the data sent by the
satellites and compute your position and time on the fly. To design our
prototype, the use of GPS module is same. It is needed to get the position of
the vehicle when an accident occurs so that the control server can send
medical aid to the incident place. This is one of OBU device.
Accident Detection Module
To detect an accident on road, first we need to know the all events that
we can assume in case of accident. Here are three major events that can help
in accident detection.
1) Collision: A vehicle can collide with other vehicle or any other solid
object, as a result driver or passenger inside the vehicle can get injuries.
2) Roll-over: A vehicle may roll-over when an incident occurs. This is one of
the dangerous event that may end-up with the several injuries or death of
passengers including drivers.
3) Speed: If accident happens, the vehicle would stop suddenly. In normal
situation, if brakes are applied on the vehicle, it takes a certain amount of
time and travel few feet before coming to the stationary position depending
upon the speed of the vehicle.
To detect collision, roll-over and sudden change in the speed of the vehicle,
we used accelerometer as mention earlier. When this device detects any of the
mentioned event, then our detection module will check for the bio-medical
sensors i.e. pulse and muscle sensors. Though, our module is continuously
taking measurement of bio-medical sensors and calculating mean value for
26
each type of activities like heart beat rate and muscles tension periodically.
When it receives trigger for accident from accelerometer device, it quickly
takes measurements of 60 seconds data from the pulse sensor for heart beat
rate, and 60 seconds data for muscle sensor prior the event trigger from
history, this module compare these values with the stored mean value. If there
is significant difference, and it triggers emergency conditions, then this
module generate an alert to our control service center and it also generates
alerts to nearby vehicles to report about the accident.
An emergency alert message also contains the GPS coordinates of the
position where this accident happens. The server deployed in control room
uses this coordination and find the medical service nearby that location with
the help of Haversine Formula. It generates an alert message for that medical
center with the location information of the accident. The medical center
dispatches an ambulance to the reported location. On the way to accident
location, ambulance also generates alert messages to clear the path. The
control server uses this formula to calculate the distance of the vehicle to the
hospital coordinates stored in the database and selects the one which has a
minimum distance to the accident location.
Software level Implementation
To develop an application for communication between the source
vehicle, which generates alerts/warning and the application which receives
emergency messages, we used C++ socket programming server-client model.
Where all the vehicles which are on the road and who are willing to get
service on road must need to register with the control room, we called it
server-side application. Our server-side application is able to maintain the
data of all registered vehicles and medical service centers in the region.
Initially, we limited our database to a specific region like a small town or city.
The vehicle which generates alert message when an accident occurs, we
called it client-side applications. In this application, the client-side application
27
has two types of client i.e., an application which is running on a vehicle
which is on road, and an application which is running in our medical service
center/ambulance vehicle.
1) Control Room: Server- Side Application: Server receives a message for an
incident with the position of vehicles, and it quickly searches in the hospital
list to find out the nearest hospital to the accident location. Server sends a
message for an ambulance service to the nearest hospital. The sent message
also includes the information about location of the reported accident.
2) Client-Side Applications: There are two kinds of client side applications
i.e., an active application which start the event by generating alert/warning
message to the server from the on-board unit, and the 2nd client is a passive
application installed in the hospital unit, where a message is sent for the
ambulance from a server.
Vehicle (On board Unit): When an accident occurs, the sensors deployed
inside the car detect an accident and situation of the driver. On detecting
emergency level, the car generated an alert message for the server to get
medical help. In addition to it, the vehicle also generated warning messages to
the neighboring nodes for the accident and possibility of a road block.
Hospital: On receiving a message from the server, an ambulance dispatched
to the event location and it also generates alerts with the start of the journey
to clear the path.
3.4 DISADVANTAGES
Driving history is not recorded and not stored.
Complex system design.
Fails to track the collision and pre-damage status.
High system design cost.
28
CHAPTER 4
PROPOSED SYSTEM
4.1 INTRODUCTION
In a fast growing world the number of vehicle are increasing day by
day. During peak hours, the rate of accident occurrence is high. This is due to
the over speed, drink and drive, not obeying the traffic rules, unskilled drivers
and etc. Every year the traffic accident is appalling that nearly 1.5 million
people die in the world. Due to the lack of emergency facilities, many people
lost their life during accident. The proposed design is a system which can
detect accident in significantly less time and send the basic information to
controller room and family members within a few seconds. The basic
information consists of latitude and longitude coordinates. This information
sends via GSM modem that is used in our system. Switch is provided in order
to cancel the sending of the message to controller room when the driver is in
normal condition, Otherwise the message will send to control room after the
delay time.
29
If this system is inserted in every vehicle, then it is easy to understand
how many vehicles are involved in particular accident and how intense is it.
So that the help from control room will be according to the control room. The
present board designed has both vehicle tracking and accident alert system,
which make it more valuable and useful. This board alerts us from theft and
as well as accident detection. It also detects fire accident by placing fire
detector in one of interrupt pins.
4.4 WORKING
The sensors like Ultrasonic sensor, Accelerometer sensor and
Vibration sensors are place in the vehicle. When the distance between two
vehicles are very close, the emitted Radiation from the sensor will
measure the distance, according to the threshold value, if distance is
nearer to the threshold value, the motor will automatically slow down
vehicle speed. When an accident occurs, the sensor will sense the
parameters (tilt, speed, distance, vibration) of the vehicle. The sensed data
will send to the Microcontroller (Arduino). If the sensed data is greater
than the threshold limit, the microcontroller will send a message to the
controller room through GSM Modem, which will include the location
30
with help of GPS. The web page is created, and information is viewed in
the form of web page in controller room. For the controller room the web
page URL is send via GSM modem. Alert message with the latitude and
longitude values also send to the family members. We use switch in this
project with delay of one minute. If a person press this switch means, the
message will not send to the control room. Otherwise, the message will
send then the rescue team will reach the spot and save their life. Hence
ultrasonic sensor is widely used to avoid occurrence of an accident. And
also IOT concept is used for the continuous monitoring and an alysis of
the vehicle.
31
early and repaired before the event of machine failure; because such a failure
is potentially costly in terms of time, cost, and productivity vibration
measurements allows us to increase the efficiency and save money.
32
Ultrasonic sensors work by emitting sound waves at a frequency too high
for humans to hear (20,000 Hz). They then wait for the sound to be reflected
back, calculating the distance based on the time required. The sensor
determines the distance to a target by measuring time elapses between the
sending and receiving of ultrasonic pulse. The range of ultrasonic sensor is
2cm to 400cm.
4.5.5 GPS
4.5.6 GSM
33
GSM Modem is a device which can be either a mobile phone or a modem
device which can be used to make a computer or any other processor
communicate over a network. A GSM modem requires a SIM card to be
operated and operates over a network range subscribed by the network and
operator. GSM is an open digital cellular technology used for transmitting
mobile voice and data services operates at 850MHz, 900MHz, 1800MHz,
1900MHz frequency bands.
PRODUCT FEATURES:
802.11 b/g/n
Wi-Fi Direct (P2P), soft-AP
Integrated TCP/IP protocol stack
Integrated TR switch, balun, LNA, power amplifier and matching
network
Integrated PLLs, regulators, DCXO and power management units
+19.5dBm output power in 802.11b mode
Power down leakage current of <10uA
1MB Flash Memory
Integrated low power 32-bit CPU could be used as application
processor
34
SDIO 1.1 / 2.0, SPI, UART
STBC, 1×1 MIMO, 2×1 MIMO
A-MPDU & A-MSDU aggregation & 0.4ms guard interval
Wake up and transmit packets in < 2ms
Standby power consumption of < 1.0mW (DTIM3)
4.7 PROGRAM
4.7.1 PROGRAM FOR NODE MCU
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
35
String page = "";
double data;
String inchar;
void setup(void){
Serial.begin(9600);
WiFi.begin(ssid, password); //begin WiFi connection
Serial.println("");
server.begin();
Serial.println("Web server started!");
}
void loop(void){
36
inchar = Serial.readString();
// Serial.print(inchar);
server.handleClient();
delay(300);
}
4.7.2 PROGRAM FOR ARDUINO
#include<LiquidCrystal.h>
#include <SoftwareSerial.h>
SoftwareSerial gps(8,9); // RX, TX
String data1="";
String data="";
char str[70];
String gpsString="";
char *test="$GPGGA";
String latitude="11.54";
String longitude="7.9";
int temp=0,i;
boolean gps_status=0;
unsigned long oldTime;
int count = 0; // count = 0
char input[12]; // character array of size 12
boolean flag = 0; // flag =0
int flag1=0;
const int trigPin = 4;
const int echoPin = 5;
void setup()
37
{
pinMode(13,OUTPUT);
pinMode(10,INPUT);
digitalWrite(13,LOW);
Serial.begin(9600);
gps.begin(9600);
delay(1000);
// get_gps();
}
void loop()
{
long duration, inches, cm;
//get_gps();
int sensorValue1 = analogRead(A0);
int sensorValue2 = analogRead(A1);
int sensorValue3 = analogRead(A2);
int sensorValue4 = analogRead(A3);
Serial.print(sensorValue3);
Serial.print("vibration:");
Serial.println(sensorValue1);
Serial.print("X:");
Serial.println(sensorValue2);
Serial.print("Y:");
Serial.println(sensorValue3);
/*Serial.print("Vibration:");
Serial.println(sensorValue4);*/
38
pinMode(trigPin, OUTPUT);
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();
if(cm<30){
digitalWrite(13,HIGH);
delay(3000);
digitalWrite(13,LOW);
}
if(sensorValue1<20 ||sensorValue3<400){
Serial.println("Vibration Detected");
oldTime=millis();
flag1=0;
while((millis() - oldTime) < 10000)
{
39
// Serial.println((millis() - oldTime));
if(digitalRead(10)==HIGH){
flag1=1;
break;
}
}
if(flag1==0){
data+=("Latitude:")+String(latitude)+"Longitude:"+String(longitude)+"*";
// data1="";
data1="Accident happened at Latitude:"+String(latitude)+"
Longitude:"+String(longitude);
gps.println("AT+IPR=9600"); //Sets the GSM Module in 9600 boud
delay(1000);
gps.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
gps.println("AT+CMGS=\"+918675065336\"\r"); // Replace x with mobile
number
delay(1000);
// String message="OTP for person"+String(i)+" is "+String(randNumber);
40
delay(500);
}
void gpsEvent()
{
gpsString="";
while(1)
{
while (gps.available()>0) //checking serial data from GPS
{
char inChar = (char)gps.read();
gpsString+= inChar; //store data from GPS into gpsString
i++;
if (i < 7)
{
if(gpsString[i-1] != test[i-1]) //checking for $GPGGA sentence
{
i=0;
gpsString="";
}
}
if(inChar=='\r')
{
if(i>65)
{
gps_status=1;
break;
}
else
41
{
i=0;
}
}
}
if(gps_status)
break;
}
}
void get_gps()
{
gps_status=0;
int x=0;
while(gps_status==0)
{
gpsEvent();
int str_lenth=i;
latitude="";
longitude="";
int comma=0;
while(x<str_lenth)
{
if(gpsString[x]==',')
comma++;
if(comma==2) //extract latitude from string
latitude+=gpsString[x+1];
else if(comma==4) //extract longitude from string
longitude+=gpsString[x+1];
42
x++;
}
int l1=latitude.length();
latitude[l1-1]=' ';
l1=longitude.length();
longitude[l1-1]=' ';
i=0;x=0;
str_lenth=0;
delay(100);
}
}
return microseconds / 74 / 2;
}
return microseconds / 29 / 2;
}
43
4.8 ADVANTAGE OF AN ACCIDENT DETECTION SYSYTM
44
CHAPTER 5
RESULT AND DISCUSSIONS
When the distance between two vehicles are very close, the emitted
Radiation from the sensor will measure the distance. If measured distance
is greater than threshold value, the motor will automatically slow down
vehicle speed. When an accident occurs, the sensor will sense the
parameters (tilt, speed, distance, vibration) of the vehicle. The sensed data
will send to the Microcontroller (Arduino). If the sensed data is greater
than the threshold limit, the microcontroller will send a message to the
controller room through GSM Modem, which will include the location of
vehicle with the help of GPS. The web page is created, and information is
viewed in the form of web page in controller room..
45
This figure shows the Hardware Model Setup of Vehicle accident detection
and intimation System
46
This figure shows the Webpage output
47
This figure shows the GSM output
48
CHAPTER 6
CONCLUSION
49
CHAPTER 7
FUTURE WORK
This system can be interfaced with vehicle airbag system that prevents
vehicle occupants from striking interior objects such as the steering wheel or
window.
50
REFERENCES
51
[7]. K. A. Khaliq, J. Pannek, and A. Qayyum, “Intelligent System For
Vehicular Accident Detection And Notification,” International
Journal of Advanced Computer Science and Applications(IJACSA),
vol. 7, no. 11, pp. 359–369, 2016. [Online].
[8]. J. Bos, S. Hodder, A. Miglani, and N. Mansfield, “Intelligent Traffic
Accident Detection System Based On Mobile Edge Computing,”
2017.
[9]. H. Hartenstein and L. Laberteaux, “Prototype Of Automatic
Accident Detection And Management In Vehicular Environment
Using VANET And IoT,” IEEE Communications Magazine, vol. 46,
no. 6, 2008.
[10]. M. S. Akbar, K. A. Khaliq, J. Pannek and A. Qayyum, “Real Time
Embedded System For Accident Prevention,” pp. 903–921, 2018.
52
53