0% found this document useful (0 votes)
52 views33 pages

Drink & Drive Detection

Uploaded by

amargs4774
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views33 pages

Drink & Drive Detection

Uploaded by

amargs4774
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Drink & Drive Detection Using MQ3 Sensor

ABSTRACT

Nowadays drinking and driving is the most common threat to their as well as others’ life. We
cannot stop people from drinking but we can avoid these accidents by checking the person of
drinking also we can put these types of small devices in vehicles to assure that no drink and
drive can further take place. Today we are going to make a simple alcohol indicator that can
be used in small devices or for the demonstration of simple small projects for an Alcohol
detector using Arduino.

The aim of our research paper is to represent our project which makes human driving safer
and to overcome accidents. This project is developed by integrating alcohol sensor with
Arduino board. Arduino processor ATmega328 is able to handle more functions than
conventional microcontrollers. The alcohol sensor used in this project is MQ3 which to
detect the alcohol content in human breath. Since sensor has fine sensitivity range around 2
meters, it can suit to any vehicle and can easily be hidden from the suspects. This project is
fitted inside the vehicle. The project is designed for the safety of people sitting inside the
vehicle.

SVPM’s ITE Malgeaon Bk. Page 1


Drink & Drive Detection Using MQ3 Sensor

CHAPTER 1

INTRODUCTION

1.1 Background

Worldwide, motor vehicle accidents are one of the leading causes of death, with alcohol-
related accidents playing a significant role, particularly in child death. Aiming to aid in the
prevention of this type of accidents, a novel non-invasive method capable of detecting the
presence of alcohol inside a motor vehicle is presented. The proposed methodology uses a
series of low-cost alcohol MQ3 sensors located inside the vehicle, whose signals are stored,
standardized, time-adjusted, and transformed into 5 s window samples. Statistical features are
extracted from each sample and a feature selection strategy is carried out using a genetic
algorithm, and a forward selection and backwards elimination methodology. The four
features derived from this process were used to construct an SVM classification model that
detects presence of alcohol. The experiments yielded 7200 samples, 80% of which were used
to train the model. The rest were used to evaluate the performance of the model, which
obtained an area under the ROC curve of 0.98 and a sensitivity of 0.979. These results
suggest that the proposed methodology can be used to detect the presence of alcohol and
enforce prevention actions.

1.2 Introduction

One of the leading causes of death among young people are motor vehicle crashes, young
drivers are 5 to 10 times more likely to experience injuries related to road crashes, and young
males have a higher crash rate than young females. There are several factors that may
contribute to the increased number of crashes, such as social, situational, and exposure
factors. Among social and situational factors include: the presence of passengers of similar
age that may distract the driver, fatigue is also a risk factor among young people as they are
affected by sleepiness more often, and social and economic status also plays and important
role as they social group may affect their driving behaviors by encouraging them to take
greater risks. Recently, the grow of mobile phone usage have increased the risk of crashing
among young people, due the increase in the level of cognitive and behavioral associated
with people that use their phones while driving. Alcohol consumption and drug usage while
driving increases the crash risk for all drivers despite their age group affecting the cognitive
process, thus increasing the risk of crashing.

SVPM’s ITE Malgeaon Bk. Page 2


Drink & Drive Detection Using MQ3 Sensor

On the other hand, exposure related factors include the weather condition, as it plays an
important influence on the crash rates, as the young people exhibit less experience dealing
with such conditions, such as snow, fog, rain, black ice conditions, etc. The type of road also
affect the risk of crashing as urban, regional, and rural roads present different conditions. The
time also increase the risk for young people as their are more likely to crash at night and over
the weekend, as we can see those risk factors plays an important role, thus measuring the
safety efficiency of the drivers is very important.

1.3 Motivation

In all the developed and developing countries, the transport system is one of the basic need
for everyone. But because of the drinking and driving the person may should have loose their
own lives. Over 10 year of period from 2012 to 2021 about 10,850 people died each year in
drunk driving car accidents. And according to study by WHO (World Health Organisation) in
2018 'South Africa' has the highest percentage of drunk driving deaths as compared to any
other country in the world.

1.4 Problem Statement

we can see many people are irresponsible towards the safe driving. Due to the drinking habit
of one they can lead their lives to the death. To overcome drunk driving we need to follow
the strict rules for driving any kind of Vehicles. The drink and drive detector will sense the
presence of alcohol in the air. And we will be able to make sure that drunk driving will not be
further take place.

1.5 Aim and objectives

Aim

The main aim of our project is to develop Arduino based MQ3 alcohol detection circuit
which will save the lives of human by checking whether the driver is drunk or not.

Objectives:

1) To find out the limitations of the existing system

2) Study of the previous work on the project so as to improve its efficiency

3) study of MQ3 ALCOHOL Sensor

SVPM’s ITE Malgeaon Bk. Page 3


Drink & Drive Detection Using MQ3 Sensor

4) Draw a block diagram

5) studying of various components used in the circuit

6) Design a circuit that integrates an MQ3 sensor with Arduino board to create drunk driving
detection circuit

7) Developing a prototype of the system that is reliable, easy to use and adjustable in terms of
sensitivity and duration of detection

8) Assessing the energy efficiency of the system to ensure minimal power consumption
during operation.

1.6 Need Of The Project

1) The drink and drive detection system is used to prevent accidents on the road happening
due to drinking habit of one's.

2) For today's world drinking is not just an addiction for some it's a habit for some it's a trend
but the impact of this is one have to loose their own lives.

3) This alcohol detection system is useful for detection the consumption of alcohol by the
driver of vehicle.

4) This system is small in size and uses love energy to operate,

5) overall this system can provide added safety, energy efficiency, convince and security
benefits to our transport system.

1.7 Theoretical background

MQ3 sensor

Sensitive material of MQ-3B gas sensor is SnO2, which with lower conductivity in clean air.
When the target alcohol gas exist, the sensor’s conductivity gets higher along with the gas
concentration rising. Users can convert the change of conductivity to correspond output
signal of gas concentration through a simple circuit.

SVPM’s ITE Malgeaon Bk. Page 4


Drink & Drive Detection Using MQ3 Sensor

MQ-3B gas sensor has high sensitivity to alcohol gas and can resistant to the interference of
gasoline, smoke and vapour. It is with low cost and suitable for various applications of
detecting alcohol at different concentration.

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. It’s conductivity increases as the
concentration of alcohol gases increases. It has high sensitivity to alcohol and has a good
resistance to disturbances due to smoke, vapor and gasoline. This module provides both
digital and analog outputs. MQ3 alcohol sensor module can be easily interfaced with
Microcontrollers, Arduino Boards, Raspberry Pi etc.

This alcohol sensor is suitable for detecting alcohol concentration on your breath, just like
your common breathalyzer. It has a high sensitivity and fast response time. Sensor provides
an analog resistive output based on alcohol concentration. The drive circuit is very simple, all
it needs is one resistor. A simple interface could be a 0-3.3V ADC.

Fig: 1.1 Construction of MQ3

The alcohol sensor is technically referred to as a MQ3 sensor which detects ethanol in the air.
When a drunk person breathes near the alcohol sensor it detects the ethanol in his breathe and
provides an output based on alcohol concentration. If there is more alcohol concentration
more LED's would lit.

SVPM’s ITE Malgeaon Bk. Page 5


Drink & Drive Detection Using MQ3 Sensor

Fig 1.2 MQ3 sensor pin configuration

MQ3 sensor range and features

1) 5V operation

2) Simple to use

3) LEDs for output and power

4) Output sensitivity adjustable

5) Analog output 0V to 5V

6) Digital output 0V or 5V

7) Low Cost

8) Fast Response

9) Stable and Long Life

10) Good Sensitivity to Alcohol Gas

11) Both Digital and Analog Outputs

12) On-board LED Indicator

SVPM’s ITE Malgeaon Bk. Page 6


Drink & Drive Detection Using MQ3 Sensor

Range of MQ3 sensor

25 to 500 ppm

1.8 Literature survey

1) RCH Chang, CY Wang, HH Li, CD Chiu - IEEE Access, 2021 - ieeexplore.ieee.org

Drunk driving accidents have been rapidly increasing in recent times. Although the statistics
show a decreasing trend in recent years, reports of drunk driving accidents are often seen in
the news. To assess vehicle operators for drunk driving, the police still use breath-alcohol
testers as the primary method. However, a certified instrument to measure alcohol
consumption is expensive, and the mouthpiece used in the instrument is a consumable.
Moreover, the breath detection method used involves contact measurement

In this paper author describes the alcohol detection system for vehicle by using alcohol
sensor, GPS and GSM module.

In this paper author discuss about the smart helmet system using alcohol detection for vehicle
protection.

This paper introduces methods such as alcohol detection, heart beat rate monitoring system
and personal identification system and discuss how they can be implemented to avoid
accidents.

Instead of using Arduino board in this project they used microcontroller 16F877A ]. in this
paper author discuss about driver’s behaviour, safety application & auto theft prevention
system .

This paper represents accident vehicle automatic detection system by image processing .

In this paper they describe about body area sensing, alcohol detection craving .

In our paper we discuss about the alcohol detection system for vehicle using alcohol sensor
MQ3 and buzzer using Arduino.

SVPM’s ITE Malgeaon Bk. Page 7


Drink & Drive Detection Using MQ3 Sensor

1.9 Project planning

A project plan sometimes called a work plan is a blueprint of the goal,


objective, and task your team need to accomplish for a specific project. Your
project plan should include information about your project schedule, scope, due
dates and deliveries for all phase of the project life cycle.

Activity/month of Dec23 Jan24 Feb24 March24 April24

2023-2024
Literature Review
Setup or system design
Project stage -1
submission
System setup /
manufacturing system
Experimental study
Result and discussion
Report writing and
submission

Table: 1.1 Project planning

SVPM’s ITE Malgeaon Bk. Page 8


Drink & Drive Detection Using MQ3 Sensor

CHAPTER 2

BLOCK DIAGRAM

2.1 Block Diagram

Fig: 2.1 Block Diagram

2.2 Block Diagram Description

1. MQ3 sensor

The MQ3 sensor is one of the most widely used in the MQ sensor series. It is a MOS (Metal
Oxide Semiconductor) sensor. Metal oxide sensors are also known as Chemiresistors because
sensing is based on the change in resistance of the sensing material when exposed to alcohol.

When a SnO2 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.

SVPM’s ITE Malgeaon Bk. Page 9


Drink & Drive Detection Using MQ3 Sensor

In 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.

2. Arduino UNO

The Arduino UNO is the best board to get started with electronics and coding. If this is your
first experience tinkering with the platform, the UNO is the most robust board you can start
playing with. The UNO is the most used and documented board of the whole Arduino family.

Arduino UNO is a microcontroller board based on the ATmega328P. 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. You can
tinker with your UNO without worrying too much about doing something wrong, worst case
scenario you can replace the chip for a few dollars and start over again.

Replaceable chip: The ATmega328P can easily be replaced, as it is not soldered to the board

Eeprom: The ATmega328P also features 1kb of EEPROM, a memory which is not erased
when powered off.

Battery Connector: The Arduino UNO features a barrel plug connector, that works great with
a standard 9V battery.

3. LCD display

The principle behind the LCDs is that when an electrical current is applied to the liquid
crystal molecule, the molecule tends to untwist. This causes the angle of light which is
passing through the molecule of the polarized glass and also causes a change in the angle of
the top polarizing filter. As a result, a little light is allowed to pass the polarized glass through
a particular area of the LCD.

Thus that particular area will become dark compared to others. The LCD works on the
principle of blocking light. While constructing the LCDs, a reflected mirror is arranged at the
back. An electrode plane is made of indium-tin-oxide which is kept on top and a polarized
glass with a polarizing film is also added on the bottom of the device. The complete region of

SVPM’s ITE Malgeaon Bk. Page 10


Drink & Drive Detection Using MQ3 Sensor

the LCD has to be enclosed by a common electrode and above it should be the liquid crystal
matter.

Next comes the second piece of glass with an electrode in the form of the rectangle on the
bottom and, on top, another polarizing film. It must be considered that both the pieces are
kept at the right angles. When there is no current, the light passes through the front of the
LCD it will be reflected by the mirror and bounced back. As the electrode is connected to a
battery the current from it will cause the liquid crystals between the common-plane electrode
and the electrode shaped like a rectangle to untwist. Thus the light is blocked from passing
through. That particular rectangular area appears blank.

4. Power supply

A power supply is an electrical device that supplies electric power to an electrical load. The
main purpose of a power supply is to convert electric current from a source to the correct
voltage, current, and frequency to power the load. As a result, power supplies are sometimes
referred to as electric power converters. Some power supplies are separate standalone pieces
of equipment, while others are built into the load appliances that they power. Examples of the
latter include power supplies found in desktop computers and consumer electronics devices.
Other functions that power supplies may perform include limiting the current drawn by the
load to safe levels, shutting off the current in the event of an electrical fault, power
conditioning to prevent electronic noise or voltage surges on the input from reaching the load,
power-factor correction, and storing energy so it can continue to power the load in the event
of a temporary interruption in the source power (uninterruptible power supply).

All power supplies have a power input connection, which receives energy in the form of
electric current from a source, and one or more power output or rail connections that deliver
current to the load. The source power may come from the electric power grid, such as an
electrical outlet, energy storage devices such as batteries or fuel cells, generators or
alternators, solar power converters, or another power supply. The input and output are usually
hardwired circuit connections, though some power supplies employ wireless energy transfer
to power their loads without wired connections. Some power supplies have other types of
inputs and outputs as well, for functions such as external monitoring and control.

SVPM’s ITE Malgeaon Bk. Page 11


Drink & Drive Detection Using MQ3 Sensor

5. LED (light emitting diode)

Light-emitting diode (LED) is a widely used standard source of light in electrical equipment.
It has a wide range of applications ranging from your mobile phone to large advertising
billboards. They mostly find applications in devices that show the time and display different
types of data.

A light-emitting diode (LED) is a semiconductor device that emits light when an electric
current flows through it. When current passes through an LED, the electrons recombine with
holes emitting light in the process. LEDs allow the current to flow in the forward direction
and blocks the current in the reverse direction.

When the diode is forward biased, the minority electrons are sent from p → n while the
minority holes are sent from n → p. At the junction boundary, the concentration of minority
carriers increases. The excess minority carriers at the junction recombine with the majority
charges carriers.

The energy is released in the form of photons on recombination. In standard diodes, the
energy is released in the form of heat. But in light-emitting diodes, the energy is released in
the form of photons. We call this phenomenon electroluminescence. Electroluminescence is
an optical phenomenon, and electrical phenomenon where a material emits light in response
to an electric current passed through it. As the forward voltage increases, the intensity of the
light increases and reaches a maximum.

6. Buzzer

A buzzer is understood as a device that creates an audible tone under the influence of an
applied external voltage. This output may either be in the form of a buzzing or a beeping
sound. This is a result of the induced rapid movements created in the diaphragm of the
buzzer.

SVPM’s ITE Malgeaon Bk. Page 12


Drink & Drive Detection Using MQ3 Sensor

CHAPTER 3

CIRCUIT DIAGRAM

3.1 Circuit Diagram

Fig 3.1: Circuit Diagram

3.2 Working

The stuff we are going to used today to build an alcohol indicator is Arduino, LEDs, and an
MQ-3 Alcohol sensor. There are many MQ-X sensors is available in the market for different
uses but we are here going to use MQ-3 because it is best for detecting alcohol. The working
of most of the MQ sensors is the same. They all contain a heating element that heats up a
layer of conducting material whose resistance is continuously measured. Its resistance
changes when fumes or smell from alcohol comes in contact with the MQ-3 sensor. Arduino
based alcohol detector having the mq3 sensor the specification given above. which can be
monitor in our IoT based alcohol detector project.

SVPM’s ITE Malgeaon Bk. Page 13


Drink & Drive Detection Using MQ3 Sensor

The sensor also has an onboard power led and also an onboard Status led which will blink
whenever the sensor detects alcohol(fumes).

The sensor gives both digital and analog output. The difference between the two is very
simple in digital output only high or low means either 1 or 0 is transmitted to a
microcontroller but in the analog signal, a wide range of values from 0 to 1023 is transmitted
to the microcontroller which corresponds to the intensity of alcohol in the nearby
environment. The sensor is built out of LM393 IC which has an inbuilt amplifier that
amplifies the voltage signal to the detectable range. Also, it has voltage comparators for
efficient amplification. The amount of amplification can be adjusted with the help of
potentiometers given on the sensor.

As the code starts it initializes the pin to which the sensor sends its data. Then is setup we
define the type of function we want on the initialized pins like input or output. Then in the
loop, we read the data available on pin 3 and then print that value on our monitor. We also
check for the condition of sensor data to be either high or low and according to the condition
led glows and turns off.

In the buzzer code, we also initialize the buzzer pin to pin 13 and set pin mode to OUTPUT
in the setup section. In the loop section along with the led we switch Buzzer also high and
low. By this a simple DIY alcohol detector is complete and it can be used in various places.

SVPM’s ITE Malgeaon Bk. Page 14


Drink & Drive Detection Using MQ3 Sensor

CHAPTER 4

HARDWARE & SOFTWARE REQUIREMENT

4.1 Hardware Requirement

List of various components used for constructing the device given described as follows

 Arduino Uno
 MQ3 sensor
 LCD Display
 Power Supply
 LED
 Buzzer

1. Arduino Uno:

Fig 4.1: Arduino Uno

SVPM’s ITE Malgeaon Bk. Page 15


Drink & Drive Detection Using MQ3 Sensor

Arduino board includes a microcontroller, and this microcontroller is what executes the
instructions in your program. If you know this, you won't use the common nonsense phrase
"Arduino is a microcontroller" ever again. The Arduino Uno is an open source
microcontroller board based on the Microchip ATmega328P microcontroller and developed
by Arduino.cc. The board is equipped with sets of digital and analog input/output pins that
may be interfaced to various expansion boards (shields) and other circuits. The board has 14
digital I/O pins, 6 analog I/O pins, and is programmable with the Arduino IDE, it can be
powered by the USB cable or by an external 9-volt battery, though it accepts voltages
between 7 and 20 volts.

Since Arduino is Open Source, the CAD and PCB design is freely available Everyone
can buy a pre-assembled original Arduino board2 or a cloned board from another company.
You can also build an Arduino for yourself or for selling. Although it is allowed to build and
sell cloned Arduino boards, it's not allowed to use the name Arduino and the corresponding
logo. Most boards are designed around the Atmel Atmega328.

2. MQ3 Sensor

Fig 4.2: MQ3

This module is made using Alcohol Gas Sensor MQ3. 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.
It’s conductivity increases as the concentration of alcohol gases increases. It has high
sensitivity to alcohol and has a good resistance to disturbances due to smoke, vapor and
gasoline. This module provides both digital and analog outputs. MQ3 alcohol sensor module
can be easily interfaced with Microcontrollers, Arduino Boards, Raspberry Pi etc.

SVPM’s ITE Malgeaon Bk. Page 16


Drink & Drive Detection Using MQ3 Sensor

This alcohol sensor is suitable for detecting alcohol concentration on your breath, just like
your common breathalyzer. It has a high sensitivity and fast response time. Sensor provides
an analog resistive output based on alcohol concentration. The drive circuit is very simple, all
it needs is one resistor. A simple interface could be a 0-3.3V ADC.

Features

1) 5V operation

2) Simple to use

3) LEDs for output and 4) power

5) Output sensitivity adjustable

6) Analog output 0V to 5V

7) Digital output 0V or 5V

8) Low Cost

9) Fast Response

10) Stable and Long Life

11) Good Sensitivity to Alcohol Gas

12) Both Digital and Analog Outputs

13) On-board LED Indicator

3. LCD Display:

Fig 4.3: LCD

SVPM’s ITE Malgeaon Bk. Page 17


Drink & Drive Detection Using MQ3 Sensor

The term LCD stands for liquid crystal display. It is one kind of electronic display module
used in an extensive range of applications like various circuits & devices like mobile phones,
calculators, computers, TV sets, etc. These displays are mainly preferred for multi-segment
light-emitting diodes and seven segments. The main benefits of using this module are
inexpensive; simply programmable, animations, and there are no limitations for displaying
custom characters, special and even animations, etc.

 Pin1 (Ground/Source Pin): This is a GND pin of display, used to connect the GND
terminal of the microcontroller unit or power source.
 Pin2 (VCC/Source Pin): This is the voltage supply pin of the display, used to connect
the supply pin of the power source.
 Pin3 (V0/VEE/Control Pin): This pin regulates the difference of the display, used to
connect a changeable POT that can supply 0 to 5V.
 Pin4 (Register Select/Control Pin): This pin toggles among command or data register,
used to connect a microcontroller unit pin and obtains either 0 or 1(0 = data mode,
and 1 = command mode).
 Pin5 (Read/Write/Control Pin): This pin toggles the display among the read or writes
operation, and it is connected to a microcontroller unit pin to get either 0 or 1 (0 =
Write Operation, and 1 = Read Operation).
 Pin 6 (Enable/Control Pin): This pin should be held high to execute Read/Write
process, and it is connected to the microcontroller unit & constantly held high.
 Pins 7-14 (Data Pins): These pins are used to send data to the display. These pins are
connected in two-wire modes like 4-wire mode and 8-wire mode. In 4-wire mode,
only four pins are connected to the microcontroller unit like 0 to 3, whereas in 8-wire
mode, 8-pins are connected to microcontroller unit like 0 to 7.
 Pin15 (+ve pin of the LED): This pin is connected to +5V
 Pin 16 (-ve pin of the LED): This pin is connected to GND.

In this Project we are using LCD display to display the when machine star it will display and
also when machine stop it will display stopLCD (Liquid Crystal Display) screen is an
electronic display module and find a wide range of applications. A 16x2 LCD display is very
basic module and is very commonly used in various devices and circuits. These modules are
preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are
economical; easily programmable; have no limitation of displaying special & even custom

SVPM’s ITE Malgeaon Bk. Page 18


Drink & Drive Detection Using MQ3 Sensor

characters (unlike in seven segments), animations and so on. .A 16x2 LCD means it can
display 16 and..

4. Power Supply:

Fig 4.4:Power Supply

A 9 volt battery can power a variety of small elrctronic project from simple circuit to more
complex device . the basic working principle involve using the voltage provided by the
battery to supply power to the component in the circuit. We use Hi- Waote 9v battery is the
most commonly used and portable 9v battery. It non rechargeable and is a high capacity and
low cost solution for many electronic device. It is based on zinc carbon chemisty and can be
used easily replaced if the discharged just like any standard AA ana AAA batteries .

SVPM’s ITE Malgeaon Bk. Page 19


Drink & Drive Detection Using MQ3 Sensor

The bateery can be used to power LED toys flashlight and torch , electronic equipment like
multimeter ,wall clock, or other device with a 9v system a battery snap connector is generally
used to connect it with a breadboard.

Specification

* Modem Number : 9V 6F 22

Battery Type : zinc carbon

Size : 6F22 006P

Jacket : metal

Single batteries dimension : L-26,5,H-48,5.W-17.5

Nominal Voltage (V) : 9v

Discharge resistance : 620

Cut off voltage : 5.4

4.2 SOFTWARE REQUIREMENT:

 Keil Vision IDE


 MC Programming Language: Embedded C
 Openting System: Windows 10
 Pogramming Language: Embedded C
 compiler: Arduino Compiler
 IDE: Arduino uno

Arduino IDE: Arduino IDE (Integrated Development Environment) is a software platform


that enables a user to program Arduino or any controller of the ATmeg fanih The back-end of
this software is developed using JAVA This IDE provides a user the liberty to program an
Arduino using C language

1. Software Implementation

SVPM’s ITE Malgeaon Bk. Page 20


Drink & Drive Detection Using MQ3 Sensor

The software that is used to program the microcontroller is open-source-software and can be
downloaded for free on www arduino.cc. With this "Arduino software you can write little
programs which the microcontroller should perform. This program are called "Sketch" In the
end the sketches are transferred to the microcontroller by USB cable. More on that later on
the subject "programing".

Installation:Now one after another the Arduino software and the USB driver for the board
have to be installed. 2.2.11 Installation and set up of the Arduino softwarel. Download the
Arduino software on www.arduino.cc and install it on the computer (The microcontroller
NOT connected to the PC). After that you open the software file and start 6 the program
named arduino. Exe Two set ups on the program are important and should be considered. a)
The board that you want to connect, has to be selected on the arduino software. The
"Funduino Uno is here known as "Arduino/Genuino Uno"

It connects to the Arduino and hardware to upload programs and communicate with them.
The IDE consists of two main parts viz

 void setup(): This is the location where a user can initialize all the variables that will
be required during the course of programming a system. As the name suggests, this
function is used to set up an Arduino before interfacing it with other circuits. This
area can also be used to include libraries of various sensors The popularly used
functions in void setup are:
 pinMode: This function is used to declare pins of Arduino as input or output
 serial.begin: This function is used when Arduino is communicating with other sensors
or devices. This enables a user to set a specific baud rate for communication purpose.
 void loop(): The code written in this space will run over and over again unless
Arduino is interrupted using an interrupt of the USB cable is disconnected from the
USB port. The different functions that are often used in void loop are:
 digitalWrite: This function is used to make a specific pin on Arduino logically HIGH
or LOW.
 digitalRead: This function is used when there is a need to read digital data from a
sensor or when we have to control something using a switch/ push button.
 AnalogRead: This function comes in handy when we have to read analog data from a
sensor eg. Analog read is used when there is a need to read data from a potentiometer.

SVPM’s ITE Malgeaon Bk. Page 21


Drink & Drive Detection Using MQ3 Sensor

 Analog Write: This function is used when a user wants to supply analog voltages to a
component. The best example of analog write is when the intensity of LED is
controlled using a potentiometer and analog write function.

4.3 COSTING ANALYSIS

1) Arduino UNO: 800/-

2) MQ3 sensor: 360/-

3) LCD display: 410/-

4) Buzzer: 40/-

5) Battery: 30/-

Total costing of project

Components charge + miscellaneous charge

Total costing of project= 1640 + 800

Total costing of project = 2440/-

SVPM’s ITE Malgeaon Bk. Page 22


Drink & Drive Detection Using MQ3 Sensor

CHAPTER 5

DESIGN AND DEVELOPMENT

This paper proposes a MQ3 Sensor Switch which can detect the presence of alcohol in the
air. The sensor will automatically sense the presence of ethanol in the air and will give the
output on the LCD display. MQ3 sensor allow you to sense alcohol sensors allow you to
sense. They are small, inexpensive, low-power, easy to use and don't wear out. For that
reason they are commonly found in appliances and gadgets used in homes or businesses.
They are often referred to as MQ3, (metal oxide semiconductor) sensor.

1. Sensor Type: Choose an appropriate sensor type for detecting the presence of alcohol, such
as MQ3 sensors, MQ2 sensors. Consider the range and sensitivity of the sensor to ensure it
can detect alcohol level effectively.

2. Power Source: Determine the power source for the Alcohol detection system, whether it
will be battery-operated or connected to a power outlet. Consider the power consumption of
the system to ensure long-lasting operation.

3. System Design: this system can be utilize in EV (Electric Vehicles), or RTO'S can also
have this system to detect whether the driver is drunk or not.

5.1 Construction:

1. Assemble the Components: Gather all the necessary components for the drink and
drive alcohol detection system, including the sensor, object, power source, Test each
component to ensure they are functioning properly before assembly.
2. Install the Sensor: Mount the MQ3 sensor in a strategic location where it can detect
alcohol presence effectively. Adjust the sensitivity and range of the sensor as needed
for optimal performance.
3. Test and Adjust: Test the Dry hand washing machine to save the water system to
ensure it functions intended. Make any necessary adjustments to the sensor
sensitivity, lighting settings, or power source to optimize performance.
4. Install and Maintain: Install in Dry hand washing machine to save the water its
intended object, whether. Regularly check and maintain the system to ensure
continued functionality and reliability.

SVPM’s ITE Malgeaon Bk. Page 23


Drink & Drive Detection Using MQ3 Sensor

5.2 Assembly process.

First, the wanted circuit is drawn on paper & it is modified or designed PCB layout is to be
drawn on the plain copper coated board. These boards are available in two types:

Component Assembly:

a) Preferably, place the component sin X-Y direction subjected to mechanicid construction

b) All components should be flat mounted Le flat placed to avoid of lead sand For easy
requirements. However in case of space limitation thed components such as resistors, diode
set may be mounted vertically which does not affect the performance.

c) In case of separate analog and digital ground a capacitor should be connected in between
the analog and digital ground.x

d) Orientation of mutli lead components (eg. switches ICs) should be such that axis of
component is perpendicular to the direction of solder wave

e) Sufficient clearance is provided around component so that inversion or replacement and


repair is easy

f) The design should be such that minimum jumpers are allowed

g) It is preferably that components like presets, coils and trim pots ete which alignment or
calibration are placed in such a way that they are accessibly after the assembly of PCB on
cabinets.

h) If the components are not flush mounted them sleeve for leads.

The material joined, and where by the surface of the parts are wetted, without becoming
molten. Soldering generally implied that the joining process occurs the temperatures below
450-degree centigrade. Solder wets and alleys with the base metal & gets drawn by capillary
action, into the gap between them. The process forms a metallurgical bond between the parts
of the joint. Soldering consists of the relative positioning of the surfaces to be joined, wetting
these surfaces with molten solder & allowing the Solder to cool down until a hao solidified.
During these soldering operations, an auxiliary medium is mostly used to increase the flow
properties of molten solder to improve the degree of wetting. Such a medium is called flus.
Following characteristics are required in the should provide a liquid cover over the materials

SVPM’s ITE Malgeaon Bk. Page 24


Drink & Drive Detection Using MQ3 Sensor

the soldering temperature. It should dissolve oxide on the metal surface are on the solder &
carry such unwanted elements away. It should be readily displaced from the metal by molten
soldering operations Residues should be removed after completion of the solder. To achieve a
solder joint the shoulder and the base metal must be heated above the melting pots of the
solder used with the soldered PCB many contaminants can be found which may produce
difficulties with the functioning of circuit. These are the removed through a cleaning process.

Soldering

Soldering is a process used for joining metal parts to form a mechanical or electrical bond. It
typically uses a low melting point metal alloy (solder) which is melted and applied to the
metal parts to be joined and this bonds to the metal parts and forms a connection when the
solder solidifies.

Soldering uses a filler metal with a low melting point, also known as solder, to join metal
surfaces. The solder is usually made up of an alloy consisting of tin and lead whose melting
point is around 235°C and 350°C, respectively.

But when tin and lead are mixed then the melting point of the mixture is reduced to 183°C.
The alloy is melted by using a hot iron at above 316 °C (600 °F).

As the solder cools, it creates a strong electrical and mechanical bond between the metal
surfaces. The bond allows the metal parts to achieve electrical contact while it is held in
place.

Note that lead-free solders are increasingly used as an alternative to environmentally harmful
lead-based solders due to regulations.

SVPM’s ITE Malgeaon Bk. Page 25


Drink & Drive Detection Using MQ3 Sensor

CHAPTER 6

FLOWCHART AND ALGORITHM

6.1 Flowchart

Fig 6.1: Flowchart

6.2 Algorithm

To create an Drink and Drive Alcohol detection system to detect using arduino uno, and MQ3
sensor you can follow this algorithm

Step 1 – start

Step 2 – initialize microcontroller

Step 3 - initialize the MQ3 sensor

SVPM’s ITE Malgeaon Bk. Page 26


Drink & Drive Detection Using MQ3 Sensor

Step 4 - if Alcohol detectes

Step 5 – Moniter MQ3 Sensor

Step 6 – Stop

6.3 Program Code

//put this code for LED in the ide of arduino from this line

int LED = 9;

int ALCOHOL_sensor = 3;// MQ-6 SENSOR

int ALCOHOL_detected;

void setup()

Serial.begin(9600);

pinMode(LED, OUTPUT);

pinMode(ALCOHOL_sensor, INPUT);

void loop()

ALCOHOL_detected = digitalRead(ALCOHOL_sensor);

Serial.println(ALCOHOL_detected);

if (ALCOHOL_detected == 1)

Serial.println("ALCOHOL detected...");

digitalWrite(LED, HIGH);

SVPM’s ITE Malgeaon Bk. Page 27


Drink & Drive Detection Using MQ3 Sensor

else

Serial.println("No ALCOHOL detected ");

digitalWrite(LED, LOW);

//For buzzer put this code in Arduino IDE

int LED = 9;

int BUZZER = 10;

int ALCOHOL_sensor = 3;// MQ-3 SENSOR

int ALCOHOL_detected;

void setup()

Serial.begin(9600);

pinMode(LED, OUTPUT);

pinMode(BUZZER, OUTPUT);

pinMode(ALCOHOL_sensor, INPUT);

void loop()

ALCOHOL_detected = digitalRead(ALCOHOL_sensor);

Serial.println(ALCOHOL_detected);

SVPM’s ITE Malgeaon Bk. Page 28


Drink & Drive Detection Using MQ3 Sensor

if (ALCOHOL_detected == 1)

Serial.println("ALCOHOL detected...");

digitalWrite(LED, HIGH);

digitalWrite(BUZZER, HIGH);

else

Serial.println("No ALCOHOL detected.");

digitalWrite(LED, LOW);

digitalWrite(BUZZER, LOW);

SVPM’s ITE Malgeaon Bk. Page 29


Drink & Drive Detection Using MQ3 Sensor

CHAPTER 7

RESULT AND DISCUSSION

Fig 6.1 Actual Project

 Successfully MQ3 sensor detected the presence of alcohol as it is connected to


arduino uno board.
 In this way , we have to implement a Alcohol detection system to save the lives of
suffering people. The MQ3 sensor and LCD display to dislay the presence and
absence of alcohol.
 When the alcohol will be detected the electric vehicle will stop automatically.
 We have implemented our proposed model experimentally for calculating roughly to
get the view that is really useful for detection of alcohol.

SVPM’s ITE Malgeaon Bk. Page 30


Drink & Drive Detection Using MQ3 Sensor

CHAPTER 8

ADVANTAGES & APPLICATIONS

8.1 Advantages

 It is available at cheaper price.


 It has long life cycle.
 It offers high stability.
 It has high sensitivity which results into faster response time.
 It needs simple drive circuit and it is simple to use.
 It is easy to interface with microcontrollers.
 Alcohol sensor based car protects you when you are drunk. During such condition,
your other family member can drive. Moreover it will protect your car from
unauthorized access.
 Low cost
 Automated Operation
 Low Power Consumption
 It provides an automatic safety system for cars and other vehicles as well.

8.2 Applications

 Alcohol detection system can be used in the various vehicles for detecting whether the
driver is consumed alcohol or not.
 This project can also be used in various companies or organizations to detect the
consumption by employees.
 Alcohol detection systems in cars provides an automatic safety system for cars and
other vehicles as well.

SVPM’s ITE Malgeaon Bk. Page 31


Drink & Drive Detection Using MQ3 Sensor

CHAPTER 9

CONCLUSION

System constantly monitors the sensitivity of alcohol sensor for drunk driver detection. If
driver is drunk, the processor instantly stops the system ignition by stopping the motor. If
alcohol sensor is not giving high alcohol intensity signals, system lets vehicle run.

Drinking and driving is a severe offence and can result in severe road accidents and property
losses. Hence, one must avoid getting involved in such cases, which can result in one's death
and severe health injuries.

The system is able to measure the alcohol concentration from breath sample and control the
operation of the car ignition system to prevent drunk driving. Also, the use of virtual
instrumentation provides high flexibility, unlike traditional solutions.

SVPM’s ITE Malgeaon Bk. Page 32


Drink & Drive Detection Using MQ3 Sensor

REFERENCES

 Lea Angelica Navarro, Mark Anthony Diño, Exechiel Joson, Rommel Anacan,
Roberto Dela Cruz Electronics Engineering Department, Technological Institute of
the Philippines- Manila Manila, Philippines-Design of Alcohol Detection System for
Car Users thru Iris Recognition Pattern Using Wavelet Transform[2016 7th
International Conference on Intelligent Systems, Modelling and Simulation]
 Cahalan, D., I. Cisin, and Crossley, American Drinking Practices: A National Study
of Driving Behaviour and Attitudes. 1969, Rutgers University Press: New Brunswick,
NJ.
 MUGILA.G, MUTHULAKSHMI.M, SANTHIYA.K, Prof.DHIVYA.P- SMART
HELMET SYSTEM USING ALCOHOL DETECTION FOR VEHICLE
PROTECTION [International Journal of Innovative Research in Science Engineering
and Technology (IJIRTSE) ISSN: 2395-5619, Volume – 2, Issue – 7. July 2016]
 Dhivya M and Kathiravan S, Dept. of ECE, Kalaignar Karunanidhi Institute of
Technology- Driver Authentication and Accident Avoidance System for
Vehicles[Smart Computing Review, vol. 5, no. 1, February 2015]
 Babor, AUDIT: The alcohol use disorders identification Test: Guidelines for use in
primary health care. 1992, Geneva, Switzerland: World Health Organization.
 http://www.arduino.cc/

SVPM’s ITE Malgeaon Bk. Page 33

You might also like