1.alcohol Bill Sense Engine Lock Using Arduino
1.alcohol Bill Sense Engine Lock Using Arduino
1
SYNOPSIS
Drunk driving is one of the major reasons behind road accidents worldwide.
In all of the road accident cases worldwide drivers have been observed to have
excess alcohol content in their blood. So we here design a smart alcohol detector
system using arduino coupled with gsm and gps for location transmission.
The system allows for automatic sensing of alcohol in breath, we also use a
send an SMS message to the concerned person in case alcohol is detected and stop
The system consists of an Arduino Uno board along with an Mq-3 alcohol
sensor for detection and a GSM/GPS Module for notification. In the case of a sober
driver i.e. the alcohol is under the permissible limits the car will normally which is
indicated by the motor rotating, but in the case of a drunk driver, the alcohol
content would be higher than the permissible limit which is detected by the alcohol
sensor and the Arduino controller which stops the motor so that drunk driving can
members along with the location of the car so that assistance can be provided. The
2
INTRODUCTION
3
1. INTRODUCTION
consuming alcohol, which reduces their ability to concentrate, slows reaction time,
and impairs judgment. To reduce such incidents, modern technology can be used to
detect alcohol consumption and prevent a driver from starting the vehicle.
The Alcohol Breath Sensor Based Engine Lock System using Arduino Uno
before the vehicle engine starts. The system uses an MQ-2 Gas Sensor to sense
alcohol vapors and send the signal to the Arduino microcontroller. Based on the
detected alcohol level, the microcontroller decides whether to allow the engine to
If alcohol is detected above the preset threshold level, the system prevents
the engine from starting by disabling the ignition circuit through a relay. At the
same time, a buzzer alert is activated and a warning message is displayed on the
LCD screen. If no alcohol is detected, the system allows the engine to start
systems can be used to create an intelligent vehicle safety system that helps prevent
4
BLOCK DIAGRAM
5
2. BLOCK DIAGRAM
6
2.1 BLOCK DIAGRAM DESCRIPTION
unit, alcohol sensor, microcontroller, display unit, buzzer, and motor (engine). The
power supply section includes a transformer, rectifier, and voltage regulator which
convert the 230V AC mains into a stable 5V DC required for the circuit operation.
The alcohol sensor continuously monitors the presence of alcohol in the driver’s
This signal is fed into the microcontroller (Arduino), which acts as the central
processing unit of the system. The microcontroller processes the sensor data and
below the limit, the system allows normal operation and the motor (representing
the vehicle engine) runs smoothly. If the alcohol level exceeds the threshold, the
an audible alert indicating alcohol detection. The display unit (LCD) shows real-
Engine Locked,” providing clear information to the user. Thus, the system ensures
7
CIRCUIT DIAGRAM
8
3. CIRCUIT DIAGRAM
9
3.1 WORKING PRINCIPLE
The Alcohol Breath Sensor Based Engine Lock System using Arduino Uno
is designed to prevent a vehicle from starting if the driver has consumed alcohol.
The system mainly uses an MQ-2 Gas Sensor (used as alcohol/gas sensor in the
circuit), a microcontroller, relay module, buzzer, LCD display, and a power supply
When the driver attempts to start the vehicle, the alcohol sensor placed near
the steering wheel or dashboard detects the presence of alcohol in the driver’s
breath. The MQ-2 sensor senses alcohol vapor and converts it into an analog
voltage signal. This signal is sent to the Arduino Uno, which continuously reads
the sensor value through its analog input pins. Inside the Arduino, a programmed
threshold value is set for the allowable alcohol level. The microcontroller
compares the received sensor value with this preset limit. If the detected alcohol
level is below the threshold, the Arduino allows the engine to start. It activates the
relay, which completes the ignition circuit, enabling the vehicle engine to run. At
identifies that the driver has consumed alcohol. In this condition, the
microcontroller does not activate the relay, which keeps the ignition circuit open
10
and prevents the engine from starting. The system also triggers a buzzer alarm to
alert nearby people and displays a warning message like on the LCD. The power
bridge rectifier, filter capacitor, and voltage regulator to provide stable power to
the Arduino, sensor, and other components. Thus, the system continuously
monitors the driver's breath and automatically controls the ignition system. This
helps prevent drunk driving and improves road safety by ensuring that the vehicle
11
HARDWARE COMPONENTS
12
4. HARDWARE COMPONENTS
electrochemical sensor these sensors are sensitive to a range of gasses are used at
clean air. When the target explosive gas exists, then the sensor’s conductivity
increases more increasing more along with the gas concentration rising levels. By
The MQ135 gas sensor has high sensitivity in ammonia, sulfide, benzene
steam, smoke, and in other harm full gas. It is low cost and suitable for different
applications. There are different types of alcohol sensors like MQ-2, MQ-3, MQ-4,
An alcohol sensor detects the attentiveness of alcohol gas in the air and an
temperatures ranging from -10 to 50° C with a power supply is less than 150 Ma to
5V. The sensing range is from 0.04 mg/L to 4 mg/L, which is suitable for
breathalyzers.
13
Basic Pin Configuration Of Alcohol Sensor
and the other three pins are A, H, B out of the total 6-pins we use only 4 pins. The
two pins A, H are used for the heating purpose and the other two pins are used for
the ground and power. There is a heating system inside the sensor, which is made
up of aluminum oxide, tin dioxide. It has heat coils to produce heat, and thus it is
used as a heat sensor. The below diagram shows the pin diagram and the
element inside a tubular casing. The end face of the sensor is enclosed by a
stainless steel net and the backside holds the connection terminals. Ethyl alcohol
present in the breath is oxidized into acetic acid passing through the
14
heating element. With the ethyl alcohol cascade on the tin dioxide sensing layer,
the resistance decreases. By using the external load resistance the resistance
4.2 MICROCONTROLLER
to 1 MIPS per MHz. This empowers system designers to optimize the device for
Feature
● High performance, low power AVR® 8-bit microcontroller
● Advanced RISC architecture
● High endurance non-volatile memory segments
15
Pin configuration
Pin Descriptions
GND Ground.
(selected for each bit). The Port B output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, port B pins
that are externally pulled low will source current if the pull-up resistors are
activated. The Port B pins are tri-stated when a reset condition becomes active,
16
even if the clock is not running. Depending on the clock selection fuse settings,
PB6 can be used as input to the inverting oscillator amplifier and input to the
internal clock operating circuit. Depending on the clock selection fuse settings,
PB7 can be used as output from the inverting oscillator amplifier. If the internal
input for the asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.
Port C (PC5:0)
(selected for each bit). The PC5..0 output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port C pins
that are externally pulled low will source current if the pull-up resistors are
activated. The port C pins are tri-stated when a reset condition becomes active,
PC6/RESET
this pin for longer than the minimum pulse length will generate a reset, even if the
17
Port D (PD7:0)
(selected for each bit). The port D output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, port D pins
that are externally pulled low will source current if the pull-up resistors are
activated. The port D pins are tri-stated when a reset condition becomes active,
AVCC
AVCC is the supply voltage pin for the A/D converter, PC3:0, and ADC7:6.
It should be externally connected to VCC, even if the ADC is not used. If the ADC
is used, it should be connected to VCC through a low-pass filter. Note that PC6..4
AREF
ADC7:6
(TQFP and QFN/MLF Package Only) In the TQFP and QFN/MLF package,
ADC7:6 serve as analog inputs to the A/D converter. These pins are powered from
18
Block Diagram
19
The AVR® core combines a rich instruction set with 32 general purpose
working registers. All the 32 registers are directly connected to the arithmetic logic
instruction executed in one clock cycle. The resulting architecture is more code
byteoriented 2-wire serial interface, an SPI serial port, a 6-channel 10-bit ADC (8
internal oscillator, and five software selectable power saving modes. The idle mode
stops the CPU while allowing the SRAM, Timer/Counters, USART, 2-wire serial
interface, SPI port, and interrupt system to continue functioning. The power-down
mode saves the register contents but freezes the oscillator, disabling all other chip
functions until the next interrupt or hardware reset. In power-save mode, the
asynchronous timer continues to run, allowing the user to maintain a timer base
while the rest of the device is sleeping. The ADC noise reduction mode stops the
CPU and all I/O modules except asynchronous timer and ADC, to minimize
20
switching noise during ADC conversions. In standby mode, the crystal/resonator
oscillator is running while the rest of the device is sleeping. This allows very fast
start-up combined with low power consumption. The device is manufactured using
Atmel high density non-volatile memory technology. The on-chip ISP flash allows
boot program running on the AVR core. The boot program can use any interface to
download the application program in the application flash memory. Software in the
boot flash section will continue to run while the application flash section is
is supported with a full suite of program and system development tools including:
This section discusses the AVR® core architecture in general. The main
function of the CPU core is to ensure correct program execution. The CPU must
uses a harvard architecture – with separate memories and buses for program and
data.
22
Instructions in the program memory are executed with a single level
pipelining. While one instruction is being executed, the next instruction is pre-
flash memory.
8-bit general purpose working registers with a single clock cycle access
logic unit (ALU) operation. In a typical ALU operation, two operands are output
from the register file, the operation is executed, and the result is stored back in the
register file – in one clock cycle. Six of the 32 registers can be used as three 16-bit
indirect address register pointers for data space addressing – enabling efficient
address calculations. One of the these address pointers can also be used as an
address pointer for look up tables in flash program memory. These added function
registers are the 16-bit X-, Y-, and Z-register, described later in this section. The
constant and a register. Single register operations can also be executed in the ALU.
about the result of the operation. Program flow is provided by conditional and
unconditional jump and call instructions, able to directly address the whole address
space. Most AVR® instructions have a single 16-bit word format. Every program
23
memory address contains a 16- or 32-bit instruction. Program flash memory space
is divided in two sections, the boot program section and the application program
section. Both sections have dedicated lock bits for write and read/write protection.
The SPM instruction that writes into the application flash memory section must
reside in the boot program section. During interrupts and subroutine calls, the
return address program counter (PC) is stored on the stack. The stack is effectively
allocated in the general data SRAM, and consequently the stack size is only limited
by the total SRAM size and the usage of the SRAM. All user programs must
initialize the SP in the reset routine (before subroutines or interrupts are executed).
The stack pointer (SP) is read/write accessible in the I/O space. The data SRAM
can easily be accessed through the five different addressing modes supported in the
AVR architecture. The memory spaces in the AVR architecture are all linear and
regular memory maps. A flexible interrupt module has its control registers in the
I/O space with an additional global interrupt enable bit in the status register. All
interrupts have a separate interrupt vector in the interrupt vector table. The
interrupts have priority in accordance with their interrupt vector position. The
lower the interrupt vector address, the higher the priority. The I/O memory space
contains 64 addresses for CPU peripheral functions as control registers, SPI, and
other I/O functions. The I/O memory can be accessed directly, or as the data space
locations following those of the register file, 0x20 - 0x5F. In addition, the
24
ATmega328P has extended I/O space from 0x60 - 0xFF in SRAM where only the
The high-performance AVR ALU operates in direct connection with all the
immediate are executed. The ALU operations are divided into three main
Status Register
The status register contains information about the result of the most recently
executed arithmetic instruction. This information can be used for altering program
flow in order to perform conditional operations. Note that the status register is
updated after all ALU operations, as specified in the instruction set reference. This
will in many cases remove the need for using the dedicated compare instructions,
resulting in faster and more compact code. The status register is not automatically
stored when entering an interrupt routine and restored when returning from an
25
General Purpose Register File
The register file is optimized for the AVR® enhanced RISC instruction set.
Most of the instructions operating on the register file have direct access to all
registers, and most of them are single cycle instructions. As shown, each register is
also assigned a data memory address, mapping them directly into the first 32
locations of the user data space. Although not being physically implemented as
the registers, as the X-, Y- and Z-pointer registers can be set to index any register
in the file.
Stack Pointer
The stack is mainly used for storing temporary data, for storing local
variables and for storing return addresses after interrupts and subroutine calls. Note
26
that the stack is implemented as growing from higher to lower memory locations.
The stack pointer register always points to the top of the stack. The stack pointer
points to the data SRAM stack area where the subroutine and interrupt stacks are
located. A stack PUSH command will decrease the stack pointer. The stack in the
data SRAM must be defined by the program before any subroutine calls are
executed or interrupts are enabled. initial stack pointer value equals the last address
of the internal SRAM and the stack pointer must be set to point above start of the
SRAM
This section describes the general access timing concepts for instruction
execution. The AVR® CPU is driven by the CPU clock clkCPU, directly generated
from the selected clock source for the chip. No internal clock division is used.
Figure the parallel instruction fetches and instruction executions enabled by the
harvard architecture and the fast-access register file concept. This is the basic
pipelining concept to obtain up to 1MIPS per MHz with the corresponding unique
results for functions per cost, functions per clocks, and functions per power-unit.
The AVR® provides several different interrupt sources. These interrupts and
the separate reset vector each have a separate program vector in the program
27
memory space. All interrupts are assigned individual enable bits which must be
written logic one together with the global interrupt enable bit in the status register
interrupts may be automatically disabled when boot lock bits BLB02 or BLB12 are
programmed. This feature improves software security. The lowest addresses in the
program memory space are by default defined as the reset and interrupt vectors.
The complete list of vectors is shown. The list also determines the priority levels of
the different interrupts. The lower the address the higher is the priority level.
RESET has the highest priority, and next is INT0 – the external interrupt request 0.
The interrupt vectors can be moved to the start of the boot flash section by setting
the IVSEL bit in the MCU control register (MCUCR). The reset vector can also be
moved to the start of the boot flash section by programming the BOOTRST fuse.
When an interrupt occurs, the global interrupt enable I-bit is cleared and all
interrupts are disabled. The user software can write logic one to the I-bit to enable
nested interrupts. All enabled interrupts can then interrupt the current interrupt
routine. The I-bit is automatically set when a return from interrupt instruction –
RETI – is executed. There are basically two types of interrupts. The first type is
triggered by an event that sets the interrupt flag. For these interrupts, the program
counter is vectored to the actual interrupt vector in order to execute the interrupt
handling routine, and hardware clears the corresponding interrupt flag. Interrupt
28
flags can also be cleared by writing a logic one to the flag bit position(s) to be
bit is cleared, the interrupt flag will be set and remembered until the interrupt is
conditions occur while the global interrupt enable bit is cleared, the corresponding
interrupt flag(s) will be set and remembered until the global interrupt enable bit is
set, and will then be executed by order of priority. The second type of interrupts
will trigger as long as the interrupt condition is present. These interrupts do not
necessarily have interrupt flags. If the interrupt condition disappears before the
interrupt is enabled, the interrupt will not be triggered. When the AVR exits from
an interrupt, it will always return to the main program and execute one more
instruction before any pending interrupt is served. Note that the status register is
not automatically stored when entering an interrupt routine, nor restored when
AVR Memories
AVR® architecture has two main memory spaces, the data memory and the
memory for data storage. All three memory spaces are linear and regular.
29
4.3 BUZZER
The buzzer is a sounding device that can convert audio signals into sound
vibration diaphragm, housing, etc. When the power supply is switched on, the
audio signal current generated by the oscillator passes through the solenoid coil,
and sounds under the interaction of the solenoid coil and the magnet. The
The height of active buzzer is slightly different from that of passive buzzer.
The active buzzer is usually 9mm high and the passive buzzer is 8mm high. When
placing the two buzzers with their pins facing up, the one with a green circuit
30
board is a passive buzzer, and the one without a circuit board and sealed with vinyl
is an active buzzer.
Multimeter resistance Rxl test: When the black meter pen contacts the'+'pin
of the buzzer and the red meter pen touches back and forth on the other pin, if it
clicks and the resistance is only 8Ω (or 16Ω), then it is a passive buzzer; connect
the'+'pin of the buzzer with a black pen and touch the red pen back and forth on the
other pin.
4.4 DC MOTOR
energy. Motors take electrical energy and produce mechanical energy. Electric
motors are utilized to power hundreds of devices we use in everyday life. Electric
motors are broadly classified into two different categories: Direct Current (DC)
motor and Alternating Current (AC) motor. In this article we are going to discuss
about the DC motor and its working. And also how a gear DC motors works.
31
external magnetic field, it will encounter a force proportional to the current in the
conductor and to the strength of the external magnetic [Link] is a device which
converts electrical energy to mechanical energy. It works on the fact that a current
to rotate with respect to its original position. Practical DC Motor consists of field
windings to provide the magnetic flux and armature which acts as the conductor.
shown in below. DC motor basically consist two main parts. The rotating part is
called the rotor and the stationary part is also called the stator. The rotor rotates
32
The rotor consists of windings, the windings being electrically associated
with the commutator. The geometry of the brushes, commutator contacts and rotor
windings are such that when power is applied, the polarities of the energized
winding and the stator magnets are misaligned and the rotor will turn until it is
As the rotor reaches alignment, the brushes move to the next commutator
contacts and energize the next winding. The rotation reverses the direction of
current through the rotor winding, prompting a flip of the rotor’s magnetic field,
Advantages of DC Motor:
33
4.5 LIQUID CRYSTAL DISPLAY
The device shown in the figure is a 16×2 LCD Display, which is widely
characters, numbers, and symbols. LCD stands for Liquid Crystal Display. It is
readings, and other important data in real time. Because of its low power
consumption, simple interface, and clear display, it is one of the most popular
A 16×2 LCD display means that the display can show 16 characters in each
time. Each character is formed using a 5×8 pixel matrix, which helps in displaying
alphabets, numbers, and some special symbols clearly. These displays are typically
based on the HD44780 LCD Controller, which controls the internal operations of
34
The LCD module consists of several important components such as the
display screen, LCD controller, interface pins, and backlight. The display screen
uses liquid crystal technology, which changes the alignment of liquid crystal
molecules when an electric current is applied. This change controls the amount of
light passing through the display and forms visible characters on the screen.
The HD44780 LCD Controller inside the module manages all display
with the microcontroller. It also contains internal memory used for storing the
The 16×2 LCD module typically has 16 pins, which are used for power
supply, control signals, and data communication. The main pins include VCC for
power supply, GND for ground, and VEE for contrast adjustment. The contrast of
the display is usually controlled using a variable resistor connected to the VEE pin.
and E (Enable). The RS pin is used to select whether the data being sent to the
LCD is a command or display data. The RW pin determines whether the LCD will
write operation only. The Enable pin is used to activate the LCD for receiving data
35
The LCD also includes eight data pins (D0–D7) that are used to send
commands and character data from the microcontroller to the display. In many
applications, only four data pins (D4–D7) are used in 4-bit mode, which reduces
the number of connections required between the LCD and the microcontroller.
and data signals to the LCD module to display information. For example, in energy
monitoring systems, the LCD can display parameters such as voltage, current,
power, and energy consumption. This allows users to easily observe the system
status without the need for additional monitoring equipment. Another important
feature of the LCD module is the backlight, which improves the visibility of the
display. The backlight usually consists of LED lights placed behind the display
systems. One of the major advantages of the 16×2 LCD display is its simplicity
and reliability. It requires minimal hardware and can be easily programmed using
36
digital clocks, energy meters, temperature monitoring systems, home automation
In the context of IoT and embedded systems, the LCD display plays an
important role in providing real-time feedback to the user. While IoT platforms
allow remote monitoring through mobile applications or cloud services, the LCD
display allows users to view important system information directly on the device.
Overall, the 16×2 LCD Display is a simple, reliable, and efficient display device
clearly, combined with low power consumption and easy interfacing with
IoT-based projects.
or embedded system because it provides the electrical energy required for the
37
may get damaged. Therefore, a reliable power supply unit is essential for
based projects, IoT applications, and sensor interfacing systems because it offers a
convenient way to supply both 5V and 3.3V outputs. The compact design and ease
of use make it very suitable for laboratory experiments and project development.
ranging from 6V to 12V. This input can be provided using a DC adapter through
the barrel jack connector available on the module. In some versions, the power can
also be supplied through a USB port. Once the input voltage is applied, the internal
38
circuitry of the module regulates and converts the voltage into stable output levels
converting the input voltage into fixed output voltages such as 5V or 3.3V, which
are the most commonly used voltage levels in embedded systems. The regulator
ensures that the output voltage remains constant even if there are small fluctuations
in the input voltage. This helps protect sensitive components like microcontrollers
The module also includes a voltage selection switch or jumper, which allows
the user to select the required output voltage level. Depending on the position of
the jumper, the module can provide either 5V or 3.3V output. This feature is
particularly useful when working with different types of electronic devices because
some components operate at 5V while others require 3.3V. By simply changing the
jumper position, the user can easily switch between these two voltage levels.
Another important feature of the power supply module is the dual output channels.
The module typically provides two separate power rails that can supply power
39
individually for either 5V or 3.3V output. This flexibility allows the module to
support circuits that require multiple voltage levels at the same time.
pins align with the power rails of the breadboard, making it easy to distribute
inserted into the breadboard and powered on, the regulated voltage becomes
available across the entire power rail. This simplifies circuit connections and
provided on the board. When the module is powered, the LED lights up, showing
that the power supply is active. This helps users quickly verify whether the circuit
is receiving power. The module also contains capacitors that help filter out
module ensures that all connected devices operate efficiently and reliably.
40
The power supply module plays a crucial role in prototyping and testing
reusable solution for supplying power to these experimental circuits without the
need for complex wiring or external regulators. Another advantage of this module
is its compact and portable design. It occupies very little space on the breadboard
and can be easily integrated into small projects. Because of its simple plug-and-
play operation, it is widely used by students, hobbyists, and engineers for rapid
circuit development.
safe levels, the power supply module ensures that the circuit components receive
Although linear regulators like the AMS1117 are simple and reliable, they may
produce some heat when the difference between input and output voltage is high.
41
specified range to maintain efficient operation and prevent excessive heat
generation.
and convenient solution for supplying regulated voltage to electronic circuits. Its
ability to deliver both 5V and 3.3V outputs, combined with its easy integration
with breadboards, makes it an essential tool for embedded system development and
IoT projects. By ensuring stable and regulated power, the module helps improve
42
ADVANTAGES &
APPLICATIONS
43
5. ADVANTAGES & APPLICATIONS
ADVANTAGES
APPLICATIONS
44
FUTURE SCOPE
45
6. FUTURE SCOPE
sensors with higher accuracy and reliability. The project can also be connected
with IoT technology to send alerts or driver status to vehicle owners or authorities
through mobile applications. GPS modules can be added to share the vehicle
location when alcohol is detected. Face recognition or biometric systems may also
be integrated to ensure that only authorized drivers operate the vehicle. These
improvements can make the system smarter and more useful in modern intelligent
transportation systems.
46
CONCLUSION
47
7. CONCLUSION
alcohol in the driver's breath and automatically preventing the engine from starting,
the system ensures safer vehicle operation. The use of sensors, microcontroller,
relay control, and alert mechanisms makes the system reliable and easy to
implement. Overall, this project demonstrates how embedded systems and sensor
technology can be used to enhance road safety and protect human lives.
48
BIBLIOGRAPHY
49
8. BIBLIOGRAPHY
1. Zhang, Y., & Li, J. (2021). Integration of GPS and GSM Modules for Vehicle
118.:This paper reviews how GPS and GSM technologies are integrated in vehicle
location.
2. Singh, R., & Patel, P. (2021). Vehicle Engine Locking System with Alcohol
Detection Using IoT. Journal of Cyber-Physical Systems and Security, 18(1), 87-
93.:This research discusses the use of IoT-based alcohol detection systems for
3. Singh, A., & Soni, D. (2020). Design and Development of Alcohol Detection
and Vehicle Control System Using IoT and Arduino. International Journal of
Intelligent Engineering, 10(5), 30-40.: The authors present a design where Arduino
microcontrollers are integrated with alcohol sensors, GSM, and GPS for a real-time
4. Patel, V., & Kumar, A. (2020). Implementation of GSM and GPS Modules for
15(2), 85-91. This research gives an in-depth explanation of employing GPS and
50
GSM modules to track locations and alert systems in vehicles, showing their uses
in real-time monitoring.
6. Singh, N., & Sharma, H. (2020). Designing an IoT-Based Alcohol Detection and
Assurance, 7(2), 134-140. The study delves into the application of IoT
technologies in alcohol detection systems, with sensors, GPS, and GSM being used
7. Patil, A., & Joshi, P. (2020). Alcohol Detection System for Vehicle Safety Using
Technology, 8(2), 45-53.: The authors provide a detailed design for alcohol
detection systems using Arduino, focusing on integration with ignition systems and
51