0% found this document useful (0 votes)
136 views58 pages

Driver Monitoring and Assisting Device

Uploaded by

Praveen Mathias
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
136 views58 pages

Driver Monitoring and Assisting Device

Uploaded by

Praveen Mathias
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 58

Application of IoT and Machine Learning for Real-time Driver Monitoring

and Assisting Device

ABSTRACT

The increasing number of vehicles on Indian roads and low traffic rules
enforcement lead to multiple human-error induced crashes and fatalities. In this
paper, we propose a driver monitoring and assisting device which employs IoT
sensors, like alcohol sensor and air pressure sensor for sobriety check and
machine learning algorithms to detect micro-sleep and frequent yawns for
drowsiness detection. The device turns on and asks the driver to blow into the
mouthpiece. After a clean and proper blow, the driver is allowed to switch the
ignition on. Thereafter, the device constantly monitors the driver using a camera
for signs of fatigue, and uses the vehicle’s sound system or a buzzer to alert the
drowsy driver. The goal of our work is to develop and deploy a device that will
curb drunk and drowsy driving mishaps and inculcate responsible driving
behaviour among drivers.

Index Terms—Internet of Things, Sobriety Check, Machine Learning,


Fatigue Check, Drowsiness Detection, Yawn Detection, Micro-Sleep Detection.
CHAPTER 1

INTRODUCTION

1.1 OVERVIEW OF THE PROJECT

With the world’s second largest road network, after the US, Indian roads
ply over 250 million registered motor vehicles as of 2017. A rapid urbanization
and motorization have marked a linear growth in vehicles over the last 70 years.
This, unfortunately, increases the road casualties as well, killing sixteen people
every hour and twenty children every day on Indian roads. A recent WHO
report, among many others, enumerated human errors such as drunk driving,
drowsiness and distractions as one of the leading risk factors of road accidents.
Surprisingly, the driving under the influence (DUI) incidents are not limited to a
certain age group or a section of society. Hence, it is not lack of awareness but
disregard for the rules that lead to many DUI casualties. Such incidents strain
the lives of affected and associated people, mentally, physically and financially.
With the unprecedented advancement of technology, we can now leverage the
internet of things (IoT) technology and machine learning (ML) techniques to
effectively design a system that curbs the human errors on the road.

The current system of random sobriety checkpoints by police officials is


insufficient, reducing accidents by only 18% to 24%. Moreover, several
countries such as Australia, Austria, Canada, and the US etc. have adopted
alcohol-based ignition interlock devices (ABIIDs) working on fuel cell
technology. The data from these devices are downloaded and checked every 30,
60 or 90-day period, proving ABIIDs a tool for reactive disciplinary action for
DUI offenses. However, the proposed proactive approach of deploying IoT
sensors for real-time DUI offense alert can help in reducing DUI related
casualties. Additionally, real-time camera feed analysis for drowsiness detection
to identify micro-sleep and excessive yawning while driving as a result of DUI,
fatigue or both can further help bring down the human-error induced accidents.
Overall, our system is an IoT and ML application for reducing road crashes and
fatalities due to human negligence.
1.1.1 History

One of the very first recognizably modern embedded systems was the
Apollo Guidance Computer, developed by Charles Stark Draper at the MIT
Instrumentation Laboratory. At the project's inception, the Apollo guidance
computer was considered the riskiest item in the Apollo project as it employed
the then newly developed monolithic integrated circuits to reduce the size and
weight. An early mass-produced embedded system was the Automatics D-17
guidance computer for the Minuteman missile, released in 1961. When the
Minuteman II went into production in 1966, the D-17 was replaced with a new
computer that was the first high-volume use of integrated circuits.

Since these early applications in the 1960s, embedded systems have come
down in price and there has been a dramatic rise in processing power and
functionality. An early microprocessor for example, the Intel 4004, was
designed for calculators and other small systems but still required external
memory and support chips. In 1978 National Engineering Manufacturers
Association released a "standard" for programmable microcontrollers, including
almost any computer-based controllers, such as single board computers,
numerical, and event-based controllers.

As the cost of microprocessors and microcontrollers fell it became


feasible to replace expensive knob-based analog components such as
potentiometers and variable capacitors with up/down buttons or knobs read out
by a microprocessor even in consumer products. By the early 1980s, memory,
input and output system components had been integrated into the same chip as
the processor forming a microcontroller. Microcontrollers find applications
where a general-purpose computer would be too costly.
A comparatively low-cost microcontroller may be programmed to fulfill
the same role as a large number of separate components. Although in this
context an embedded system is usually more complex than a traditional
solution, most of the complexity is contained within the microcontroller itself.
Very few additional components may be needed and most of the design effort is
in the software. Software prototype and test can be quicker compared with the
design and construction of a new circuit not using an embedded processor.

1.1.2 Applications

Embedded systems are commonly found in consumer, cooking,


industrial, automotive, medical, commercial and military applications.

Telecommunications systems employ numerous embedded systems from


telephone switches for the network to cell phones at the end user. Computer
networking uses dedicated routers and network bridges to route data.

Consumer electronics include MP3 players, mobile phones, videogame


consoles, digital cameras, GPS receivers, and printers. Household appliances,
such as microwave ovens, washing machines and dishwashers, include
embedded systems to provide flexibility, efficiency and features. Advanced
HVAC systems use networked thermostats to more accurately and efficiently
control temperature that can change by time of day and season. Home
automation uses wired- and wireless-networking that can be used to control
lights, climate, security, audio/visual, surveillance, etc., all of which use
embedded devices for sensing and controlling.

Transportation systems from flight to automobiles increasingly use


embedded systems. New airplanes contain advanced avionics such as inertial
guidance systems and GPS receivers that also have considerable safety
requirements. Various electric motors — brushless DC motors, induction
motors and DC motors — use electric/electronic motor controllers.
Automobiles, electric vehicles, and hybrid vehicles increasingly use embedded
systems to maximize efficiency and reduce pollution. Other automotive safety
systems include anti-lock braking system (ABS), Electronic Stability Control
(ESC/ESP), traction control (TCS) and automatic four-wheel drive.

Medical equipment uses embedded systems for vital signs monitoring,


electronic stethoscopes for amplifying sounds, and various medical imaging
(PET, SPECT, CT, and MRI) for non-invasive internal inspections. Embedded
systems within medical equipment are often powered by industrial computers.

Embedded systems are used in transportation, fire safety, safety and


security, medical applications and life critical systems, as these systems can be
isolated from hacking and thus, be more reliable, unless connected to wired or
wireless networks via on-chip 3G cellular or other methods for IoT monitoring
and control purposes. [citation needed] For fire safety, the systems can be
designed to have greater ability to handle higher temperatures and continue to
operate. In dealing with security, the embedded systems can be self-sufficient
and be able to deal with cut electrical and communication systems. A new class
of miniature wireless devices called motes are networked wireless sensors.
Wireless sensor networking, WSN, makes use of miniaturization made possible
by advanced IC design to couple full wireless subsystems to sophisticated
sensors, enabling people and companies to measure a myriad of things in the
physical world and act on this information through IT monitoring and control
systems. These motes are completely self-contained, and will typically run off a
battery source for years before the batteries need to be changed or charged.

Embedded Wi-Fi modules provide a simple means of wirelessly enabling


any device that communicates via a serial port.

1.1.3 User Interface


Embedded systems range from no user interface at all, in systems
dedicated only to one task, to complex graphical user interfaces that resemble
modern computer desktop operating systems. Simple embedded devices use
buttons, LEDs, graphic or character LCDs (HD44780 LCD for example) with a
simple menu system.

More sophisticated devices that use a graphical screen with touch sensing
or screen-edge buttons provide flexibility while minimizing space used: the
meaning of the buttons can change with the screen, and selection involves the
natural behavior of pointing at what is desired. Handheld systems often have a
screen with a "joystick button" for a pointing device.

Some systems provide user interface remotely with the help of a serial
(e.g. RS-232, USB, I²C, etc.) or network (e.g. Ethernet) connection. This
approach gives several advantages: extends the capabilities of embedded
system, avoids the cost of a display, simplifies BSP and allows one to build a
rich user interface on the PC. A good example of this is the combination of an
embedded web server running on an embedded device (such as an IP camera) or
a network router. The user interface is displayed in a web browser on a PC
connected to the device, therefore needing no software to be installed.

1.2 IOT

The Internet of Things (IoT), sometimes referred to as the Internet of


Objects, will change everything—including ourselves. This may seem like a
bold statement, but consider the impact the Internet already has had on
education, communication, business, science, government, and humanity.
Clearly, the Internet is one of the most important and powerful creations in all
of human history. Now consider that IoT represents the next evolution of the
Internet, taking a huge leap in its ability to gather, analyze, and distribute data
that we can turn into information, knowledge, and, ultimately, wisdom. In this
context, IoT becomes immensely important. Already, IoT projects are under
way that promise to close the gap between poor and rich, improve distribution
of the world’s resources to those who need them most, and help us understand
our planet so we can be more proactive and less reactive. Even so, several
barriers exist that threaten to slow IoT development, including the transition to
IPv6, having a common set of standards, and developing energy sources for
millions—even billions—of minute sensors. However, as businesses,
governments, standards bodies, and academia work together to solve these
challenges, IoT will continue to progress. The goal of this paper, therefore, is to
educate you in plain and simple terms so you can be well versed in IoT and
understand its potential to change everything we know to be true today.

1.2.1 IoT as a Network of Networks

Currently, IoT is made up of a loose collection of disparate, purpose-built


networks. Today’s cars, for example, have multiple networks to control engine
function, safety features, communications systems, and so on. Commercial and
residential buildings also have various control systems for heating, venting, and
air conditioning (HVAC); telephone service; security; and lighting. As IoT
evolves, these networks, and many others, will be connected with added
security, analytics, and management capabilities. This will allow IoT to become
even more powerful in what it can help people achieve.
Fig 1.2 Internet as a network of networks

1.2.3 Why is IoT Important?

Before we can begin to see the importance of IoT, it is first necessary to


understand the differences between the Internet and the World Wide Web (or
web)—terms that are often used interchangeably. The Internet is the physical
layer or network made up of switches, routers, and other equipment. Its primary
function is to transport information from one point to another quickly, reliably,
and securely. The web, on the other hand, is an application layer that operates
on top of the Internet. Its primary role is to provide an interface that makes the
information flowing across the Internet usable.

1.3 System Overview

The concept of Internet of Things (IoT) started with things with identity
communication devices. The devices could be tracked, controlled or monitored
using remote computers connected through Internet. IoT extends the use of
Internet providing the communication, and thus inter-network of the devices
and physical objects, or ‘Things’. The two prominent words in IoT are
“internet” and “things”. Internet means a vast global network of connected
servers, computers, tablets and mobiles using the internationally used protocols
and connecting systems. Internet enables sending, receiving, or communicating
of information. Thing in English has number of uses and meanings. Dictionary
meaning of ‘Thing’ is a term used to reference to a physical object, an action or
idea, situation or activity, in case when we do not wish to be precise. IoT, in
general consists of inter-network of the devices and physical objects, number of
objects can gather the data at remote locations and communicate to units
managing, acquiring, organizing and analyzing the data in the processes and
services. It provides a vision where things (wearable, watch, alarm clock, home
devices, surrounding objects with) become smart and behave alive through
sensing, computing and communicating by embedded small devices which
interact with remote objects or persons through connectivity. The scalable and
robust nature of Cloud computing is allowing developers to create and host their
applications on it. Cloud acts as a perfect partner for IoT as it acts as a platform
where all the sensor data can be stored and accessed from remote locations.
These factors gave rise to the amalgamation of both technologies thus leading to
the formation of a new technology called Cloud of Things(CoT). In CoT the
things(nodes) could be accessed, monitored and controlled from any remote
location through the cloud. Due to high scalability in cloud any number of node
could be added or removed from the IoT system on a real time basis. In simple
terms IoT can be explained in form of an equation stating:

Physical Object + Controller, Sensor and Actuators + Internet = Internet of


Things

The ideal of creating a Smart City is now becoming possible with the
emergence of the Internet of Things. One of the key issues that smart cities
relate to are car parking facilities and traffic management systems. In present
day cities finding an available parking spot is always difficult for drivers, and it
tends to become harder with ever increasing number of private car users. This
situation can be seen as an opportunity for smart cities to undertake actions in
order enhance the efficiency their parking resources thus leading to reduction in
searching times, traffic congestion and road accidents. Problems pertaining to
parking and traffic congestion can be solved if the drivers can be informed in
advance about the availability of parking spaces at and around their intended
destination. Recent advances in creating low-cost, low-power embedded
systems are helping developers to build new applications for Internet of Things.
Followed by the developments in sensor technology, many modern cities have
opted for deploying various IoT based systems in and around the cities for the
purpose of monitoring. A recent survey performed by the International Parking
Institute reflects an increase in number of innovative ideas related to parking
systems. At present there are certain parking systems that claim to citizens of
delivering real time information about available parking spaces. Such systems
require efficient sensors to be deployed in the parking areas for monitoring the
occupancy as well as quick data processing units in order to gain practical
insights from data collected over various sources.

1.4 Need for IoT-Cloud Integration

Cloud computing and IoT have witnessed large evolution. Both the
technologies have their advantages, however several mutual advantages can be
foreseen from their integration. On one hand, IoT can address its technological
constraints such as storage, processing and energy by leveraging the unlimited
capabilities and resources of Cloud. On the other hand, Cloud can also extend
its reach to deal with real world entities in a more distributed and dynamic
fashion by the use of IoT. Basically, the Cloud acts as an intermediate between
things and applications, in order to hide all the complexities and functionalities
necessary for running the application. Below are some of the factors that led to
the amalgamation of Cloud and IoT.

1.4.1 Storage Capacity


IoT comprises of a large number of information sources (things), which
produce huge amounts of non-structured or semi-structured data. As a result IoT
requires collecting, accessing, processing, visualizing and sharing large amounts
of data. Cloud provides unlimited, low-cost, and on-demand storage capacity,
thus making it the best and most cost effective solution to deal with data
generated by IoT. The data stored on the Cloud can be accessed and visualized
from anywhere through standard APIs.

1.4.2 Computation Power

The devices being used under IoT have limited processing capabilities.
Data collected from various sensors is usually transmitted to more powerful
nodes where its aggregation and processing can be done. The computation
needs of IoT can be addressed by the use of unlimited processing capabilities
and on-demand model of Cloud. With the help of cloud computing, IoT systems
could perform real-time processing of data thus facilitating highly responsive
applications.

1.4.3 Communication Resources

The basic functionality of IoT is to make IP-enabled devices


communicate with one another through dedicated set of hardware. Cloud
computing offers cheap and effective ways of connecting, tracking, and
managing devices from anywhere over the internet. By the use of built-in
applications IoT systems could monitor and control things on a real-time basis
through remote locations.

1.4.4 Scalability

Cloud provides a scalable approach towards IoT. It allows increase or


decrease in resources in a dynamic fashion. Any number of “things” could be
added or subtracted from the system when cloud integration is provided. The
cloud allocates resources in accordance with the requirements of things and
applications.

1.4.5 Availability

Any time anywhere availability of resources becomes very easy with


cloud integration. Many of the cloud providers assure 5 nine availability. With
cloud, the applications are always up and running and continuous services are
being provided to the end users.

1.4.6 Interoperability

IoT involves the use of devices that are heterogeneous in nature. These
devices may have different hardware or software configurations as a result
causing compatibility issues. It becomes very difficult in an IoT environment to
ensure interoperability among these devices. Cloud helps in addressing this
problem as it provides a common platform where various devices can connect
and interact. Devices are allowed to share and exchange data in a format that is
acceptable to them.
CHAPTER 2

LITERATURE REVIEW

BACKGROUND

The traditional system of sobriety checkpoints to catch DUI offenders has


proved effective but cannot keep up with the increasing number of automobiles
on road. Being highly human intrinsic, it is prone to errors and biases. The
boom in IoT technology has led to many studies to build an alcohol detection
device. Reference [6] uses an alcohol sensor and GSM module, on crossing the
alcohol content threshold, the driver is alerted via a message. Reference [7], [8]
and [9] uses a micro-controller with alcohol sensor, GPS and WiFi modem, but
no mechanism is described to differentiate driver’s breath from ambient air.
Reference [10] uses an Arduino microcontroller with an alcohol sensor to
passively detect the alcohol content in the vehicle and sends a message with
GPS location, but it poses a major drawback of faulty assumption if anyone else
in the car is drunk. Reference [11] uses an eye blink sensor to detect drowsiness
of a driver. The proposed system requires the driver to wear an eye blink sensor
frame while driving. Reference [12] and [13] use face and eye localization,
followed by facial tracking, and then template matching. However, after facial
tracking [14] proposes supervised classification. Reference [15] uses a 3D
neural network architecture to train a model for detecting drowsiness. However,
a cost-effective real-time drowsiness detection system should use minimum
computational resources.

Hence, the existing sobriety check and fatigue check systems lack
usability in the real world. In this paper, we address the aforementioned
literature gaps by proposing a system that uses IoT sensors, alcohol gas sensor
MQ-3 and air pressure sensor BMP-280 to collect the blow samples from the
driver for sobriety check, 5-megapixel (MP) night vision camera for real-time
drowsiness detection, Raspberry Pi 3B+ (RPi) microprocessor with 1GB RAM
processes this data and
outputs the result on a liquid crystal display (LCD) and alerts the driver as well
as passenger(s) using vehicle’s sound system or a buzzer

2.1 Rico, J., Sancho, J., Cendon, B., & Camus, M. (2013, March).
Parking easier by using context information of a smart city: Enabling fast
search and management of parking resources. In Advanced Information
Networking and Applications Workshops (WAINA), 2013 27th
International Conference on (pp. 1380-1385). IEEE.

In the great majority of cities it is difficult and hardly expensive to create


more parking spaces for vehicles since they have almost reached its full
occupancy. Combining this problem with an inefficient use of parking spaces
leads to congestions due to aggregation of parking seekers and regular drivers.
Recent advances in low-cost, low-power embedded systems bring the
opportunity to develop new applications to solve these problems. In particular,
Smart Cities greatly enrich their sustainability by introducing new resource
management applications that rely in those constrained devices a significant part
of the functionality of the system. The proposed Smart Parking solution consists
mainly in the on-site deployment of an IoT solution to monitor and signalize the
state of availability of each single parking space, as well as using context
information generated by the city and its citizens to provide accurate responses
to driver's demands. Furthermore, this system improves the management of
parking resources by public authorities, for instance handling groups of parking
spaces facilitating the whole city traffic management. The integration of this
deployment into an existing live test-bed implies an easy task requiring just the
data collection through the available means of the parking spaces availability.
At the present time there exist living test-beds which can be used to integrate
these new functionalities for experimentation on IoT data level, to gain a better
knowledge and understanding of the M2M world, reducing costs, resources,
pollution and time.

2.2 Zheng, Y., Rajasegarar, S., & Leckie, C. (2015, April). Parking
availability prediction for sensor-enabled car parks in smart cities. In
Intelligent Sensors, Sensor Networks and Information Processing (ISSNIP),
2015 IEEE Tenth International Conference on (pp. 1-6). IEEE.

The growth in low-cost, low-power sensing and communication


technologies is creating a pervasive network infrastructure called the Internet of
Things (IoT), which enables a wide range of physical objects and environments
to be monitored in fine spatial and temporal detail. The detailed, dynamic data
that can be collected from these devices provide the basis for new business and
government applications in areas such as public safety, transport logistics and
environmental management. There has been growing interest in the IoT for
realising smart cities, in order to maximise the productivity and reliability of
urban infrastructure, such as minimising road congestion and making better use
of the limited car parking facilities. In this work, we consider two smart car
parking scenarios based on real-time car parking information that has been
collected and disseminated by the City of San Francisco, USA and the City of
Melbourne, Australia. We present a prediction mechanism for the parking
occupancy rate using three feature sets with selected parameters to illustrate the
utility of these features. Furthermore, we analyse the relative strengths of
different machine learning methods in using these features for prediction.

2.3 Zhou, F., & Li, Q. (2014, November). Parking Guidance System Based
on ZigBee and Geomagnetic Sensor Technology. In Distributed Computing
and Applications to Business, Engineering and Science (DCABES), 2014
13th International Symposium on (pp. 268-271). IEEE.

Concerning the phenomenon that common parking service could not satisfy the
increasing demand of the private vehicle owners, an intelligent parking
guidance system based on Zig Bee network and geomagnetic sensors was
designed. Real-time vehicle position and related traffic information were
collected by geomagnetic sensors around parking lots and updated to center
server via Zig Bee network. On the other hand, out-door Liquid Crystal Display
screens controlled by center server can display information of available parking
places. In this paper, guidance strategy was divided into four levels, which
could provide clear and effective information to drivers. The experimental
results prove that the distance detection accuracy of geomagnetic sensors was
within 0.4m, and the lowest package loss rate of the wireless network in the
range of 150m is 0%. This system can provide solution for better parking
service in intelligent cities. With the acceleration of transportation construction
pace, intelligence transportation has become the development direction of urban
traffic management, it is an important way to ease traffic congestion and
improve the efficiency of transportation and management. Current road traffic
information collection technologies mainly include that GPRS wireless
communication technology, infrared detection technology and radio frequency
identification (RFID) technology. GPRS communication technology must pay
extra fee for network using to operators and will easily lead to communication
delay when the network is busy; infrared detection communication distance is
shorter and will be affected by car's thermal radiation; although passive RFID
technology can achieve accurate vehicles' position and anti-jamming
performance is ideal, it only supports star network, the amount of transferred
data and communication distance will be very limited, so it is not easy to mass
deployment and difficult to promote.
2.4 Botta, A., de Donato, W., Persico, V., & Pescapé, A. (2014, August). On
the Integration of Cloud Computing and Internet of Things. In Future
Internet of Things and Cloud (FiCloud), 2014 International Conference on
(pp. 23-30). IEEE.

Cloud computing and Internet of Things (IoT), two very different


technologies, are both already part of our life. Their massive adoption and use is
expected to increase further, making them important components of the Future
Internet. A novel paradigm where Cloud and IoT are merged together is
foreseen as disruptive and an enabler of a large number of application scenarios.
In this paper we focus our attention on the integration of Cloud and IoT, which
we call the CloudIoT paradigm. Many works in literature have surveyed Cloud
and IoT separately: their main properties, features, underlying technologies, and
open issues. However, to the best of our knowledge, these works lack a detailed
analysis of the CloudIoT paradigm. To bridge this gap, in this paper we review
the literature about the integration of Cloud and IoT. We start analyzing and
discussing the need for integrating them, the challenges deriving from such
integration, and how these issues have been tackled in literature. We then
describe application scenarios that have been presented in literature, as well as
platforms -- both commercial and open source -- and projects implementing the
CloudIoT paradigm. Finally, we identify open issues, main challenges and
future directions in this promising field. The Internet of Things (IoT) paradigm
is based on intelligent and self configuring nodes (things) interconnected in a
dynamic and global network infrastructure. It represents one of the most
disruptive technologies, enabling ubiquitous and pervasive computing
scenarios. IoT is generally characterized by real world and small things with
limited storage and processing capacity, and consequential issues regarding
reliability, performance, security, and privacy. On the other hand, Cloud
computing has virtually unlimited capabilities in terms of storage and
processing power, is a much more mature technology, and has most of the IoT
issues at least partially solved.

2.5 Ji, Z., Ganchev, I., O'droma, M., & Zhang, X. (2014, August). A
cloudbased intelligent car parking services for smart cities. In General
Assembly and Scientific Symposium (URSI GASS), 2014 XXXIth URSI
(pp. 1-4). IEEE.

This paper presents the generic concept of using cloud-based intelligent


car parking services in smart cities, as an important application deployed on the
Internet of Things (IoT) paradigm. The corresponding IoT sub-system includes
sensor layer, communication layer, and application layer. A high-level view of
the system architecture is outlined. To demonstrate the provision of car parking
services with the proposed platform, a cloud-based intelligent car parking
system for use within a University campus is described along with details of its
design and implementation. Intelligent car parking services are an important
part of the Intelligent Transport Systems (ITS) with a primary purpose to find,
allocate, reserve, and provide the ‘best’ car parking lot for each individual
user/driver. Researchers show that more than 66% of drivers are willing to pay
for car parking during working hours. This directly adds value to the car parking
business, which is a stimulus for the development of intelligent car parking
services for smart cities.

2.6 International Parking Institute, “2012 Emerging Trends in Parking”.

The International Parking Institute (IPI), the world’s largest association


representing the parking industry, conducted an online survey among parking
professionals to determine emerging trends and solicit input on a range of
topics. The survey was conducted between May 8 and May 22, 2012 among
members of the International Parking Institute and its parking communities. The
single most important trend in parking today is the technological revolution that
is driving the industry. Three of the top five trends identified in this study focus
on technology, whether it’s increased demand for cashless or electronic
payment, innovative technologies to improve access control and payment
automation, or increased real-time communication of pricing and availability
via mobile phone or PDA components.

2.7 Ballon, P., Glidden, J., Kranas, P., Menychtas, A., Ruston, S., & Van
Der Graaf, S. (2011, October). Is there a Need for a Cloud Platform for
European Smart Cities?. In eChallenges e-2011 Conference Proceedings,
IIMC International Information Management Corporation.

EPIC - the “European Platform for Intelligent Cities”- is more than just
an IT platform; it is a one-stop-shop where small to medium sized Cities in
Europe can find real, affordable solutions (products and services) to materialize
the “Smart Cities” concept efficiently and cost-effectively. Instead, the EPIC
Smart City roadmap, service catalogue and cloud platform enable every city in
Europe to access and deploy innovative Smart City applications that meet their
budgets and needs. EPIC offers city managers a Roadmap for their journey
towards becoming a smart city in a strategic way. The Roadmap consists of a
short-term assessment exercise covering vision, budget and delivery. EPIC also
uses its cloud platform (currently based on IBM infrastructure) to deliver Smart
City solutions “as a service”. The Roadmap and Cloud Platform provide the
foundations for EPIC's unique selling point: a marketplace for Smart City
services. In this marketplace, EPIC brings together service providers and
information/data providers (from private and public sector) in order to aggregate
“Smart City services” with added value for citizens, city visitors, businesses in
the city and the city itself.

2.8 Suciu, G., Vulpe, A., Halunga, S., Fratu, O., Todoran, G., & Suciu, V.
(2013, May). Smart cities built on resilient cloud computing and secure
internet of things. In Control Systems and Computer Science (CSCS), 2013
19th International Conference on (pp. 513-518). IEEE.

Cloud Computing and Internet of Things (IoT) are currently two of the
most popular ICT paradigms that are expected to shape the next era of
computing. The convergence between cloud computing and IoT has become a
hot topic over the last few years because of the benefits that IoT could have
from the distributed nature of cloud computing infrastructures. This paper
proposes a new platform for using cloud computing capacities for provision and
support of ubiquitous connectivity and real-time applications and services for
smart cities' needs. We present a framework for data procured from highly
distributed, heterogeneous, decentralized, real and virtual devices (sensors,
actuators, smart devices) that can be automatically managed, analyzed and
controlled by distributed cloud-based services.

2.9 Chen, S. Y., Lai, C. F., Huang, Y. M., & Jeng, Y. L. (2013, July).
Intelligent home-appliance recognition over IoT cloud network. In Wireless
Communications and Mobile Computing Conference (IWCMC), 2013 9th
International (pp. 639-643). IEEE.

In recent years, under the concern of energy crisis, the government has
actively cooperated with research institutions in developing smart meters. As
the Internet of Things (IoT) and home energy management system become
popular topics, electronic appliance recognition technology can help users
identifying the electronic appliances being used, and further improving power
usage habits. However, according to the power usage habits of home users, it is
possible to simultaneously switch on and off electronic appliances. Therefore,
this study discusses electronic appliance recognition in a parallel state, i.e.
recognition of electronic appliances switched on and off simultaneously. This
study also proposes a non-invasive smart meter system that considers the power
usage habits of users unfamiliar with electronic appliances, which only requires
inserting a smart meter into the electronic loop. Meanwhile, this study solves
the problem of large data volume of the current electronic appliance recognition
system by building a database mechanism, electronic appliance recognition
classification, and waveform recognition. In comparison to other electronic
appliance recognition systems, this study uses a low order embedded system
chip to provide low power consumption, which have high expandability and
convenience. Differing from previous studies, the experiment of this study
considers electronic appliance recognition and the power usage habits of general
users. The experimental results showed that the total recognition rate of a single
electronic appliance can reach 96.14%, thus proving the feasibility of the
proposed system.

2.10 Dash, S. K., Mohapatra, S., & Pattnaik, P. K. (2010). A survey on


applications of wireless sensor network using cloud computing.
International Journal of Computer science & Engineering Technologies (E-
ISSN: 2044-6004), 1(4), 50-55.

Popularity of cloud computing is increasing day by day in distributed


computing environment. There is a growing trend of using cloud environments
for storage and data processing needs. Cloud computing provides applications,
platforms and infrastructure over the internet. It is a new era of referring to
access shared computing resources. On the other hand, wireless sensor networks
have been seen as one of the most essential technologies for the 21st century
where distributed spatially connected sensor node automatically forms a
network for data transmission and receive among themselves is popularly
known as Sensor Network. For security and easy access of data, cloud
computing is widely used in distributed/mobile computing environment. This is
possible due to miniaturization of communication technology. Many researchers
have cited different types of technology in this context. But the application
scenario is of important consideration while designing a specific protocol for
Sensor network with reference to Cloud Computing. In this paper, we surveyed
some typical applications of Sensor Network using Cloud computing as
backbone. Since Cloud computing provides plenty of application, platforms and
infrastructure over the Internet; it may have combined with Sensor network in
the application areas such as environmental monitoring, weather forecasting,
transportation business, healthcare, military application etc. Bringing various
WSNs deployed for different applications under one roof and looking it as a
single virtual WSN entity through cloud computing infrastructure is novel.
CHAPTER 3

SYSTEM ANALYSIS

3.1 EXISTING SYSTEM

• The existing system uses an eye blink sensor to detect drowsiness of a


driver. The proposed system requires the driver to wear an eye blink
sensor frame while driving. The researcher uses a 3D neural network
architecture to train a model for detecting drowsiness

3.1.1 DISADVABTAGES

• Cannot keep up with the increasing number of automobiles on road

• Cost-effective real-time drowsiness detection system should use


minimum computational resources.

3.2 PROPOSED SYSTEM

• In this paper, we propose a driver monitoring and assisting device which


employs IoT sensors, like alcohol sensor and air pressure sensor for
sobriety check and machine learning algorithms to detect micro-sleep and
frequent yawns for drowsiness detection. The device turns on and asks
the driver to blow into the mouthpiece. After a clean and proper blow, the
driver is allowed to switch the ignition on. Thereafter, the device
constantly monitors the driver using a camera for signs of fatigue, and
uses the vehicle’s sound system or a buzzer to alert the drowsy driver

3.2.1 ADVANTAGES
• Cost-effective real-time drowsiness detection system should use
maximum computational resources.

3.3 PROCESSING UNIT

It comprises of Arduino which is a processor on chip. The processing unit


acts like an intermediate between the sensors and cloud. All the sensors are
wirelessly connected to the processing unit. A single raspberry pi unit comprises
of 26 GPIO pins i.e. 26 different sensors can be connected to it. However, we
can increase this number by attaching a multiplexer (MUX). to it. It is essential
that the ground of raspberry pi and sensors must be connected in order to
transfer data using the GPIO pins. There is a python script running on the chip
that checks the status of various GPIO pins and updates this information onto
the cloud. Data collected from various sensors is sent to the raspberry pi through
the esp8266 chip. The raspberry pi then transmits this data to the IBM MQTT
Server through MQTT protocol over a channel. MQTT (Message Queue
Telemetry Transport) Protocol is a publish-subscribe based "light weight"
messaging protocol that is used on top of the TCP/IP protocol. It is designed to
establish connections across remote locations where limited amount of data
needs to be transferred or in cases of low bandwidth availability.

3.4 MOBILE APPLICATION

The mobile application acts like an interface for the end users to interact
with the system. The application is developed in Apache Cordova and Angular
Js framework using Javascript as a programming language. The purpose of
using Apache Cordova is to create applications that can run on both android and
iOS platforms with the same source code. The application is connected with the
IBM MQTT server through a secure channel and a 2 factor authorization. The
purpose of this mobile application is to provide information regarding
availability of parking spaces and allowing the end user to book a slot
accordingly. Transfer of data takes place in JSON format between IBM MQTT
server and the mobile application. In order to ensure proper communication
both the Raspberry pi and mobile application must be subscribed to a particular
channel on IBM MQTT server.

3.5 THE CLOUD

The IBM MQTT server is hosted on cloud. Cloud acts as a data base to
store all the records related to parking areas and end users that have access to
the system. It keeps a track of every user connected to the system and maintains
information such as time at which the car was parked, time duration for parking
a car, amount paid by the user and mode of payment.

It is due to the flexible nature of cloud which permits the system to add
any number of users at any time of the day. Continuous backup is made of the
data stored on cloud in order to ensure easy and quick recovery of data in case
of any kind of system failure.

On closely looking at the figure one gets to see that empty parking spaces
are indicated by red light in Lane A whereas green light in Lane B. This is due
to the fact that in case of Lane A although there is no car currently parked but
there still is a red light because the slot has already been booked by some user.
On the other hand, the parking slot in Lane B shows green light because it
neither has a booking nor a car parked in it.
CHAPTER 4

SYSTEM IMPLEMENTATION

4.1 ARCHITECTURAL STRUCTURE

Fig 4.1 System Design

EXPLANATION
• The 12V input from vehicle’s battery is converted into 5V using a voltage
regulator and is fed to RPi, which in turn powers all other devices. The
two parts of the system are, sobriety and fatigue check. In the sobriety
check, MQ-3 and BMP-280, comprising a movable mouthpiece, feed data
into RPi. RPi processes this data and outputs the result on the LCD
screen, alerts the driver and passengers and controls the ignition system
of the vehicle through a relay. In the fatigue check, camera sends a live
video feed to RPi, where it uses an ML algorithm to infer the alert and
drowsy states of driver

4.2 DATA FLOW DIAGRAM


Fig 4.2 Data Flow Diagram

4.3 METHODOLOGY
A cost-effective real-time driver monitoring and assisting system
employing sobriety and fatigue check with the help of IoT technology and ML
algorithms is a highly usable device for Indian population to curb human-error
on roads and develop a responsible driving behaviour. The proposed system
interfaces with the vehicle closely. A vehicle turns on in 3 steps. First, the driver
inserts the key in the keyhole and turns once, powering up the starter motor.
Second, the driver turns the key further, turning the battery on and
starting the engine cycle. Finally, on the last turn, spark plug fires, turning the
ignition on. Our device takes power from the vehicle and controls its ignition
system; hence it fits right between step 2 and 3.
The proposed system uses Raspberry Pi 3B+ microprocessor, depicted in
figure 1, at its heart. It processes all the data from IoT sensors and camera;
applies small computations and ML algorithms on it to infer the driver’s
behaviour. While RPi provides limited computational resources, they were
sufficient or our use case.

Fig. 4.3. RPi microprocessor


The system uses an air pressure sensor BMP-280 and an alcohol gas sensor
MQ-3, depicted in figure 2 and 3 respectively, to detect a proper blow and the
alcohol content in a driver’s blown breath. It also uses an analog to digital
converter with MQ-3. BMP-280, MQ-3 and ADC together constitute a movable
mouthpiece.
The data received from the sensors is fed to RPi to analyse and a message with
the sobriety state of the driver is displayed on the LCD, depicted on figure 4.
The other output devices of the system are LED lights, speaker or buzzer.

If the driver is found drunk, the microprocessor keeps the relay, depicted
in figure 5, off and power is not supplied to turn on the ignition system of the
vehicle. If the driver is sober, the relay is turned on and the driver is able to start
the vehicle.

The system uses a 5-MP camera, depicted in figure4.5. Since probability


of drowsiness is higher during night time, it is essential to have night vision
enabled in the camera. Hence, infrared lights are used to capture an video at any
light intensity. The video feed from the camera is sent to the microprocessor to
detect the signs of drowsiness such as micro-sleep and yawns. The video feed is
analysed at the rate of a frame every two seconds. If the microprocessor
observes
micro-sleep for 3 consequent frames or 5 consecutive yawns, an alarm is raised
using a vehicle’s sound system or a buzzer.
Fig. 4.4. MQ-3 alcohol gas sensor.

Fig. 4.5. BMP-280 pressure sensor

The block diagram of the architecture of the system is depicted in figure


7. The 12V input from vehicle’s battery is converted into 5V using a voltage
regulator and is fed to RPi, which in turn powers all other devices. The two
parts of the system are, sobriety and fatigue check. In the sobriety check,
MQ-3 and BMP-280, comprising a movable mouthpiece, feed data into RPi.
RPi processes this data and outputs the result on the LCD screen, alerts the
driver and passengers and controls the ignition system of the vehicle through a
relay. In the fatigue check, camera sends a live video feed to RPi, where it uses
an ML algorithm to infer the alert and drowsy states of driver.
Fig. 4.6. IR-enabled camera for night vision.

4.3.1 SOBRIETY CHECK

The components of the system for sobriety check are alcohol gas sensor
MQ-3, air pressure sensor BMP-280, analogy to digital converter (ADC) ADS-
1115, RPi microprocessor, LCD screen, speaker or buzzer, LED lights and a 5V
relay. The flow diagram of sobriety check is given.

_ Connecting sensors and ADC: MQ-3 is a low-cost semiconductor


sensor with high-sensitivity to alcohol gases from concentration of
0.005mg/100ml to 50mg/100ml. It has tin oxide as the resistive material, which
gives higher conductivity as the concentration of alcohol gases increases. MQ-3
is an analog sensor, hence, we use 16-bit ADC to convert the analogy values to
digital values.
BMP-280 is a small absolute barometric air pressure sensor, based on Piezo-
resistive pressure sensing element, used for pressure and temperature
measurement. It has built-in ADC.

_ Calibration of sensors: As the device is powered on and button is


triggered, both MQ-3 and BMP-280 are calibrated for 30 seconds, by
aggregating the ambient values of pressure and alcohol concentration. While
performing the calibration, sudden deviations in sensor’s data which may be due
to erroneous working are ignored. Thereafter, driver is prompted to blow air
into the mouth piece. The values obtained by the sensors are processed by RPi.

_ Check alcohol content on a blow: BMP-280 perceives a sudden change


in pressure and temperature values when blown into. Prolonged increase in the
these values i.e. for 6 consecutive seconds registers a blow. Hence, BMP-280
ensures the person blows sufficiently hard which requires him to use his lungs
to provide a legit breath for the test. If intensity of blow crosses a certain
threshold, the blow is considered valid. The time-period of 6 seconds was
chosen empirically. The device stores the data for BMP-280 and MQ-3
simultaneously; hence, MQ-3 data
during the 6 seconds of blow is used to calculate the alcohol content in the
driver’s breath. MQ-3 sensor gives us values in voltage which are converted to
parts per
million (PPM) and mg/100ml.

_ Perception of MQ-3 output: The permissible limit of alcohol content in


a driver’s body in India is 30mg/100ml of blood per 300 PPM [21]. Therefore,
we have defined 3 levels of sobriety, namely, sober, mildly drunk, drunk for
breath alcohol levels below 10mg/100ml, between 10mg/100ml and
30mg/100ml of blood and above 30mg/100ml respectively. When a driver is
sober, it is indicated by a green LED and mild drunkenness is indicated by a
yellow LED; in both the cases, power is supplied to ignition and driver can
drive the vehicle.
However, if a driver is drunk, it is indicated by an alarm and red LED; power is
not supplied to ignition, refraining the driver from driving.

4.3.2 FATIGUE CHECK


The components of the system for a fatigue check are IR-enabled camera,
RPi microprocessor, LCD screen and a speaker or a buzzer and uses ML
algorithms to identify the signs of drowsiness in a driver’s behavior. The flow
diagrams
of fatigue check is given in figure 9.

_ Connecting camera to RPi: The camera is connected to RPi using a


camera cable and is positioned facing the driver such that in well-lit
environment, camera is able to capture a clear image of the driver’s face, in
low-light intensities infrared lights illuminate the camera image and doesn’t
pose distraction to the driver.

_ Facial Landmark Detection: Fatigue check is initiated when the ignition


has started. Hence, in the stream of frames, the device tries to identify faces. On
finding a face, facial landmark detection is used to extract eyes and mouth. The
68 facial landmark coordinates from dlib facial landmark predictor are given in
figure

Fig. 4.7. Facial Landmarks


Micro-sleep Detection: With the help of dlib facial landmark predictor,
eyes are detected in the image. Thereafter, we monitor the eye aspect ratio
(EAR).

where Pn is the facial landmark point at number ‘n’ in figure 10. EAR for
an open eye is larger than EAR for a closed eye. Hence, a sudden drop in EAR
for 3 consecutive frames or 6 seconds is assumed to be a microsleep. The
threshold for change in EAR was empirically found to be 0.18 in our system.

4.3.3 ALERT THE DRIVER:


The system monitors one frame every 2 seconds. If the driver’s eyes is
closed in 3 consecutive frames i.e. for 6 seconds and/or the driver has yawned 5
times in the journey, an alarm is raised and the device prompts the driver to take
a break.
CHAPTER 5

OVERVIEW OF HARDWARE

 Arduino
 16x2 LCD
 WIFI Chip
 Ultrasonic Sensor

5.1 ARDUINO UNO

5.1.1 OVERVIEW

The Arduino Uno is a microcontroller board based on the AT mega 328.


It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6
analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an
ICSP header, and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power it
with a AC-to-DC adapter or battery to get started. The Uno differs from all
preceding boards in that it does not use the FTDI USB-to-serial driver chip.
Instead, it features the Atmega16U2 (Atmega8U2 up to version R2)
programmed as a USB-to-serial converter. Board has the following new
features:

pinout: added SDA and SCL pins that are near to the AREF pin and two
other new pins placed near to the RESET pin, the IOREF that allow the shields
to adapt to the voltage provided from the board. In future, shields will be
compatible both with the board that use the AVR, which operate with 5V and
with the Arduino Due that operate with 3.3V. The second one is a not connected
pin, that is reserved for future purposes.

Atmega 16U2 replace the 8U2. "Uno" means one in Italian and is named
to mark the upcoming release of Arduino 1.0. The 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; for a comparison with previous version 2.2 Schematic & Reference
Design The Arduino reference design can use an Atmega8, 168, or 328, Current
models use an ATmega328, but an Atmega8 is shown in the schematic for
reference. The pin configuration is identical on all three processors. 2.3
Summary Microcontroller - ATmega328 Operating Voltage - 5V Input Voltage
- 7-12V (Recommended) Input Voltage (limits) - 6-20V Digital I/O Pins - 14
(of which 6 provide PWM output) Analog Input Pins - 6 DC Current per I/O Pin
- 40 mA DC Current for 3.3V Pin - 50 mA Flash Memory - 32 KB
(ATmega328) of which 0.5 KB used by bootloader SRAM - 2 KB
(ATmega328) EEPROM - 1 KB (ATmega328) Clock Speed - 16 MHz 2.4
Power The Arduino Uno can be powered via the USB connection or with an
external power supply. The power source is selected automatically. External
(non-USB) power can come either from an AC-to-DC adapter (wall-wart) or
battery. The adapter can be connected by plugging a 2.1mm center-positive plug
into the board's power jack. Leads from a battery can be inserted in the Gnd and
Vin pin headers of the POWER connector. The board can operate on an external
supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may
supply less than five volts and the board may be unstable. If using more than
12V, the voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts.
The power pins are as follows: VIN -The input voltage to the Arduino
board when it's using an external power source (as opposed to 5 volts from the
USB connection or other regulated power source). You can supply voltage
through this pin, or, if supplying voltage via the power jack, access it through
this pin. 5V - This pin outputs a regulated 5V from the regulator on the board.
The board can be supplied with power either from the DC power jack (7 -12V),
the USB connector (5V), or the VIN pin of the board (7-12V). Supplying
voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your
board. We don't advise it. 3V3- A 3.3-volt supply generated by the on-board
regulator. Maximum current draw is 50 mA. GND - Ground pins. IOREF - This
pin on the Arduino board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin
voltage and select the appropriate power source or enable voltage translators on
the outputs for working with the 5V or 3.3V. 2.5 Memory the ATmega328 has
32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM and 1
KB of EEPROM (which can be read and written with the EEPROM library).

Input and Output Each of the 14 digital pins on the Uno can be used as an
input or output, using pinMode(), digitalWrite(), and digitalRead ()functions.
They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA
and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions: Serial: 0 (RX) and 1 (TX).
Used to receive (RX) and transmit (TX) TTL serial data. These pins are
connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial
chip. External Interrupts: 2 and 3. These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value. See the
attach Interrupt () function for details. PWM: 3, 5, 6, 9, 10, and 11. Provide 8-
bit PWM output with the analog Write () function. SPI: 10 (SS), 11 (MOSI), 12
(MISO), 13 (SCK). These pins support SPI communication using the SPI
library. LED: 13. There is a built-in LED connected to digital pin 13. When the
pin is HIGH value, the LED is on, when the pin is LOW, it's off. The Uno has 6
analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e., 1024 different values). By default, they measure from ground to
5 volts, though is it possible to change the upper end of their range using the
AREF pin and the analog Reference () function. Additionally, some pins have
specialized functionality: TWI: A4 or SDA pin and A5 or SCL pin. Support
TWI communication using the Wire library. There are a couple of other pins on
the board: AREF. Reference voltage for the analog inputs. Used with analog
Reference (). Reset. Bring this line LOW to reset the microcontroller. Typically
used to add a reset button to shields which block the one on the board 2.7
Communication the Arduino Uno has a number of facilities for communicating
with a computer, another Arduino or other microcontrollers. The ATmega328
provides UART TTL (5V) serial Communication, which is available on digital
pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels this serial
communication over USB and appears as a virtual com port to software on the
computer. The '16U2 firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows, a .inf file is required. The
Arduino software includes a serial monitor which allows simple textual data to
be sent to and from the Arduino board. The RX and TX LEDs on the board will
flash when data is being transmitted via the USB-to-serial chip and USB
connection to the computer (but not for serial communication on pins 0 and 1).
A Software Serial library allows for serial communication on any of the Uno's
digital pins. The ATmega328 also supports I2C (TWI) and SPI communication.
The Arduino software includes a Wire library to simplify use of the I2C bus; see
the documentation for details. For SPI communication, use the SPI library.

The Arduino Uno can be programmed with the Arduino software. The
ATmega328 on the Arduino Uno comes pre-burned with a bootloader that
allows you to upload new code to i without the use of an external hardware
programmer. It communicates using the original STK500 protocol (reference, C
header files). You can also bypass the bootloader an program the
microcontroller through the ICSP (In-Circuit Serial Programming) header; see
these instructions for details. The ATmega16U2 (or 8U2 in the rev1 and rev2
boards) firmware source code is available. The ATmega16U2/8U2 is loaded
with a DFU bootloader, which can be activated by: On Rev1 boards: connecting
the solder jumper on the back of the board (near the map of Italy) and then
resetting the 8U2. On Rev2 or later boards: there is a resistor that pulling the
8U2/16U2 HWB line to ground, making it easier to put into DFU mode. You
can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac
OS X and Linux) to load a new firmware. Or you can use the ISP header with
an external programmer (overwriting the DFU bootloader). See this user-
contributed tutorial for more information. 2.9 Automatic (Software) Reset
Rather than requiring a physical press of the reset button before an upload, the
Arduino Uno is designed in a way that allows it to be reset by software running
on a connected computer. One of the hardware flow control lines (DTR) of
theATmega8U2/16U2 is connected to the reset line of the ATmega328 via a
100 nano farad capacitor. When this line is asserted (taken low), the reset line
drops long enough to reset the chip. The Arduino software uses this capability
to allow you to upload code by simply pressing the upload button in the
Arduino environment. This means that the bootloader can have a shorter
timeout, as the lowering of DTR can be well-coordinated with the start of the
upload. This setup has other implications. When the Uno is connected to either
a computer running Mac OS X or Linux, it resets each time a connection is
made to it from software (via USB). For the Following half-second or so, the
bootloader is running on the Uno. While it is programmed to ignore malformed
data (i.e., anything besides an upload of new code), it will intercept the first few
bytes of data sent to the board after a connection is opened. If a sketch running
on the board receives one-time configuration or other data when it first starts,
make sure that the software with which it communicates waits a second after
opening the connection and before sending this data. The Uno contains a trace
that can be cut to disable the auto-reset. The pads on either side of the trace can
be soldered together to re-enable it. It's labelled "RESET-EN". You may also be
able to disable the auto-reset by connecting a 110-ohm resistor from 5V to the
reset line.

USB Over current Protection the Arduino Uno has a resettable polyfuse
that protects your computer's USB ports from shorts and over current. Although
most computers provide their own internal protection, the fuse provides an extra
layer of protection. If more than 500 mA is applied to the USB port, the fuse
will automatically break the connection until the short or overload is removed.

Physical Characteristics The maximum length and width of the Uno PCB
are 2.7 and 2.1 inches respectively, with the USB connector and power jack
extending beyond the former dimension. Four screw holes allow the board to be
attached to a surface or case. Note that the distance between digital pins 7 and 8
is 160 mil (0.16"), not an even multiple of the 100-mil spacing of the other pins.

The Arduino Uno is a microcontroller board based on the ATmega328


(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM
outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a
power jack, an ICSP header, and a reset button. It contains everything needed to
support the microcontroller; simply connect it to a computer with a USB cable
or power it with a AC-to-DC adapter or battery to get started.
Fig 5.1 Arduino Uno

5.1.2 PIN DESCRIPTION

Each of the 14 digital pins on the Uno can be used as an input or output,
using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5
volts. Each pin can provide or receive a maximum of 40 mA and has an internal
pull-up resistor (disconnected by default) of 20-50 kOhms. In addition, some
pins have specialized functions:

Input and Output

Each of the 14 digital pins on the Arduino Uno can be used as an input or
output, using pinMode(), digitalWrite (), and digitalRead() functions. They
operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and
has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.

In addition, some pins have specialized functions:


Serial: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL
serial data. These pins are connected to the corresponding pins of the
ATmega8U2 USB-to-TTL Serial chip.

External interrupt: pins 2 and 3. These pins can be configured to trigger an


interrupt on a low value, a rising or falling edge, or a change in value. See the
attach Interrupt () function for details.

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write
() function.

SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI


communication using the SPI library.

LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it’s off.

The Uno has 6 analog inputs, labelled A0 through A5, each of which provide 10
bits of resolutio n (i.e., 1024 different values). By default, they measure from
ground to 5 volts, though is it possible to change the upper end of their range
using the AREF pin and the analog Reference () function.

Additionally, some pins have specialized functionality:

TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using
the Wire library.

There are a couple of other pins on the board:

AREF. Reference voltage for the analog inputs. Used with analogReference().

Reset. Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board.

5.2 Liquid Crystal Display (LCD)


LCD Modules can present textual information to user. It’s like a cheap
“monitor” that you can hook in all of your gadgets. They come in various types.
The most popular one is 16x2 LCD Module. It has 2 rows and 16 columns.

Fig 5.2 A 16X2 LCD MODULE

In order to connect LCD to the MCU, you have to first make physical
connections between the pins of LCD and MCU. In order to connect the LCD,
you have to use one PORT of the MCU completely for this purpose. Suppose
you chose a particular PORT.

Select your chip and clock frequency. Then click on LCD tab. Select the
PORT at which you want to make LCD connections.

Set chars/line text box to 16, because you will be using 16*2 LCD. All
the connections of the LCD other than power connections will be displayed in
the wizard. Make other settings and then select generate save, save and exit
from file menu. To save the file, give the file name.

Once this is done, you are ready to use LCD display form your program.
You can now use inbuilt functions to write to the LCD screen.

5.3 WI-FI Modem

The NETGEAR D6300 Wi-Fi DSL Modem Router offers maximum-


performance wireless speeds of up to 450 Mbps needed for demanding
applications, such as large file transfers, streaming HD video, and multiplayer
gaming. Complete with a built-in DSL modem, it is compatible with all major
DSL Internet service providers. Simultaneous dual-band technology runs both
2.4 and 5 GHz bands at the same time, ensuring top speeds and the greatest
range, while Gigabit offers ultrafast wired connections. The unit supports a
wide range of premium features and applications such as Ready SHARE®
Cloud, Ready SHARE® Printer, and NETGEAR genie®. The WiFi modem
router lets you access your network from anywhere within the operating range
of your wireless network. However, the operating distance or range of your
wireless connection can vary significantly depending on the physical placement
of your router. For example, the thickness and number of walls the wireless
signal passes through can limit the range. For best results, place your router:

•Near the center of the area where your computers and other devices
operate, and preferably within line of sight to your wireless devices.

•So, it is accessible to an AC power outlet and near Ethernet cables for


wired computers.

•In an elevated location such as a high shelf, keeping the number of walls
and ceilings between the Wi-Fi modem router and your other devices to a
minimum.

•Away from electrical devices that are potential sources of interference,


such as ceiling fans, home security systems, microwaves, computers, or the base
of a cordless phone or 2.4-GHz cordless phone.
•Away from any large metal surfaces, such as a solid metal door or
aluminium studs. Large expanses of other materials such as glass, insulated
walls, fish tanks, mirrors, brick, and concrete can also affect your wireless
signal.

ESP-01 is the one of the most popular ESP8266 module available in the
market. ESP8266 is a self-contained SoC with integrated TCP/IP stack which
helps any microcontroller having UART to access a wifi network. It can act as
both WiFi access point as well as a WiFi client. It is pre-programmed with AT
commands, so we can easily access and configure it using a microcontroller.
ESP8266 runs on 3.3V and its input pins are not 5V tolerant. So we need to
reduce the 5V output of the Arduino Tx pin to 3.3V by using voltage dividing
resistors to connect to Rx pin of ESP8266 module. Arduino TTL input pins will
detect 3.3V as logic high, so we can directly connect 3.3V output of ESP8266
Tx to Arduino Rx pin.

Fig 5.3 ESP 8266

5.4 Ultrasonic Sensor

An ultrasonic sensor transmits ultrasonic waves into the air and detects
reflected waves from an object. There are many applications for ultrasonic
sensors, such as in intrusion alarm systems, automatic door openers and backup
sensors for automobiles. Accompanied by the rapid development of information
processing technology, new fields of application, such as factory automation
equipment and car electronics, are increasing and should continue to do so.
Using its unique piezoelectric ceramics manufacturing technology developed
over many years, Murata has developed various types of ultrasonic sensors
which are compact and yet have very high performance. The information
contained in this catalogue will help you to make effective use of our ultrasonic
sensors. Ultrasonic waves are sounds which cannot be heard by humans and are
normally, frequencies of above 20kHz.
CHAPTER 6

OVERVIEW OF SOFTWARE

In this system, following software’s are used,

1.ARDUINO IDE

2.LIBRARIES

3.EMBEDDED C

4.HOSTING WEBSITE –Ubidot.com

6.1 ARDUINO IDE


Arduino is a prototype platform (open-source) based on an easy-to-use
hardware and software. It consists of a circuit board, which can be programmed
(referred to as a microcontroller) and a ready-made software called Arduino
IDE (Integrated Development Environment), which is used to write and upload
the computer code to the physical board. Arduino provides a standard form
factor that breaks the functions of the micro-controller into a more accessible
package.

Arduino is a prototype platform (open-source) based on an easy-to-use


hardware and software. It consists of a circuit board, which can be programmed
(referred to as a microcontroller) and a ready-made software called Arduino
IDE (Integrated Development Environment), which is used to write and upload
the computer code to the physical board. The key features are:

 Arduino boards are able to read analog or digital input signals from
different sensors and turn it into an output such as activating a motor, turning
LED on/off, connect to the cloud and many other actions.

 You can control your board functions by sending a set of instructions to


the microcontroller on the board via Arduino IDE (referred to as uploading
software).

 Unlike most previous programmable circuit boards, Arduino does not


need an extra piece of hardware (called a programmer) in order to load a new
code onto the board. You can simply use a USB cable.

 Additionally, the Arduino IDE uses a simplified version of C++,


making it easier to learn to program.

 Finally, Arduino provides a standard form factor that breaks the


functions of the micro-controller into a more accessible package.
Various kinds of Arduino boards are available depending on different
microcontrollers used. However, all Arduino boards have one thing in common:
they are programmed through the Arduino IDE. The differences are based on
the number of inputs and outputs (the number of sensors, LEDs, and buttons
you can use on a single board), speed, operating voltage, form factor etc. Some
boards are designed to be embedded and have no programming interface
(hardware), which you would need to buy separately. Some can run directly
from a 3.7V battery, others need at least 5V.

Arduino consists of both a physical programmable circuit board (often


referred to as a microcontroller) and a piece of software, or IDE (Integrated
Development Environment) that runs on your computer, used to write and
upload computer code to the physical board. Arduino is an open-source
computer hardware and software company, project, and user community that
designs and manufactures single-board microcontrollers and microcontroller
kits for building digital devices and interactive objects that can sense and
control objects in the physical world. The project's products are distributed as
open-source hardware and software, which are licensed under the GNU Lesser
General Public License (LGPL) or the GNU General Public License (GPL)
permitting the manufacture of Arduino boards and software distribution by
anyone. Arduino boards are available commercially in preassembled form, or as
do-it-yourself (DIY) kits. Arduino board designs use a variety of
microprocessors and controllers. The boards are equipped with sets of digital
and analog input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The boards feature serial communications
interfaces, including Universal Serial Bus (USB) on some models, which are
also used for loading programs from personal computers. The microcontrollers
are typically programmed using a dialect of features from the programming
languages C and C++. In addition to using traditional compiler tool cha ins, the
Arduino project provides an integrated development environment (IDE) based
on the Processing language project.

6.2 LIBRARIES

The Arduino environment can be extended through the use of libraries,


just like most programming platforms. Libraries provide extra functionality for
use in sketches, e.g. working with hardware or manipulating data. To use a
library in a sketch, select it from Sketch > Import Library. A number of libraries
come installed with the IDE, but you can also download or create your own. See
these instructions for details on installing libraries.

Standard Libraries Used

 Ethernet-for connecting to the internet using the Arduino Ethernet


Shield, Arduino Ethernet Shield 2 and Arduino Leonardo ETH.
 PCD8544 - for controlling or to communicate with Nokia 5110 lcd.
 Wi-Fi - for connecting to the internet using the Arduino Wi-Fi shield.
 Ubi-dot Library- to connect with ubidot.com.

6.3 EMBEDDED C

Embedded C is a set of language extensions for the C programming


language by the C Standards Committee to address commonality issues that
exist between C extensions for different embedded systems. Historically,
embedded C programming requires nonstandard extensions to the C language in
order to support exotic features such as fixed-point arithmetic, multiple distinct
memory banks, and basic I/O operations.

Embedded Programming

Embedded refers to the combination of hardware and software.


Embedded systems programming is the programming of an embedded system in
some device using the permitted programming interfaces provided by that
system. Embedded Java is an example of a development environment for
programming embedded systems that will execute Java programs. Arduino is a
very minute part of embedded systems; in fact, we can call it as an application
product of embedded system. Arduino is just any other microcontroller board,
with a specifically designed API and software which makes programming it
very easy. Arduino is just a drop of water in Embedded System Ocean.

6.4 UBIDOTS.COM (HOSTING WEBSITE)

Ubidots was first born as an engineering services firm, specializing in


hardware and software development for IoT projects in Latin America. Between
2012 and 2014, we accomplished hundreds of Internet of Things projects across
industries like Healthcare, Oil & Gas, Energy, Manufacturing, Transportation
and Retail, learning the nuts and bolts of IOT. After going through the Boston
Mass Challenge Accelerator -with a purpose of turning ourselves into a global
product-based startup- the idea of an IOT cloud was born; specially one that
understood the real needs of hardware engineer. Since its launch in 2014, the
ubidots Cloud has grown into one of the top IoT Platforms in the market,
supporting thousands of IOT initiatives in more than 40 countries.
CHAPTER 7

RESULTS AND DISCUSSION

A cost-effective real-time driver monitoring and assisting system


employing sobriety and fatigue check with the help of IoT technology and ML
algorithms is a highly usable device for Indian population to curb human-error
on roads and develop a responsible driving behavior. The proposed system
interfaces with the vehicle closely. A vehicle turns on in 3 steps. First, the driver
inserts the key in the keyhole and turns once, powering up the starter motor.
Second, the driver turns the key further, turning the battery on and
starting the engine cycle. Finally, on the last turn, spark plug fires, turning the
ignition on. Our device takes power from the vehicle and controls its ignition
system; hence it fits right between step 2 and 3.
The proposed system uses Raspberry Pi 3B+ microprocessor, depicted in
figure, at its heart. It processes all the data from IoT sensors and camera; applies
small computations and ML algorithms on it to infer the driver’s behavior.
While RPi provides limited computational resources, they were sufficient for
our use case.
The proposed system for sobriety check and fatigue check is developed with the
motive of reducing the human-error related accidents. Hence, they are tested in
real-time environments or closest simulations possible. The sobriety and fatigue
check systems were tested.
CHAPTER 8

CONCLUSION

Several advancements in IoT and ML technologies have made it feasible


to develop smart devices that can assist humans and add to the quality of our
lives. The goal of our work was to develop a device that ensures a driver,
responsible
for the safety of his, the passengers’ and the passers’ by lives, is sober and
attentive. Several tests of the device in simulated and real environments
conclusively proved that the system is well-equipped to prevent drivers from
committing DUI offenses and alert a drowsy driver. We wish to tap into the
potential of our work as a practical security feature for current and new
automobiles. Hence, this work is one-step forward to make driving safer for
Indian population. However, we envision to aggrandize the capability and
usability of our device in several ways. Firstly, we would like to experiment
with other ways of detecting alcohol content in a driver’s body. We would like
to see how other sensors such as MQ-135, TGS-822 work for the same use case.

Fuel cell-based technology is costlier as compared to semiconductor-


based sensors, we will be interested in understanding the cost-accuracy trade off
here. Some advancements have been made in non-invasive forms of alcohol
detection using transdermal sensors or IR-spectroscopy, which can be analyzed.
Second and more importantly, we would like to increase the functionality of our
device, using a gyroscope accelerometer module to perceive the driving pattern
of drivers. Furthermore, we would like to use ultrasonic sensors to perceive the
traffic around the vehicle, to slow-down or park the vehicle for a rash or
inattentive driving pattern. Our camera enabled device, with the help of ML,
can monitor the driver for other unhealthy driving practices such as receiving
phone calls, not wearing seat-belts, smoking etc. Moreover, we can use a GPS-
GSM module to send a message to a stakeholder for frequent driving offenses.
We would also like to train the model on personalized data sets with the help of
transfer learning, anticipating better performance of ML algorithms. Overall, we
hope to develop a wholesome system that safeguards any and all human lives on
roads by discouraging the unhealthy driving behaviours.

REFERENCES
[1] Rico, J., Sancho, J., Cendon, B., & Camus, M. (2013, March). Parking easier
by using context information of a smart city: Enabling fast search and
management of parking resources. In Advanced Information Networking and
Applications Workshops (WAINA), 2013 27th International Conference on (pp.
1380-1385). IEEE.

[2] Zheng, Y., Rajasegarar, S., & Leckie, C. (2015, April). Parking availability
prediction for sensor-enabled car parks in smart cities. In Intelligent Sensors,
Sensor Networks and Information Processing (ISSNIP), 2015 IEEE Tenth
International Conference on (pp. 1-6). IEEE.

[3] Zhou, F., & Li, Q. (2014, November). Parking Guidance System Based on
ZigBee and Geomagnetic Sensor Technology. In Distributed Computing and
Applications to Business, Engineering and Science (DCABES), 2014 13th
International Symposium on (pp. 268-271). IEEE.

[4] Botta, A., de Donato, W., Persico, V., & Pescapé, A. (2014, August). On the
Integration of Cloud Computing and Internet of Things. In Future Internet of
Things and Cloud (FiCloud), 2014 International Conference on (pp. 23-30).
IEEE.

[5] Ji, Z., Ganchev, I., O'droma, M., & Zhang, X. (2014, August). A cloudbased
intelligent car parking services for smart cities. In General Assembly and
Scientific Symposium (URSI GASS), 2014 XXXIth URSI (pp. 1-4). IEEE.

[6] International Parking Institute, “2012 Emerging Trends in Parking”.

[7] Ballon, P., Glidden, J., Kranas, P., Menychtas, A., Ruston, S., & Van Der
Graaf, S. (2011, October). Is there a Need for a Cloud Platform for European
Smart Cities?. In eChallenges e-2011 Conference Proceedings, IIMC
International Information Management Corporation.
[8] Suciu, G., Vulpe, A., Halunga, S., Fratu, O., Todoran, G., & Suciu, V.
(2013, May). Smart cities built on resilient cloud computing and secure internet
of things. In Control Systems and Computer Science (CSCS), 2013 19th
International Conference on (pp. 513-518). IEEE.

[9] Chen, S. Y., Lai, C. F., Huang, Y. M., & Jeng, Y. L. (2013, July). Intelligent
home-appliance recognition over IoT cloud network. In Wireless
Communications and Mobile Computing Conference (IWCMC), 2013 9th
International (pp. 639-643). IEEE.

[10] Dash, S. K., Mohapatra, S., & Pattnaik, P. K. (2010). A survey on


applications of wireless sensor network using cloud computing. International
Journal of Computer science & Engineering Technologies (E-ISSN: 2044-
6004), 1(4), 50-55.

You might also like