Major Project
Major Project
On
IOT based Smart Vehicle Automation and Control with Enhanced
Safety,Security and Tracking System using Wireless Sensors
Submitted to
BACHELOR OF TECHNOLOGY
In
Year - 2019
DECLARATION
Abstract I
List of figures II
CHAPTER 1. INTRODUCTION
1.1 Introduction
1.2 General
1.3 Objectives
1.4 Overview
1.4.1 Key features
1.4.2 Advantages
1.4.3 disadvantages
2
3.3 Applications
4.1.8 Buzzer
CHAPTER 6. IMPLEMENTATION 63
CHAPTER 8. SCREENSHOTS 73
CHAPTER 11.BIBLOGRAPHY 85
REFERENCES 86
LIST OF FIGURES
2.6 Robot 13
3.16 Resistor 37
LIST OF TABLE
S NO. TABLE NAME PAGE NO.
1. ESP 8266 Description 42
Abstract
INTRODUCTION
1.1 Introduction
Vehicle tracking systems are popular among people as a retrieval device and theft
prevention. The main benefit of vehicle tracking systems is the security purposes by
monitoring the vehicle's location which can be used as a protection approach for
vehicles that are stolen by sending its position coordinates to the police center as an
alert for the stolen. When a police center receives an alert for stolen vehicles, they
can make an action to prevent this theft. Nowadays, it is used either as a replacement
or addition for car alarms to protect it from theft or it can be used as a monitoring
system to keep track the vehicle at the real time. So, many applications can be used
for this purpose to block car's engine or doors as an action to protect the vehicle. Due
to the advancement in technology vehicle tracking systems that can even identify
and detect vehicle's illegal movements and then attentive the owner about these
movements. This gives an advantage over the rest applications and other pieces of
technology that can serve for the same purpose. Nowadays, vehicle tracking is one
of the most important applications. For example, the maps given to vehicle drivers
may play a large role in vehicle tracking and monitoring. The major difficulty is that
vehicle owners may not be able to distinguish the vehicle in a place as a result of
overlapping maps, which adversely affects the process of tracking and
monitoring[1]. It requires some types of systems to identify and detect where objects
were at some time or what distance traveled during a trip to a vehicle. This may be
an additional point and help the police in preventing thefts and locating the vehicle
by relying on reports from these approved systems and studying and analyzing them
to detect stolen vehicles' locations. This system is a necessary device for tracking of
vehicles any time the owner wants to observe or monitor it and today it is really
trendy among people having costly cars, used as theft avoidance and recovery of the
stolen car. The collected data can be observed on a digital maps by using internet
and software.
There is tremendous demand for object tracking application for the business process.
The real-time tracking information on valuable things and assets could solve many
problems in the world. GPS is the Global Positioning System which provides the
location, using off-line and on-line both in any atmospheric conditions. There are
several types of GPS tracking system available in the market.
1.2 General
1.3 Objectives
According to data from the Federal Reserve Bank of St. Louis, Americans drove
more than 3 trillion miles last year. At an average speed of 40mph, that’s roughly
23,000 years of human life spent each day doing little more than sitting and focusing
on pavement. What’s worse, car accidents also kill more than 30,000 people in the
United States every year (Insurance Institute for Highway Safety). Nothing has
shaped American construction and consumerism quite like the car. It’s encouraged
spacious design in everything from suburbs to shopping malls and has created
hundreds of secondary industries. America has been so accommodative to
automobiles that we are now dependent on them. In 2013, 85.8 percent of Americans
used automobiles to get to work (U.S. Census Bureau). Even if someone can avoid
owning a car, they’ll still need to rent one or use a taxi from time to time.
However, just because America needs cars, it doesn’t necessarily need drivers.
Various companies are designing self-driving vehicles, believing that a fully
automated car could improve the quality of the American commute and drastically
reduce vehicle accidents
1.4 Overviews
Internet of things systems allow users to achieve deeper automation, analysis, and
integration within a system. They improve the reach of these areas and their
accuracy. Internet of things utilizes existing and emerging technology for sensing,
networking, and robotics. Internet of things exploits recent advances in software,
falling hardware prices, and modern attitudes towards technology. Its new and
advanced elements bring major changes in the delivery of products, goods, and
services; and the social, economic, and political impact of those changes.
Sensors – IoT loses its distinction without sensors. They act as defining instruments
which transform IoT from a standard passive network of devices into an active
system capable of real-world integration.
Active Engagement – Much of today's interaction with connected technology
happens through passive engagement. IoT introduces a new paradigm for active
content, product, or service engagement. Small Devices – Devices, as predicted,
have become smaller, cheaper, and more powerful over time. IoT exploits purpose-
built small devices to deliver its precision, scalability, and versatility.
1.4.2 Advantages
The advantages of IoT span across every area of lifestyle and business. Here is a list
of some of the advantages that IoT has to offer:
Technology Optimization – The same technologies and data which improve the
customer experience also improve device use, and aid in more potent improvements
to technology. IoT unlocks a world of critical functional and field data.
Reduced Waste – IoT makes areas of improvement clear. Current analytics give
us superficial insight, but IoT provides real-world information leading to more
effective management of resources.
Enhanced Data Collection – Modern data collection suffers from its limitations
and its design for passive use. IoT breaks it out of those spaces, and places it exactly
where humans really want to go to analyze our world. It allows an accurate picture
of everything.
1.4.3 Disadvantages
Though IoT delivers an impressive set of benefits, it also presents a significant set
of challenges. Here is a list of some its major issues:
Flexibility – Many are concerned about the flexibility of an IoT system to integrate
easily with another. They worry about finding themselves with several conflicting
or locked systems.
Compliance – IoT, like any other technology in the realm of business, must comply
with regulations. Its complexity makes the issue of compliance seem incredibly
challenging when many consider standard software compliance a battle.
CHAPTER 2
LITERATURE SURVEY
Embedded systems are controlled by one or more main processing cores that
are typically either microcontrollers or digital signal processors (DSP). The key
characteristic, however, is being dedicated to handle a particular task, which may
require very powerful processors. For example, air traffic control systems may
usefully be viewed as embedded, even though they involve mainframe computers
and dedicated regional and national networks between airports and radar sites.
(Each radar probably includes one or more embedded systems of its own.)
2.2 Sharing the Data of E.H.R System
Equipped with these Level 5-empowering GPUs, the driverless cars would most
likely be deployed in a ride-hailing capacity in restricted settings like airports or
college campuses. Moreover, it has also been reported that German engineering and
electronics company Robert Bosch GmbH and leading automaker Daimler AG have
partnered up with Nvidia to utilize its Pegasus system as the platform for their self-
driving vehicle designs beginning in 2020. A few other automotive firms such as
Zenrin, ZF and Audi have committed to use the AI-based computers of Nvidia.
Considering the instances of GPU makers building new products, particularly
Nvidia, it can certainly be claimed that the criticality of GPU-powered AI platforms
in the effective implementation of autonomous vehicles programs is of much
significance. Many more such developments are in the works and would speed up
the creation of AI-driven big data systems, in which GPUs would play a pivotal role
in the upcoming years.
2.3 High Privacy-Maintaining Mechanism
As the development and testing of self-driving car technology has progressed, the
prospect of privately-owned autonomous vehicles operating on public roads is
nearing. Several states have passed laws related to autonomous vehicles, including
Nevada, California, Florida, Michigan, and Tennessee. Other states
have ordered that government agencies support testing and operations of these
vehicles. Industry experts predict that autonomous vehicles will be commercially
available within the next five to ten years. A 2016 federal budget proposal, slated to
provide nearly $4 billion in funding for testing connected vehicle systems, could
accelerate this time frame. In addition, the National Highway Traffic Safety
Administration (NHTSA) set a goal to work with stakeholders to “accelerate the
deployment” of autonomous technologies.
Autonomous vehicles may collect and maintain identifying information about the
owner or passenger of the vehicle for a variety of purposes, such as to authenticate
authorized use, or to customize comfort, safety, and entertainment settings. This
information likely will be able to identify owners and passengers and their activities
with a high degree of certainty.
The federal Drivers’ Privacy Protection Act protects motor vehicle records from
disclosure by state departments of motor vehicles.
Although the Electronic Communications Privacy Act (“ECPA”) may protect
against the interception of the vehicle’s electronic communications or access to
stored communications by unauthorized third parties, the service provider (or its
vendor) providing the communications or storage functionality may be capture
and use these communications without violating the law.
Although the Federal Communications Act (“FCA”) requires
“telecommunications carriers” to protect the confidentiality of “proprietary
information” of customers, it is possible that autonomous vehicle manufacturers
or their service providers would not be a “telecommunications carrier” – a
classification more typically applied to operators of landline telephone or
cellular phone networks.
State law also may not provide much protection. For example, state data
breach notification laws typically require notification of a data breach, but do
not impose substantive privacy or security protections. Data security laws,
such as those in effect in Massachusetts and California, may not currently
apply to the types of data collected or used by autonomous vehicles.
Specifically, the evolutionary path to the much-hyped “fully autonomous” car with each
stage providing exponential value.
Increasing levels of intelligent automation will also provide exponential benefits. If we
compare the levels in the auto industry and apply them to the world of cybersecurity,
level zero has very little automation while level five is most autonomous.
Level 0:
Cars: Complete driver control of the vehicle, i.e., very little automation.
Level 1:
Cars: At least one driver assistance system for both steering and
acceleration/ deceleration, which responds to the environment and
allows the driver to physically disengage from the steering wheel.
Examples include Tesla AutoPilot and self-parking.
Cybersecurity: This is where we see a lot of hype in the security industry.
On one hand, you have solutions such as User Behavior Analytics and
Network Traffic Analysis that profess to automatically analyze
”normal” behavior and alert anything abnormal. The drawback is the
inability to understand the full context of an environment or situation,
which results in a tendency to generate too many false positives and
requires significant analyst involvement to triage.
On the other hand, you have early orchestration solutions that can
partially automate some of the easier and repeatable actions during an
incident response process. While this solution is adequate to collect
relevant information for an investigation process, the actual decision
making is delegated to the analyst.
In essence, Level 2 automates actions and repeatable tasks, but not the
decision making and judgments that require “intelligence.”
Level 3:
Cars: Drivers can be fully disengaged, but are still required to pay close
attention and be “on standby” to take over should the system fail.
Cybersecurity: There are key areas where this is becoming a reality in
security automation today.
The first is full, end-to-end alert triage automation. This is where the
system has the intelligence, based on context and awareness of an alert’s
severity, to make decisions and accept feedback from human analysts.
Though more advanced systems are able to provide a full explanation of
their scoring, analysts still need to review the system’s results. However,
95 percent of the overhead work they used to have to do is effectively
eliminated.
Level 4:
Such a solution does not exist today, but is often what CISOs hope for
when they hear “security automation.” Achieving this nirvana will
require significant advancements in machine learning and computing
power.
2.6 Tools
Debugging tools are another issue. Since you can't always run general
programs on your embedded processor, you can't always run a debugger on it.
This makes fixing your program difficult. Special hardware such as JTAG ports
can overcome this issue in part. However, if you stop on a breakpoint when your
system is controlling real world hardware (such as a motor), permanent equipment
damage can occur. As a result, people doing embedded programming quickly
become masters at using serial IO channels and error message style debugging.
2.7 Resources
To save costs, embedded systems frequently have the cheapest processors that
can do the job. This means your programs need to be written as efficiently as
possible. When dealing with large data sets, issues like memory cache misses that
never matter in PC programming can hurt you. Luckily, this won't happen too
often- use reasonably efficient algorithms to start, and optimize only when
necessary.
Memory is also an issue. For the same cost savings reasons, embedded
systems usually have the least memory they can get away with. That means their
algorithms must be memory efficient (unlike in PC programs, you will frequently
sacrifice processor time for memory, rather than the reverse). It also means you
can't afford to leak memory. Embedded applications generally use deterministic
memory techniques and avoid the default "new" and "malloc" functions, so that
leaks can be found and eliminated more easily. Other resources programmers
expect may not even exist. For example, most embedded processors do not have
hardware FPUs (Floating-Point Processing Unit). These resources either need to
be emulated in software, or avoided altogether.
2.8 Real Time Issues
PROPOSED SYSTEMS
The proposed system in IoT connected vehicle with a voice-based virtual personal
assistant and it is made up of a vehicle agent and a home agent, as shown in Figure
1. The virtual personal assistant always stays with a driver as a personal IoT partner
and performs several kinds of activities to be able to do things like turn on the A/C,
lock/unlock the doors, and turn on lights, as well as to support functions like playing
music, making a phone call, and navigating while driving, at home and at the office.
A user can communicate with it through the homogenous voice-based natural
language interface, both in the vehicle and while at home. One interesting feature is
to be able to manage their smart home directly and access all kinds of content
provided by the smartphone, anywhere and at anytime. Another is to provide cloud-
based personalized services within the home-to-vehicle connected environment
using a unified speech interface based on natural language that is supported in
different environments such as the home, vehicle, and office. This makes it possible
for users to have the same connectivity in their vehicles as they have at home and at
work.
3.1 System Information
This IVI system, in which a user (vehicle owner) controls and uses numerous IVI
resources through one-to-one communication. The user will exchange the request
and response directly with the devices or contents. Thus, it is not easy for a user to
control and manage many different types of IVI resources, since the distinctive
features of each resource must be considered by the user. In addition, only the owner
is considered for IVI services, and the types of users (e. g., family, friends, and public
users) are not supported. Depending on the user type, different services and
permission levels for IVI resources may be provided. Furthermore, each IVI device
may use a different communication technology, such as Bluetooth, ZigBee, WLAN,
etc.
Potential applications of the IoT are numerous and diverse, permeating into
practically all areas of every-day life of individuals, enterprises, and society as a
whole. The IoT application covers “smart” environments/spaces in domains such as:
Transportation, Building, City, Lifestyle, Retail, Agriculture, Factory, Supply chain,
Emergency, Healthcare, User interaction, Culture and tourism, Environment and
Energy. Below are some of the IOT applications
Explosive and Hazardous Gases: Detection of gas levels and leakages in industrial
environments, surroundings of chemical factories and inside mines, Monitoring of
toxic gas and oxygen levels inside chemical plants to ensure workers and goods
safety, Monitoring of water, oil and gas levels in storage tanks and Cisterns,
Maintenance and repair: Early predictions on equipment malfunctions and service
maintenance can be automatically scheduled ahead of an actual part failure by
installing sensors inside equipment to monitor and send reports.
COMPONENTS
• Conversion of one form of electrical power to another desired form and voltage,
typically involving converting AC line voltage to a well-regulated lower-
voltage DC for electronic devices. Low voltage, low power DC power supply
units are commonly integrated with the devices they supply, such
as computers and household electronics.
• Batteries.
• Solar power.
• Generators or alternators.
Fig 3.8: Regulated Power Supply
The basic circuit diagram of a regulated power supply (DC O/P) with led connected
as load is shown in fig: 3.3.3.
Fig 3.9: Circuit diagram of Regulated Power Supply with Led connection
• 230V AC MAINS
• TRANSFORMER
• BRIDGE RECTIFIER(DIODES)
• CAPACITOR
• VOLTAGE REGULATOR(IC 7805)
• RESISTOR
• LED(LIGHT EMITTING DIODE)
4.1.2 NodeMCU
It is used to monitor changes in air quality and to detect the presence of various
gases. In this sensor mostly used in manufacturing industries, space stations, and
chemical industries, the alternative gas sensor is available, but mostly, MQ2 is
used in IoT industries.
Different types of Gas Sensors:
MQ2 Sensor
4.1.4 Ultrasonic Sensor
The ultrasonic sensor or ultrasonic transducer is one of the most popular sensors
used in applications of IoT.
Working Principle: The transmitter transmits the ultrasonic waves in the air of
forwarding direction, and when an object is there, it will reflect towards the
receiver. The receiver (Photodiode) receives the ultrasonic waves.
Pin Definition
Trig The Trigger is an input pin. It will have kept high for 10uS
Applications
Critical pumps and motors
Cooling towers and fans
Slow speed rolls
Rotary and screw compressors
Features
Monitors and protects 24/7
Installs quickly and easily
Provides critical machine information
Avoids costly catastrophic failures
4.1.6 GPS Sensor
GPS receivers are generally used in smartphones, fleet management system, military
etc. for tracking or finding location.
Global Positioning System (GPS) is a satellite-based system that uses satellites and
ground stations to measure and compute its position on Earth.
GPS is also known as Navigation System with Time and Ranging (NAVSTAR)
GPS.
GPS receiver needs to receive data from at least 4 satellites for accuracy purpose.
GPS receiver does not transmit any information to the satellites.
This GPS receiver is used in many applications like smartphones, Cabs, Fleet
management etc.
4.1.7 Stepper Motor Control
A stepper motor is a brushless DC-electric motor that divides a full rotation into a
number of equal steps. The position of the motor can be commanded to move and
hold at one of these steps without feedback. The stepper motor is used in a wide
range of applications involving precision motion control.
Active buzzer 5V Rated power can be directly connected to a continuous sound, this
section dedicated sensor expansion module and the board in combination, can
complete a simple circuit design, to "plug and play.
4.2 SOFTWARE COMPONENTS
The set of programs which enable the data collection, storage, processing,
manipulating and instructing to and from IoT hardware components are called IoT
Software. The operating systems, middleware or firmware, apps, etc., are few
examples.
Software components
Blynk is a new platform that allows you to quickly build interfaces for controlling
and monitoring your hardware projects from your iOS and Android device. After
downloading the Blynk app, you can create a project dashboard and arrange buttons,
sliders, graphs, and other widgets onto the screen. Using the widgets, you can turn
pins on and off or display data from sensors.
Whatever your project is, there are likely hundreds of tutorials that make the
hardware part pretty easy, but building the software interface is still difficult. With
Blynk, though, the software side is even easier than the hardware. Blynk is perfect
for interfacing with simple projects like monitoring the temperature of your fish tank
or turning lights on and off remotely. Personally, I’m using it to control RGB LED
strips in my living room.
CHAPTER-5
UML DIAGRAMS
SYSTEM IMPLEMENTATION:
~~Arduino code ~~
int s2,s7;
int s1,s8;
int s4;
void setup() {
// put your setup code here, to run once:
pinMode(9,OUTPUT);//left motor
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);//right motor
pinMode(12,OUTPUT);
pinMode(A0,INPUT);
pinMode(A3,INPUT);
pinMode(2,INPUT);
pinMode(A5,INPUT);
pinMode(s4,INPUT);
}
//1=white
//0=black
void loop() {
// put your main code here, to run repeatedly:
s2=digitalRead(3);
s7=digitalRead(A4);
s1=digitalRead(2);
s8=digitalRead(A5);
s4=digitalRead(A1);
Traffic signal
void loop()
{
digitalWrite(r,HIGH) ;
delay(sec*5);
digitalWrite(r,LOW) ;
digitalWrite(y,HIGH) ;
delay(sec*5);
digitalWrite(y,LOW) ;
digitalWrite(g,HIGH) ;
delay(sec*5);
digitalWrite(g,LOW) ;
rc_keyboard_control.ino
void setup() {
pinMode(right_pin, OUTPUT);
pinMode(left_pin, OUTPUT);
pinMode(forward_pin, OUTPUT);
pinMode(reverse_pin, OUTPUT);
Serial.begin(115200);
}
void loop() {
//receive command
if (Serial.available() > 0){
command = Serial.read();
}
else{
reset();
}
send_command(command,time);
}
void reset(){
digitalWrite(right_pin, HIGH);
digitalWrite(left_pin, HIGH);
digitalWrite(forward_pin, HIGH);
digitalWrite(reverse_pin, HIGH);
}
//reset command
case 0: reset(); break;
// single command
case 1: forward(time); break;
case 2: reverse(time); break;
case 3: right(time); break;
case 4: left(time); break;
//combination command
case 6: forward_right(time); break;
case 7: forward_left(time); break;
case 8: reverse_right(time); break;
case 9: reverse_left(time); break;
Test
author__ = 'zhengwang'
import socket
import time
class SensorStreamingTest(object):
def __init__(self, host, port):
self.server_socket = socket.socket()
self.server_socket.setsockopt(socket.SOL_SOCKET,
socket.SO_REUSEADDR, 1)
self.server_socket.bind((host, port))
self.server_socket.listen(0)
self.connection, self.client_address = self.server_socket.accept()
self.host_name = socket.gethostname()
self.host_ip = socket.gethostbyname(self.host_name)
self.streaming()
def streaming(self):
try:
print("Host: ", self.host_name + ' ' + self.host_ip)
print("Connection from: ", self.client_address)
start = time.time()
while True:
sensor data = float(self connection.recv(1024))
print("Distance: %0.1f cm" % sensor data)
if __name__ == '__main__':
h, p = "192.168.1.100", 8002
SensorStreamingTest(h, p)
Setting up environment with Anaconda
Install miniconda(Python3) on your computer
Create auto-rccar environment with all necessary libraries for this project
Conda env create -f environment.yml
To exit, simply close the terminal window. More info about managing Anaconda
environment, please see here.
raspberryPi /
stream_client.py: stream video frames in jpeg format to the host computer
ultrasonic_client.py: send distance data measured by sensor to the host computer
Arduino /
rc keyboard control.ino: control RC car controller
computer/
cascade xml/
trained cascade classifiers
chess board/
images for calibration, captured by pi camera
How to drive
Testing: Flash rc keyboard control.ino to Arduino and run rc_control_test.py to
drive the RC car with keyboard. Run stream_server_test.py on computer and then
run stream_client.py on raspberry pi to test video streaming. Similarly,
ultrasonic_server_test.py and ultrasonic_client.py can be used for sensor data
streaming testing.
Cascade classifiers training (optional): Trained stop sign and traffic light classifiers
are included in the cascade xml folder, if you are interested in training your own
classifiers, please refer to Open CV doc and this great tutorial.
Self-driving in action: First run rc_driver.py to start the server on the computer (for
simplified no object detection version, run rc_driver_nn_only.py instead), and then
run stream_client.py and ultrasonic_client.py on raspberry pi.
CHAPTER 7
SYSTEM TESTING
The purpose of testing is to discover errors. Testing is the process of trying to discover every
conceivable fault or weakness in a work product. It provides a way to check the functionality
of components, sub assemblies, assemblies and/or a finished product It is the process of
exercising software with the intent of ensuring that theSoftware system meets its requirements
and user expectations and does not fail in an unacceptable manner. There are various types of
test. Each test type addresses a specific testing requirement.
Unit testing is usually conducted as part of a combined code and unit test phase of the
software lifecycle, although it is not uncommon for coding and unit testing to be conducted as
two distinct phases.
Software integration testing is the incremental integration testing of two or more integrated
software components on a single platform to produce failures caused by interface defects.
The task of the integration test is to check that components or software applications, e.g.
components in a software system or – one step up – software applications at the company level
– interact without error.
System testing ensures that the entire integrated software system meets requirements. It
tests a configuration to ensure known and predictable results. An example of system testing is
the configuration oriented system integration test. System testing is based on process
descriptions and flows, emphasizing pre-driven process links and integration points.
6.1.5 White Box Testing
White Box Testing is a testing in which in which the software tester has knowledge of the
inner workings, structure and language of the software, or at least its purpose. It is purpose. It
is used to test areas that cannot be reached from a black box level.
SCREENSHOTS
CHAPTER 9
FUTURE SCOPE
Our project “IOT based Smart Vehicle Automation and Control with
Enhanced Safety, Security and Tracking System using Wireless Sensors” is
mainly intended to operate a devices using Android mobile phone through WI-FI
CHAPTER 10
CONCLUSION
Projections for the impact of IoT on the Internet and economy are
impressive, with some anticipating as many as 100 billion connected IoT
devices and a global economic impact of more than $11 trillion by 2025.
The potential economic impact of IoT is huge, but the journey to IoT
adoption is not a seamless one. There are many challenges that face
companies looking to implement IoT solutions. However, the risks and
disadvantages associated with IoT can be overcome.
CHAPTER 11
BIBLOGRAPHY
1. www.wikipedia.com
2. www.allaboutcircuits.com
3. www.microchip.com
4. www.howstuffworks.com
Books referred:
6. Embedded C –Michael.J.Pont.
REFRENCES