Nothing Special   »   [go: up one dir, main page]

Smart Helmet Final 1

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 35

ABSTRACT

This project mainly emphasizes on reducing automobile accidents caused by


drunken drivers by presenting a new approach to increasing automobile safety and
security. An integrated system with an ethanol detector is designed such that it is mounted
on the steering wheel of the car and monitors the presence of ethanol in air. When alcohol
content is detected, the ignition will fail to start. For the safety of two wheeler riders, the
same system can be mounted in the helmet of the rider. Alcohol sensor is placed the
vehicle and limit switch is placed the inside of helmet which takes the output of the
alcohol detecting system, and if alcohol is detected the ignition will fail to start. Only after
the wearing helmet and cannot detect alcohol, the vehicle can be restarted and measured
values update to the cloud using IOT. All the functions are carried out with the help of an
microcontroller.

Indexed Terms- Alcohol sensor, IOT module(ESP 8266), Limit switch and
Relay, Gear motor.

1
CHAPTER 1
INTRODUCTION

Nowadays, a growing crucial problem faced by the world is an unnatural death due to
drunk driving and driving under the influence of alcohol (DUI). The main aim of this
paper is to reduce traffic accident cases based on driving under the influence of alcohol,
especially in India. As per the data from the transport research wing of India , the
percentage of accidents has increased by 2.5% between 2014-15. From these, we can
concur that the road accidents which occur are responsible for around 1,374 deaths that
take place every day in India. Among them, 70% of total road human deaths were caused
under the influence of drunken driving. These days, the majority of road accidents are
caused by drink driving. Driving in an intoxicated condition is highly dangerous as our
mind is in an unstable condition and hence, the decisions taken by us have a huge impact.
Most of the deaths caused by drunken driving are preventable. Although the proportion of
alcohol-related crashes has dropped dramatically in recent decades, there are still far too
many such preventable accidents . Hence, to avoid these situations we need a more
efficient system that will, primarily, be able to verify whether the driver is in an
intoxicated situation or not, and secondly, after the driver is found to be drunk, the vehicle
ignition function should get disabled and also cannot wear helmet to stop vehicle. This can
be implemented using ESP 8266, internetworked with various other sensor and modules .
When user did’t drink and weared the helmet then to restart the vehicle automally. These
values are updated IOT using Cayenne app through the Cloud.

2
CHAPTER 2
LITERATURE SURVEY

[1] . I. Fletcher et al proposed “Automatic braking system control “IEEE


TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY - 2018.

In this method based on the MATLAB simulation environment is described, which is then
implemented with a 'Bang-Bang' controller strategy to provide a benchmark for the
evaluation of altemative control strategies. The main alternatives investigated were centred
around PI and Fuzzy Logic based systems which take advantage of information received
from the dihbuted sensors. One of the main aims was to improve the driver comfort when
the ABS is activated whilst maintaining optimal system performance in terms of
minimising the vehicle stopping distance under emergency conditions.
[2] . Chandan Kumar et al proposed “Hybrid braking: Future vehicle
technology“IEEE TRANSACTIONS ON INFORMATION FORENSICS AND
SECURITY - 2018.

The Existing system a new braking system known as hybrid braking system. This is the
innovation in the research work which will overcome major disadvantages of conventional
braking system. Hybrid braking system consists of various parts which is listed below
electromechanical actuators [12], wireless system [13], electric motor [14], rack and
pinion [15], brake calipers and brake rotor.. It will be a promising vehicular braking
control scheme and will offer enhanced safety and comfort.

3
[3]. Varanasi Venkata et al proposed “Intelligent Braking System“IEEE
TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY -2019.

The system is, when the collision becomes is about to happen, the system should act
independently without any human’s contribution (by braking or steering or both) . If the
lanes are clear and if the vehicle speed is high, then the collision can be avoided by
steering whereas in the case of low vehicle speed collision can be avoided by applying the
brake.

[4]. Md. Symum Rezwan et al proposed “Vehicle Breaking Support System “IEEE
TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY - 2020.

In this project is, cars can automatically brake due to obstacles when the sensor senses
any. The automatic braking system is an assistant system for vehicles that prevents or
reduces any kind of causalities from an accident or collision with another vehicle,
person or obstacles.

[5]. Ping-Fan Jin et al proposed “Design of unmanned vehicle advanced braking


system using smart motor “IEEE TRANSACTIONS ON INFORMATION
FORENSICS AND SECURITY - 2021.

In this project analyze the longitudinal direction of the vehicle control when the obstacle
or target vehicle ahead of the vehicle. Several manufacturers have developed technologies
which can help car driver to avoid these kinds of accidents or, at least, to reduce their
severity.

4
CHAPTER 3

SYSTEM DESIGN

3.1 EXISTING SYSTEM

The Existing system unmanned vehicle braking using smart motor system , In this project
analyze the longitudinal direction of the vehicle control when the obstacle or target vehicle
ahead of the vehicle. Several manufacturers have developed technologies which can help
car driver to avoid these kinds of accidents or, at least, to reduce their severityit has
commercialized for examples BMW’s Pedestrian warning with city brake Activation is a
system intended to warn the driver and prompt him or her to intervene if there is imminent
danger of a collision with target. The system controlled via the camera in the base of the
rear-view mirror.It issues a warning from speeds of 10 km/h upto 60km/h when a collision
with pedestrian is imminent and simultaneously preconditions the brakes for a faster
response in case the driver applies them. And Volvo City Safety is an only autonomous
emergency braking system designed to help a driver avoid a low-speed crash or to reduce
its severity. At vehicle speeds between 3.6km/h and 30km/h.

3.2 DISADVANTAGES:

• High cost and More number of components are used.


• Timing issue.

5
3.3 PROPOSED SYSTEM:

A lot of different methods was proposed to solve the problem drunken driving
detection, but we didn’t have proper measurements for this. Therefore, we needed a
method to combine a number of factors and personalize it for testing people, other than the
regular approach. When the driver wear the helmet , the detection system is powered and
activated. Nowadays, our cars are becoming smarter and a replacement feature is being
developed to safeguard against drunk driving. Simultaneously the system moves to other
sensor i.e. breath-based system (using MQ-3 alcohol sensor). When the reading of the
sensors is above the given limit, it takes it as ‘1’. Else it takes it as ‘0’. If the system
matches two of the values automatically turns the ignition is off. If the Alcohol senser is
detected means the motor will be off . When user did’t drink and weared the helmet then
to restart the vehicle automatically. These values are updated IOT using Cayenne app
through the Cloud.

3.4 HARDWARE REQUIREMENTS:

3.4.1 Alcohol sensor

3.4.2 Limit switch


3.4.3 Driver
3.4.4 Relay
3.4.5 Motor
3.4.6 ESP 8266

3.5SOFTWARE REQUIREMENTS:

3.5.1 Arduino IDE

6
[Grab your reader’s attention with a great quote from
the document or use this space to emphasize a key point.
To place this text box anywhere on the page, just drag
it.]
Powersupply for all units

BLOCK DIAGRAM:

Alcohol
sensor

ESP 8266(IOT
Module)

Figure 3.1: block diagram

7
CHAPTER 4

HARDWARE DESCRIPTION

4.1 POWER SUPPLY

Power supply is a reference to a source of electrical power. A device or system that


supplies electrical or other types of energy to an output load or group of loads is called a
power supply unit or PSU. The term is most commonly applied to electrical energy
supplies, less often to mechanical ones, and rarely to others.

Power supplies for electronic devices can be broadly divided into linear and switching
power supplies. The linear supply is a relatively simple design that becomes increasingly
bulky and heavy for high current devices; voltage regulation in a linear supply can result
in low efficiency. A switched-mode supply of the same rating as a linear supply will be
smaller, is usually more efficient, but will be more complex.

4.2 Linear Power supply:

An AC powered linear power supply usually uses a transformer to convert the voltage
from the wall outlet (mains) to a different, usually a lower voltage. If it is used to produce
DC, a rectifier is used. A capacitor is used to smooth the pulsating current from the
rectifier. Some small periodic deviations from smooth direct current will remain, which is
known as ripple. These pulsations occur at a frequency related to the AC power frequency
(for example, a multiple of 50 or 60 Hz).

8
The voltage produced by an unregulated power supply will vary depending on the load
and on variations in the AC supply voltage. For critical electronics applications a linear
regulator will be used to stabilize and adjust the voltage. This regulator will also greatly
reduce the ripple and noise in the output direct current. Linear regulators often provide
current limiting, protecting the power supply and attached circuit from over current.

Adjustable linear power supplies are common laboratory and service shop test equipment,
allowing the output voltage to be set over a wide range. For example, a bench power
supply used by circuit designers may be adjustable up to 30 volts and up to 5 amperes
output. Some can be driven by an external signal, for example, for applications requiring a
pulsed output.

Figure 4.1 : block diagram of regulated power supply

4.3 Transformer:

9
Figure 4.2 : transformer

Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is
AC.

Step-up transformers increase voltage, step-down transformers reduce voltage. Most


power supplies use a step-down transformer to reduce the dangerously high mains voltage
(230V in UK) to a safer low voltage.

The input coil is called the primary and the output coil is called the secondary. There is no
electrical connection between the two coils; instead they are linked by an alternating
magnetic field created in the soft-iron core of the transformer. The two lines in the middle
of the circuit symbol represent the core.

Transformers waste very little power so the power out is (almost) equal to the power in.
Note that as voltage is stepped down current is stepped up.

The ratio of the number of turns on each coil, called the turn’s ratio, determines the ratio
of the voltages. A step-down transformer has a large number of turns on its primary
(input) coil which is connected to the high voltage mains supply, and a small number of
turns on its secondary (output) coil to give a low output voltage.

Turns ratio=Vp/Vs=Nn/Ns and Power out=Power in

Vs*Is=Vp * Ip

10
Vp = primary (input) voltage Np = number Vs = secondary (output) voltage Ns =
of turns on primary coil Ip = primary number of turns on secondary coil Is =
(input) current secondary (output) current

voltage

input
output
high voltage AC
low voltage AC
(mams supply) time

Transformer Output: low voltage AC


Figure 4.3 Figure 4.4

The low voltage AC output is suitable for lamps, heaters and special AC motors. It is not
suitable for electronic circuits unless they include a rectifier and a smoothing capacitor.

4.4 Rectifier:

There are several ways of connecting diodes to make a rectifier to convert AC to DC. The
bridge rectifier is the most important and it produces full-wave varying DC. A full-wave
rectifier can also be made from just two diodes if a centre-tap transformer is used, but this
method is rarely used now that diodes are cheaper. A single diode can be used as a
rectifier but it only uses the positive (+) parts of the AC wave to produce half-wave
varying DC.

11
voltage

—o+

output
fWW\ time

—o
Transformer Rectifier — Output: varying DC
Figure 4.5 Figure 4.6

The varying DC output is suitable for lamps, heaters and standard motors. It is not suitable
for electronic circuits unless they include a smoothing capacitor.
4.5 Bridge rectifier:

A bridge rectifier can be made using four individual diodes, but it is also available in
special packages containing the four diodes required. It is called a full-wave rectifier
because it uses the entire AC wave (both positive and negative sections). 1.4 V is used up
in the bridge rectifier because each diode uses 0.7V when conducting and there are always
two diodes conducting, as shown in the diagram below. Bridge rectifiers are rated by the
maximum current they can pass and the maximum reverse voltage they can withstand (this
must be at least three times the supply RMS voltage so the rectifier can withstand the peak
voltages). Please see the Diodes page for more details, including pictures of ridge
rectifiers.

Figure 4.7 : diode bridge rectifier


12
Alternate pairs of diodes conduct, changing over the connections so the alternating
directions of AC are converted to the one direction of DC.

Output: full-wave varying DC: (using the entire AC wave):

A single diode can be used as a rectifier but this produces half-wave varying DC
which has gaps when the AC is negative. It is hard to smooth this sufficiently well to
supply electronic circuits unless they require a very small current so the smoothing
capacitor does not significantly discharge during the gaps. Please see the Diodes page for
some examples of rectifier diodes.

Transformer Diode
Figure 4.9

Output: half-wave varying DC (using only half the AC wave):

13
current '

AAA
or +

voltage
0

time

Figure 4.10

4.7 Smoothing:

Smoothing is performed by a large value electrolytic capacitor connected across


the DC supply to act as a reservoir, supplying current to the output when the varying DC
voltage from the rectifier is falling. The diagram shows the unsmoothed varying DC
(dotted line) and the smoothed DC (solid line). The capacitor charges quickly near the
peak of the varying DC, and then discharges as it supplies current to the output.

Smoothing
Figure 4.11 Figure 4.12
Note that smoothing significantly increases the average DC voltage to almost
the peak value (1.4 x RMS value). For example 6V RMS AC is rectified to full wave

DC of about 4.6 V RMS (1.4V is lost in the bridge rectifier), with smoothing this
increases to almost the peak value giving 1.4 x 4.6 = 6.4 V smooth DC.

Smoothing is not perfect due to the capacitor voltage falling a little as it


discharges, giving a small ripple voltage. For many circuits a ripple which is 10% of the
supply voltage is satisfactory and the equation below gives the required value for

14
the smoothing capacitor. A larger capacitor will give fewer ripples. The capacitor value
must be doubled when smoothing half-wave DC.
Smoothing Capacitor for 10% ripple, C=5*10/vs.*f

C = smoothing capacitance in farads (F)


Io = output current from the supply in amps (A)
Vs = supply voltage in volts (V), this is the peak value of the unsmoothed DC f =
frequency of the AC supply in hertz (Hz), 50Hz in the UK.

The smooth DC output has a small ripple. It is suitable for most electronic circuits.

4.8 Regulator:

Voltage regulator ICs are available with fixed (typically 5, 12 and 15 V) or variable output
voltages. They are also rated by the maximum current they can pass. Negative voltage
regulators are available, mainly for use in dual supplies. Most regulators include some
automatic protection from excessive current ('overload protection') and overheating
('thermal protection').

15
The LM78XX series of three terminal regulators is available with several fixed
output voltages making them useful in a wide range of applications. One of these is local
on card regulation, eliminating the distribution problems associated with single point
regulation. The voltages available allow these regulators to be used in logic systems,
instrumentation, HiFi, and other solid state electronic equipment. Although designed
primarily as fixed voltage regulators these devices can be used with external components
to obtain adjustable voltages and current.

Many of the fixed voltage regulator ICs has 3 leads and look like power transistors,
such as the 7805 +5V 1A regulator shown on the right. They include a hole for attaching a
heat sink if necessary.

1. Positive regulator
1. input pin
2. ground pin
3. output pin
It regulates the positive voltage

2. Negative regulator
1. ground pin
2. input pin
3. output pin
It regulate the negative
voltage

16
The regulated DC output is very smooth with no ripple. It is suitable for all electronic
circuits.

4.9 DRIVER / RELAY MODULE && MOTOR

• The driver relay circuit is connected with the digital pins of the micro controller & dc
motors will be directly interfaced with the relay module
• According to the pre-loaded code, the controller will send a signal to driver/ relay
circuit (ON / OFF). When the driver/ relay circuit gets ON condition the motor will be
turned on using 12 volt dc supply
• The connection made with the motor and relay module is shown as below
• The red colour wire denotes the + ve supply, black colour wire denotes the - ve supply
and the yellow colour wire mentioned in the diagram will get the output signal sent from
the controller to turn on and of the relay

17
• In relay module there is 3 pins such as normally open/ normally closed and
COM
• COM is directly supplied with 12 volt supply

• One terminal of the motor will be connected with the COM pin and the
other terminal will be connected with ground
• Initially NC and COM will be connected together in the relay module

• When the relay module get a signal from the controller the connection will
set to NO and COM and then the motor can be turned ON
• unless the motor will be in OFF condition

• Once the relay get OFF condition from the controller the connection
between the NO and COM will be triggered OFF and the motor will be
turned OFF

Figure 4.17

18
Relay operation using Darlington Pair

When the base terminal of the NPN transistor is grounded (0 volts), zero current flows
into the base therefore Ib = 0.

As the base terminal is grounded, no current flows from the collector to the emitter
terminals therefore the non-conducting NPN transistor is switched “OFF” (cut-off).

If we now forward biased the base terminal with respect to the emitter by using a voltage
source greater than 0.7 volts, transistor action occurs causing in a much larger current to
flow through the transistor between its collector and emitter terminals.
The transistor is now said to be switched “ON” (conducting).

If we operate the transistor between these two modes of cut-off and conduction, the
transistor can be made to operate as an electronic switch.

Thus, by this operation we can operate the transistor as a switch to ON and OFF the motor
with the help of relay.

19
4.10 Alcohol Sensor

• The Gas Sensor(MQ3) module is useful for gas leakage detection (in home and
industry). It is suitable for detecting Alcohol, Benzene, CH4, Hexane, LPG, CO.
• It is a low cost semiconductor sensor which can detect the presence of alcohol
gases at concentrations from 0.05 mg/L to 10 mg/L. The sensitive material used
for this sensor is SnO2, whose conductivity is lower in clean air.
• A SnO semiconductor layer is heated to a high temperature, oxygen is adsorbed on
the surface. When the air is clean, electrons from the conduction band of tin
dioxide are attracted to oxygen molecules.
• This creates an electron depletion layer just beneath the surface of the SnO2
particles, forming a potential barrier. As a result, the SnO2 film becomes highly
resistive and prevents electric current flow.
• The presence of alcohol, however, the surface density of adsorbed oxygen
decreases as it reacts with the alcohol, lowering the potential barrier. As a result,
electrons are released into the tin dioxide, allowing current to freely flow through
the sensor.
• The sensitive material used for this sensor is SnO2, whose conductivity is lower in
clean air. It’s conductivity increases as the concentration of alcohol gases
increases.
• MQ-3 gas sensor has high sensitivity to Alcohol, and has good resistance to
disturb of gasoline, smoke and vapor. This module provides both digital and
analog outputs.

20
This sensor provides an analog resistive output based on alcohol
concentration. When the alcohol gas exist, the sensor's conductivity gets
higher along with the gas concentration rising.

4.11 Pin configuration

3.6VCC - This pin connected in supplies power to the sensor. the sensors be
powered form 5 V.
3.7GND - this pin connected to the ground.

3.8Digital Out (DO) - this sensor to get digital output from this pin, by setting a
threshold value using the potentiometer.

3.9Analog Out (AO) - This pin outputs 0-5V analog voltage based on the intensity of
the gas.

21
o The module has a built-in potentiometer for setting an alcohol concentration
threshold above which the module outputs LOW and the status LED lights up.

o To set the threshold, let the alcohol vapors enter the sensor and turn the pot
clockwise until the Status LED is on. Then, turn the pot back counter clockwise
just until the LED goes off.

o Mq3 gas sensor application:

o Portable alcohol detector.

o Used in environmental monitoring equipment.

o Vehicle alcohol detector.


Status Output LED

Alcohol Low ON
------------------------ Threshold
No Alcohol High OFF

22
MQ3 GAS SENSOR - IOT Alert content

• If there is a gas leakage of any kind that can be a danger to society or the people
living in that environment, the MQ-3sensor used in the system will automatically
detect it, the IOT module in the design will send a value to cloud in the system or
to the monitoring company that is responsible for the building or organization.

4.12 (ESP 8266)


> Node MCU is an open source IoT platform.

> Its operating voltage is 5v dc supply.

> It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif
Systems, and hardware which is based on the ESP-12 module.

> The term "Node MCU" by default refers to the firmware rather than the dev kits.
> The firmware uses the Lua scripting language.

> It is based on the eLua project, and built on the Espressif Non-OS SDK for
ESP8266.
> In our Project IOT is used to monitor the agricultural Land parameters (soil quality
and water level)from far distance or from anywhere.
> All the values that should be viewed by the Farmers, likewise programmed for the
NODE MCU which consists of in buildWi-Fi Shield, and transmitted to the
Cayenne Server which works on the MQTT protocol.
> From the Cayenne Server all the values are updated in the Mobile App/ web page
of the Farmers, So that they can able to monitor and control their Agricultural land
from remote place.

23
MQTTPROTOCOL

> MQTT is a lightweight, publish-subscribe network protocol that transports


messages between devices. The protocol usually runs over TCP/IP, however, any
network protocol that provides ordered, lossless, bi-directional connections can
support MQTT.

> According to measurements in 3G networks, throughput of MQTT is 93 times


faster than HTTP's. Besides, in comparison to HTTP, MQTT Protocol ensures high
delivery guarantees.

> HTTP is the most popular and widely used protocol. But over the last years
MQTT rapidly gain tractions. Developers have to choose between them when we
are talking about IoT development.

24
Switch

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


circuit, interrupting the current or diverting it from one conductor to another.The most
familiar form of switch is a manually operated electromechanical device with one or more
sets of electrical contacts. Each set of contacts can be in one of two states: either 'closed'
meaning the contacts are touching and electricity can flow between them, or 'open',
meaning the contacts are separated and nonconducting.A mechanical limit switch
interlocks a mechanical motion or position with an electrical circuit. A good starting point
for limit-switch selection is contact arrangement. The most common limit switch is the
single-pole contact block with one NO and one NC set of contacts; however, limit
switches are available with up to four poles.

Limit switches also are available with time-delayed contact transfer. This type is
useful in detecting jams that cause the limit switch to remain actuated beyond a
predetermined time interval.

25
CHAPTER 5

SOFTWARE DESCRIPTION

5.1 SKETCH

In the getting started guide (Windows, Mac OS X, Linux), you uploaded a sketch that
blinks an LED. In this tutorial, you'll learn how each part of that sketch works.

A sketch is the name that Arduino uses for a program. It's the unit of code that is uploaded
to and run on an Arduino board.

Arduino is an open source, computer hardware and software company, project, and user
community that designs and manufactures 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),[1] permitting the manufacture of Arduino boards and
software distribution by anyone. Arduino boards are available commercially in
preassembled form, or as do-it-yourself 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

26
toolchains, the Arduino project provides an integrated development environment (IDE)
based on the Processing language project.

The Arduino project started in 2003 as a program for students atthe


Interaction Design Institute Ivrea in Ivrea, Italy,[2] aiming to provide a low-cost and easy
way for novices and professionals to create devices that interact with their environment
using sensors and actuators. Common examples of such devices intended for beginner
hobbyists include simple robots, thermostats, and motion detectors.

Arduino

Arduino is an open-source electronics platform based on easy-to-use hardware and


software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or
a Twitter message - and turn it into an output - activating a motor, turning on an LED,
publishing something online. You can tell your board what to do by sending a set of
instructions to the microcontroller on the board. To do so you use the Arduino
programming language (based on Wiring), and the Arduino Software (IDE),based on
Processing.

Over the years Arduino has been the brain of thousands of projects, from everyday objects
to complex scientific instruments. A worldwide community of makers -students,
hobbyists, artists, programmers, and professionals - has gathered around this open-source
platform, their contributions have added up to an incredible amount of accessible
knowledge that can be of great help to novices and experts alike.

Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast
prototyping, aimed at students without a background in electronics and

27
programming. As soon as it reached a wider community, the Arduino board started
changing to adapt to new needs and challenges, differentiating its offer from simple 8-bit
boards to products for IoT applications, wearable, 3D printing, and embedded
environments. All Arduino boards are completely open-source, empowering users to build
them independently and eventually adapt them to their particular needs. The software, too,
is open-source, and it is growing through the contributions of users worldwide.

There are many other microcontrollers and microcontroller platforms available for
physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's
Handyboard, and many others offer similar functionality. All of these tools take the messy
details of microcontroller programming and wrap it up in an easy-to-use package.
Arduino also simplifies the process of working with microcontrollers, but it offers some
advantage for teachers, students, and interested amateurs over other systems:

• Inexpensive - Arduino boards are relatively inexpensive compared to other


microcontroller platforms. The least expensive version of the Arduino module can be
assembled by hand, and even the pre-assembled Arduino modules cost less than $50
• Cross-platform - The Arduino Software (IDE) runs on Windows, Macintosh OSX,
and Linux operating systems. Most microcontroller systems are limited to Windows.
• Simple, clear programming environment - The Arduino Software (IDE) is easy-to-
use for beginners, yet flexible enough for advanced users to take advantage of as well. For
teachers, it's conveniently based on the Processing programming environment, so students
learning to program in that environment will be familiar with how the Arduino IDE
works.

28
• Open source and extensible software - The Arduino software is published as open
source tools, available for extension by experienced programmers. The language can be
expanded through C++ libraries, and people wanting to understand the technical details
can make the leap from Arduino to the AVR C programming language on which it's
based. Similarly, you can add AVR-C code directly into your Arduino programs if you
want to.
• Open source and extensible hardware - The plans of the Arduino boards are published
under a Creative Commons license, so experienced circuit designers can make their own
version of the module, extending it and improving it. Even relatively inexperienced users
can build the breadboard version of the module in order to understand how it works and
save money.

5.2 Variables

A variable is a place for storing a piece of data. It has a name, a type, and a value. For
example, the line from the Blink sketch above declares a variable with the name ledPin,
the type int, and an initial value of 13. It's being used to indicate which Arduino pin the
LED is connected to. Every time the name ledPin appears in the code, its value will be
retrieved. In this case, the person writing the program could have chosen not to bother
creating the ledPin variable and instead have simply written 13 everywhere they
needed to specify a pin number. The advantage of using a variable is that it's easier to
move the LED to a different pin: you only need to edit the one line that assigns the initial
value to the variable.

5.3 Functions

29
A function (otherwise known as a procedure or sub-routine) is a named piece of code that
can be used from elsewhere in a sketch. For example, here's the definition of the
setup() function from the Blink example:

void setup()
{
pinMode(ledPin, OUTPUT);
}

The first line provides information about the function, like its name, "setup". The text
before and after the name specify its return type and parameters: these will be explained
later. The code between the { and } is called the body of the function: what the function
does.
pinMode(), digitalWrite(), and delay()

The pinMode() function configures a pin as either an input or an output. To use it, you
pass it the number of the pin to configure and the constant INPUT or OUTPUT. When
configured as an input, a pin can detect the state of a sensor like a pushbutton; As an
output, it can drive an actuator like an LED.

The digitalWrite() functions outputs a value on a pin.

For example, the line:

digitalWrite(ledPin, HIGH);

30
The delay() causes the Arduino to wait for the specified number of milliseconds before
continuing on to the next line. There are 1000 milliseconds in a second, so the line:

delay(1000);

setup() and loop()

There are two special functions that are a part of every Arduino sketch: setup() and
loop(). The setup() is called once, when the sketchstarts. It's a good place to do
setup tasks like setting pin modes or initializing libraries. The loop() function is called
over and over and is heart of most sketches.You need to include both functions in your
sketch, even if you don't need them for anything.

Everything between the /* and */ is ignored by the Arduino when it runs the sketch (the *
at the start of each line is only there to make the comment look pretty, and isn't required).
It's there for people reading the code: to explain what the program does, how it works, or
why it's written the way it is. It's a good practice to comment your sketches, and to keep
the comments up-to-date when you modify the code. This helps other people to learn from
or modify your code.

31
CHAPTER 6

ADVANTAGES AND APPLICATIONS

• Enhanced security.

• Automating tasks helping to reducing the need for human intervention.

• Saving time.

• Also man power required for the safety purposes.

• Low cost

• Enhanced convenience

32
CHAPTER 7

RESULT AND DISCUSSION

At first, the alcohol sensor senses the alcohol level in the air. When the sensed level goes
beyond ‘0’ the control will not be sent to the motor and the vehicle will not start. On the
other hand if the sensed level is below ‘1’ the control will be given to the motor and the
vehicle will start. The sensed level depends upon the sensitivity of the alcohol sensor. The
alcohol sensor is placed in one of the five ports in the microcontroller. It senses the
alcohol level in the human breath. The alcohol sensor takes atleast five to ten seconds to
sense the value. The sensed value will decrease and also wear helmet with time and when
the value goes below the set value the vehicle will start. And also send to the cloud which
shows all the sensed values.

Figure 7.1 : causes of fatal accidents

33
CHAPTER 8

CONCLUSION

In this paper, we proposed a method to sense the presence of alcohol from the touch of the
driver as drunk and driving accidents are one of the major problems faced in the society.
Due to the growing public knowledge advances regarding the importance of public safety,
it is gaining more acceptance than in the past. This paper provides an efficient solution to
develop an intelligent system for vehicles with multi-stage testing in order to avoid
accidents by shutting down the operation of vehicle. The system is designed and
implemented successfully via the use of ESP8266 microcontroller and MQ-3 sensor, Limit
switch. The whole system has an advantage of small volume and more reliability. The
sensor are very accurate and can be configured according to the requirements thereby
increasing the efficiency. Due to various features implemented here, it will be impossible
for drunk people to start their vehicle and bring any harm to innocent lives and property
using IOT cayenne app. This system brings innovation to the existing technology in the
vehicles, reduces the rate of accidents taking place and improves the safety features, hence
providing an effective development in the automobile industry. Thus, by implementing
this proposed system we can have a much safer world, free of drunk and driving.

34
REFERENCES

[1] Data from NCRB, Government of India with relation to the total number of
accidents taking place due to drunken driving from https://ncrb.gov.in/accidental-deaths-
suicidesindia-2018
[2] Traffic safety related information from https://prezi.com/8dbmlzvawt9d/traffic-
safety/
[3] Working of Arduino and required fundamentals from
https://www.arduino.cc/reference/en and https://create.arduino.cc/
[4] J. Dai, J. Teng, X. Bai, Z. Shen, and D. Xuan. "Mobile phone based drunk driving
detection." In 2010 4th International Conference on Pervasive Computing Technologies
for Healthcare, pp. 1-8. IEEE, 2010
[5] Z. Xiaorong, “The Drunk Driving Automatic Detection System Based on Internet of
Things”, International Journal of Control and Automation, Vol. 9, No. 2, 2016, pp.
297306 - https://www.sparkfun.com/datasheets/Sensors/M Q-3.pdf
[6] A. R. Varma, S. V. Arote, C. Bharti, and K. Singh. "Accident prevention using eye
blinking and head movement." IJCA Proceedings on Emerging
[7] Trends in Computer Science and Information Technology-2012 (ETCSIT2012)
etcsit1001 4 (2012): 31-35.
[8] Nova Explore Publications, Nova Journal of Engineering and Applied Sciences.
DOI: 10.20286/nova-jeas-060104Vol.6(1) 2017:1- 15Research Article
[9] V. Savania, H. Agravata and D. Patela , “Alcohol Detection and Accident
Prevention of Vehicle”, International Journal of Innovative and Emerging Research in
Engineering, Volume 2, Issue 3, 2015, pp 55-59

35

You might also like