Professional Documents
Culture Documents
ALCOHOL DETECTION AND CAR Locking System Sample Thesis Book
ALCOHOL DETECTION AND CAR Locking System Sample Thesis Book
A PROJECT REPORT
on
BACHELOR OF ENGINEERING
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
For the Academic Year: 2018-2019
SUBMITTED BY,
S. SUHAS 1NH15EC084
NAMRATHA B.R 1NH15EC133
SANJEEV JAYASURYA. S 1NH15EC092
CERTIFICATE
Certified that the project work entitled “ALCOHOL DETECTION AND CAR
IGNITION LOCKING SYSTEM” carried out by S SUHAS (1NH15EC084),
NAMRATHA B R (1NH15EC133), SANJEEV JAYASURYA S
(1NH15EC092),bonafide students of NEW HORIZON COLLEGE OF
ENGINEERING, BENGALURU in partial fulfillment for the award of Bachelor of
Engineering in VIII Semester of the Visveswaraiah Technological University, Belgaum
during the year 2018-2019. It is certified that all corrections/suggestions indicated for
Internal Assessment have been incorporatedin the Report deposited in the department
library.
The project report has been approved as it satisfies the academic requirements in respect
of Project work prescribed for the Degree.
External Viva
1.
2.
ACKNOWLEDGEMENT
We wish to express our profound gratitude to our respected Chairman Dr. Mohan
Maghnani, for providing all the facilities in the college and respected Principal, Dr.
Manjunatha for his constant support. We would like to express our sincere thanks to
Dr. Sanjeev Sharma, Head of the department of Electronics and Communication
Engineering for his continuous support and encouragement. We feel deeply indebted
to our esteemed Project Coordinator, Mrs. Reema Sharma and our Guide Dr.
Priyamvada for their guidance, right from the conception and visualization to the
very presentation of the project. They have been our guiding light throughout. We
are greatly indebted to our faculties, both teaching and supporting staff, Department
of Electronics and Communication Engineering, who took great interest in our project
work. They motivated and guided us throughout the accomplishment of this goal. We
express our profound thanks for their meticulous guidance. Finally, we would like to
express our heartfelt thanks to our beloved parents for their blessings, our friends for
their help and wishes for the successful completion of this project work.
We also declare that, to the best of our knowledge, the work reported here is not
from any other thesis or dissertation on the basis of which the degree or award was
conferred on an earlier occasion by any student.
ABSTRACT
This system is aimed at making vehicle driving safer than before. The main purpose behind this
project is “Drunken driving detection”. Now days, many accidents are happening because of the
alcohol consumption of the driver or the person who is driving the vehicle. Thus, drunk driving is a
major reason of accidents in almost all countries all over the world. We have proposed the
detection of alcohol using alcohol detector connected to ARM such that when the level of alcohol
crosses a permissible limit, the vehicle ignition system will turn off. Alcohol Detector in Car project is
designed for the safety of the people seating inside the car. Alcohol breath analyzer project should
be fitted / installed inside the vehicle. And there is auto theft detection of the system is also added
which will detect whether the system is present or not in the car. If any of these conditions match
then the concerned person will get a msg through GSM along with GPS coordinates.
TABLE OF CONTENTS
Title Page
1.INTRODUCTION
1.1 Objective 1
1.2 Problem Statement 5
1.3 Objective 5
1.4 Proposed system 6
1.5 Literature Survey 6
2. SYSTEM DESCRIPTION, CONSTRUCTION
AND OPERATION
2.1 System Overview 7
2.2 Component Specification 7
2.2.1 ARM-7 Micro Controller 8
2.2.1.1 About ARM 8
2.2.1.2 Features of LPC214x Series Controllers 11
2.2.2 DC Motor 12
2.2.2.1 DC Motor Principle 12
2.2.2.2 Working of DC Motor 13
2.2.3 Global System for Mobile (GSM) 14
2.2.3.1 GSM Transmission Structure 15
2.2.3.2 GSM System Architecture 16
2.2.4 Liquid Crystal Display (LCD) 18
2.2.4.1 Pin Diagram 18
2.2.4.2 Pin Description 19
2.2.4.3 Block Diagram of LCD Display 19
2.2.4.4 Control and Display Commands 20
2.2.4.5 Address Counter (AC) 22
2.2.4.6 8-Bit Mode 29
2.2.4.7 4-Bit Mode 30
2.2.4.8 LCD Display Interfacing – Flowchart 30
2.2.5 GPS (Global Positioning System) 31
2.2.5.1 Segments of GPS 32
2.2.5.2 Applications of GPS 33
2.2.6 Relay 34
2.2.6.1 Port Description 35
2.2.6.2 Working of Relay 36
2.2.6.3 Types of Relay 36
2.2.7 Alcohol Sensor (MQ-3 Sensor) 38
2.2.7.1 Block Diagram 39
2.2.7.2 Basic Pin Configuration 39
2.2.7.3 Working Principle 40
2.2.7.4 Features 40
2.3 Flow-Chart 41
3. SOFTWARE SPECIFICATIONS
3.1 About Keil Uvision 42
3.2 ARM-7 Highlights 43
3.3 ARM-7 Development Tool Support 43
4. RESULTS
4.1 Alcohol Detection Output 44
4.2 Switch Output 45
5. Conclusion and Future Scope
5.1 Conclusion 46
5.2 Future Scope 46
References 47
Appendix 48
CHAPTER 1
INTRODUCTION
One study estimates that eliminating alcohol would reduce traffic fatalities by 47
percent (± 4%), equivalent to a reduction of between 20,000 and 24,000 fatalities
annually. There is no doubt that a reduction in alcohol-impaired driving would result
in a substantial savings of human lives and resources, worldwide.
Drunk driving is the purpose for the vast majority of the deaths, Since the Drunk
Driving Detection and Car Ignition Locking Using Arduino intends to change that with
mechanized, straightforward, noninvasive liquor wellbeing check in vehicles. Alcohol
sensor is implanted on the steering of the car, to such an extent that when the level
of liquor crosses an admissible breaking point, where the start of vehicle will
stopignition and the motor will stop. The Arduino processor always uses the liquor
High BAC of the drunken driver will influence their practices likes obviousness,
passionate swings, and outrage or bitterness. There is the exploration about Blood
Alcohol Concentration and with 0.2mg/l or more, (estimated in mg of 1 liquor for
each 100ml of blood, or mg/l) the judgment, coordination and tangible discernment
are impeded, response time moderates, execution in scholarly tests falls, and vision
is debilitated. So, there is a requirement for an effective framework to check
drunken drivers and this drunk driving detection using car ignition locking task can
be one of the strategies to decrease this issue or more particular to keepawaythe
drunken driver itself to driving the vehicles.
However, under 35% of low and focus profit countries have directions in zone to
monitor those street clients. The vital point of this gadget is to avoid the charge
mischances which can be generally happened because of drunkenness of driving
power. This gadget discovers the drunkenness of driving power and spare the
passengersfrom riding, so this attempt to give one type of security or insurance to
driving power and spare remain. The principle expectation of this framework is to
maintain a strategic distance from the rate of accidents which are ordinarily
occurred duetodrunkenness of driver.This framework identifies the drunkenness of
driver and keep them from driving, so this framework will try to give one kind of
security or wellbeing system to driver and spare lives.
Alcohol influences the focal sensory system of a man. Indeed, even 0.05% BAC
understands judgment disabled and the capacity to control directing is influenced. In
this paper we havecomposed a programmed alcohol detector which is coordinated
with the steering wheel. This workidentifies with mechanical assembly to prevent a
motorcar from being driven by a drunk driver. At the point when the sensor
distinguishes nearness of alcohol in the breath of the driver, car is bolted
automatically. "Drinking is not just damaging to drunken driver it likewise influences
the encompassing zone and individuals."
Nowadays street accidents are real issue everywhere throughout the world. As
report by WHO (World Health Organization) in its first Global status report (2014)
80,000 of Indian individuals are died on streets due to finished speeding, drunk
driving and different reasons. Drunk driving is a central point for ascent of deaths on
Other Wide zones of drunk fatalities are suicides, unmanned railroad crossing,
fundamental city activity. The greater part of nowadays, we hear lot of accidents
because of drunken driving. Drunken drivers won't be in stable condition thus the
rash driving is the burden for other road users and furthermore question of life and
death for the drunken driver and for others. The principle reason behind this project
is "Drunk driving detection". Presently, numerous accidents are occurring a direct
result of the liquor utilization of the driver or the individual who is driving the
vehicle. In this way Drunk driving is a noteworthy reason of mishaps in all nations
everywhere throughout the world.
Alcohol Detector in Car is intended for the safety of the general population seating
inside the car. This project ought to be fitted/introduced inside the vehicle.Alcohol
sensor will be appended withArduino. While liquor isnoticed by the sensor, sensor
sends the input voltage to Arduino. On the off chance that there are any hints of
Alcohol over as far as possible, at that point the framework will lock the Engine in
the meantime will automatically give a buzzer, we can reducethe accidents by
checking the driving individuals on the roads. Drunk driving is one of the intense
national and worldwide street security issue.
Despite the fact that driving under the drunken condition is illegal and punishable in
relatively every nation, and still, at the end of the day numerous people/youths,
break the guidelines and feel eager to drink and drive. The fundamental thought
spins around the idea -Why not make the vehicle sufficiently keen to check the drunk
condition of the driver and take alarming and preventive activities previously any
incident on street? This paper examines the plan, improvement and in-vehicle
testing of the proposed drunk driver detection and modifying system.The work is
1.3 Objective
The target of this projectis to give an ideaand inventive method for avoiding drunken
driving of a Motorcar by locking the car. Likewise, to permita man who is not
alcoholic to drive a same Motorcar. To broaden this thought with more innovative
headways and make it accessible in a financially effective way. We need to plan a sort
of framework which can recognize the alcohol content in the cars to prevent the
conduct of alcoholic driving.
The sensor will be fixed close to the driver's seat. The driver should breath to the
system before the individual begins the car. On the off chance that the alcohol level
identified is underneath the permissible standard, the car can be started regularly. In
the event that the alcohol level is over the suitable standard, the framework will send
caution to the driver through LCD display. The framework ought to be protected,
delicate, exact, advantageous and cheap. This sort of framework can be fixed on each
car to guarantee the driver's driving security.
Switch
Theblock diagram explains the concept of alcohol detection and ignition locking
system. Here lpc2148 is used as the heart of the project. MQ3 sensor is used for
detection of alcohol. If the concerned person is drunk then the ignition system will
not be activated. Another feature of this system is the auto theft detection if any one
tries to steal /deactivate the system then a message is sent to the concerned person
with GPS. The vehicle is shown in the form of a DC motor.
The Pipeline method is used for processing all the blocks in architecture. A single
instruction set is being performed, then its descendant is being translated, & a 3 rd-
instruction is being obtained from the memory.
An exclusive architectural plan of ARM7 is called as Thumb, and it is perfectly
suitable for high volume applications where the compactness of code is a matter. It
makes it perfectly suitable for different applications by memory limitations where
the density of code is a matter.
LPC2148 has 32kB on chip SRAM and 512kB on chip FLASH memory. This chip has
built in support up to 2kB end point USB RAM. This memory is more than enough for
almost all applications. Let’s understand the function of this huge memory space in
LPC2148.
FLASH Memory System: The LPC2148 has 512kB flash memory. This memory
maybeused for both code and data storage. The flash memory can be programmed
by various ways
RAM Memory System: LPC2148 provides 32kB of static RAM which may be used for
code and/or data storage. It may be accessed as 8-bit, 16-bit and 32-bits.
GPIO registers control the device pins which are not linked to a particular peripheral
function. The device pins can be arranged as i/p[s or o/ps. Individual registers allow
for clearing any number of o/p’s concurrently. The output register value can be read
back, & the present condition of the port pins. These microcontrollers begin an
accelerated function over LPC200 devices.General purpose input/output registers
are moved to the processor bus used for the best probable I/O time.
F = BIL Newtons
When the conductor moves from one side of a brush to the other, the current in that
conductor is reversed. At the same time, it comes under the influence of the next
pole which is of opposite polarity. Also, the function of a commutator in the motor is
the same as in a generator.
A GSM Modem is a device that modulates and demodulates the GSM signals
and in this particular case 2G signals. The modem we are using is SIMCOM
SIM900. It is a Tri-band GSM/GPRS Modem as it can detect and operate at
three frequencies (EGSM 900 MHz, DCS 1800 MHz and PCS1900 MHz).
Default operating frequencies are EGSM 900MHz and DCS 1800MHz.
Sim900 GSM module used here, consists of a TTL interface and an RS232
interface. The TTL interface allows us to directly interface with a
microcontroller while the RS232 interface includes a MAX232 IC to enable
communication with the PC. It also consists of a buzzer, antenna and SIM
slot. Sim900 in this application is used as a DCE (Data Circuit-terminating
Equipment) and PC as a DTE (Data Terminal Equipment).
In GSM system the mobile handset is called Mobile Station (MS). A cell is
formed by the coverage area of a Base Transceiver Station (BTS) which serves
the MS in its coverage area. Several BTS together are controlled by one Base
Station Controller (BSC). The BTS and BSC together form Base Station
Subsystem (BSS). The combined traffic of the mobile stations in their
respective cells is routed through a switch called Mobile Switching Center
(MSC). Connection originating or terminating from external telephone (PSTN)
are handled by a dedicated gateway Gate way Mobile Switching Center
(GMSC). The architecture of a GSM system is shown in the figure below.
In addition to the above entities several databases are used for the purpose
of call control and network management. These databases are Home
Location Register (HLR), Visitor Location Register (VLR), the Authentication
Center (AUC), and Equipment Identity Register (EIR). Home Location Register
(HLR) stores the permanent (such as user profile) as well as temporary (such
A VLR stores the data about the users who are being serviced currently. It
includes the data stored in HLR for faster access as well as the temporary
data like location of the user. The AUC stores the authentication information
of the user such as the keys for encryption. The EIR stores data about the
equipment’s and can be used to prevent calls from a stolen equipment’s.
All the mobile equipment’s in GSM system are assigned unique id called IMSI
(International Mobile Equipment Identity) and is allocated by equipment
manufacturer and registered by the service provider. This number is stored in
the EIR. The users are identified by the IMSI (International Module Subscriber
Identity) which is stored in the Subscriber Identity Module (SIM) of the user. A
mobile station can be used only if a valid SIM is inserted into equipment with
valid IMSI. The “real” telephone number is different from the above ids and is
stored in SIM.
LCD (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-segmentLEDs.
The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like
initializing it, clearing its screen, setting the cursor position, controlling
display etc. The data register stores the data to be displayed on the LCD. The
data is the ASCII value of the character to be displayed on the LCD. Click to
learn more about internal structure of aLCD.
Pin
Function Name
No
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
Selects command register when low; and data register when
4 Register Select
high
5 Low to write to the register; High to read from the register Read/write
6 Sends data to data pins when a high to low pulse is given Enable
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
Busy flag 0 1 BF AC6 AC5 AC4 AC3 AC2 AC1 AC0 Busy flag (BF: 1→ 39 µs
&Addr LCD Busy) and
ess contents of
address counter
in bits AC6AC0.
Set 0 0 1 AC6 AC5 AC4 AC3 AC2 AC1 AC0 Set DDRAM 39 µs
DDR address in
address counter.
Outline
4) Others
The selection of RAM is set by the previous address set instruction. If the
address set instruction of RAM is not performed before this instruction, the
data that is read first is invalid, because the direction of AC is not
determined. If the RAM data is read several times without RAM address set
instruction before read operation, the correct RAM data from the second,
but the first data would be incorrect, as there is no time to transfer RAM
data. In case of DDRAM read operation, cursor shift instruction plays the
same role as DDRAM address set instruction; it also transfers RAM data to
the output data registers.
Write binary 8-bit data to DDRAM. The selection of DRAM or CGRAM is set by
the previous address set instruction; DDRAM address set, CGRAM address
set. RAM set instruction can also determine the AC direction to RAM. After
write operation, the address is automatically increased or decreased by 1
according to the entry mode.
AC0
0 0 1 AC6 AC5 AC4 AC3 AC2 AC1
Set DDRAM address to AC, this instruction makes DDRAM data available from
MPU. In 1line display mode, DDRAM address rangers from “00H” to “4FH”. In 2-
line display mode,
DDRAM address in the first line ranges from “00H” to “27H”, and DDRAM
address in the 2nd line is from “40H” to “67H”.
6) Function Set
When 4-bit mode is activated, the data needs to be transferred in two parts, first
higher 4bits, and then lower 4 bits.
0 0 0 0 0 1 S/C R/L X X
Without writing or reading the display data, shifting right/left cursor position or
display. This instruction is made to correct or search or display data. During 2-line
display mode, cursor moves to the 2nd line after the 40th digit of the 1st line.
When display shift is performed, the contents of the address counter are not
changed.
D=’0’ means entire display is turned off. But Display data remains in DDRAM.
C=’0’ turns off the cursor. But I/D register retains the data
B=’0’ stops the cursor to blink and cursor looks steady if the Cursor is turned on.
When I/D= ’1’ cursor moves to the right and DDRAM address is increased by 1.
When I/D= ’0’ cursor moves to the left and DDRAM address is decreased
by 1. CGRAM operates in the same way in this setting.
0 0 0 0 0 0 0 1 I/D SH
When I/D= ’1’ cursor moves to the right and DDRAM address is increased by 1.
This instruction sets the address counter to 00H and returns the cursor to the first
column of first line. And if display is shifted previously, this instruction shifts this too.
The DDRAM contents don’t change in this instruction.
Clear all the display using 20H to all DDRAM and set value DDRAM address
counter (AC) to “00H”. It returns the cursor to the first column of first line and
sets the entry mode to increment mode (I/D=’1’).
Now the question is how to display data in the LCD or give command to it. There are
two modes of data transfer are supported by LCD displays. One is 4bit mode, another
is 8- bit mode. To transfer data in 8- bit mode, first put your data in the 8bit bus,
then put command in the command bus and then pulse the enable signal.
There is lot of stuff that can be done with the LCDs, to start with we will simple
display a couple of strings on the 2 lines of the LCD as shown in the image.
Schematic description:
• Data Lines: In this mode, all of the 8 data lines DB0 to DB7 are connected from
the microcontroller to a LCD module as shown the schematic.
• Control Lines:' The RS, RW and E are control lines, as discussed earlier.
• Power & contrast: Apart from that the LCD should be powered with 5V
between PIN 2(VCC) and PIN 1(GND). PIN 3 is the contrast pin and is output of
center terminal of potentiometer (voltage divider) which varies voltage
between 0 to 5v to vary the contrast.
• Back-light: The PIN 15 and 16 are used as backlight. The led backlight can be
powered through a simple current limiting resistor as we do with normal LED’s.
• In code, we need to send the command to select 4 -bit mode as shown in the
instruction set above.
Using the Global Positioning System (GPS, all process used to establish all position at
any point on the globe) the following two values can be determined anywhere on
Earth. GPS receivers are used for positioning, locating, navigating, surveying and
determining the time and are employed both by private individuals (e.g. for leisure
activities, such as trekking, balloon flights and cross-country skiing etc.) and
companies (surveying, determining the time, navigation, vehicle monitoring etc.)
GPS (the full description is: Navigation System with Timing and Ranging Global
Positioning System, NAVSTAR-GPS) was developed by the U.S. Department of
Defense (DoD) and can be used both by civilians and military personnel. The civil
signal SPS (standard positioning service) can be used freely by the general public,
whilst the military signal PPS (Precise positioning service) can only be used by
authorized government agencies. The first satellite was placed in orbit on 22 nd
February 1978, and there are currently 28 operational satellites orbiting the earth at
a height of 20,180km on 6 different orbital planes. Their orbits are inclined at
55degree to the equator, ensuring that at least 4 satellites are in radio
communication with any point on the planet. Each satellite orbits the earth in
approximately 12 hours and has four atomic clocks on board.
GPS uses radio transmissions. The satellites transmit timing information and satellite
location information. the system can be separated into three parts:
a) Space Segment
b) Control Segment
c) User Segment
• This constellation provides between five and eight GPS satellites visible from
any point on the earth.
Control segment
• The control segment is a group of ground stations that monitor and operate
the GPS satellites. There are monitoring stations spaced around the globe
and one Master Control Station located in Colorado Springs
User segment
• The user requires a GPS receiver in order to receive the transmissions from
the satellites. The GPS receiver calculates the location based on signals from
the satellites
Car navigation
The main usage of the Relay was seen in the history of transmitting and receiving the
information, that was called as Morse code where the input signals used to be either
1 or 0, these change in signals were mechanically noted in terms of ON and OFF of a
light bulb or a beep sound, it means those pulses of 1s and 0s are converted as
mechanical ON and OFF using electromagnets.
The signal received from one side of the device controls the switching
operation on the other side. So, relay is a switch which controls (open and
close) circuits electro-mechanically.
The main operation of this device is to make or break contact with the help of
a signal without any human involvement in order to switch it ON or OFF.
When the switch is open no current passes through the relay, the circuit is
open, and the load that is connected to the relay receives no power.
When a relay is closed, the circuit is completed and current passes through
the relay and delivers power to the load. To open and close a relay
electromagnet is used.
NO- Normally Open, in which case NO is disconnected with COM1 when INT1
is set low and connected when INT1 is high.
When the switch is closed, current start flowing through the coil, and by the concept
of electromagnetic induction, magnetic field is generated in the coil which attracts
the movable armature and the Com Port get connected with NC (Normally Close) pin
of the relay. Hence, the LAMP turns ON.
1. Electromagnetic Relays
3. Hybrid Relays
These relays are constructed with electrical, mechanical and magnetic components,
and have operating coil and mechanical contacts. Therefore, when the coil gets
activated by a supply system, these mechanical contacts gets opened or closed. The
type of supply can be AC or DC.
a)Attraction type Relays- These relays can work with both AC and DC supply and
attract a metal bar or a piece of metal when power is supplied to the coil. These
relays don’t have any time delays so these are used for instantaneous operation.
b)Induction type Relays - These are used as protective relays in AC systems alone
and are usable with DC systems. The actuating force for contacts movement is
developed by a moving conductor that may be a disc or a cup, through the
interaction of electromagnetic fluxes due to fault currents. mostly used as directional
relays in power-system protection and also for high-speed switching operation
applications.
c)Magnetic Latching Relays - These relays use permanent magnet or parts with a
high remittance to remain the armature at the same point as the coil is electrified
when the coil power source is taken away.
3. Hybrid Relays
These relays are composed of electromagnetic relays and electronic components.
Usually, the input part contains the electronic circuitry that
performs rectification and the other control functions, and the output part include
electromagnetic relay.
This alcohol sensor is suitable for detecting alcohol concentration on your breath. It
has high sensitivity and fast response time. Sensor provides an analog resistive
output based on alcohol concentration. The drive circuit is very simple as it requires
only one resistor. A simple interface could be a 0-3.3V ADC.
The MQ-3 alcohol gas sensor consists of total 6-pins including A, H, B 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 that is used as a heat sensor.
The MQ-3 alcohol sensor consists of a tin dioxide (SnO2), a perspective layer inside
aluminum oxide micro tubes (measuring electrodes) and a heating element inside a
tubular casing. The end face of the sensor is enclosed by a stainless-steel net and the
back side holds the connection terminals. Ethyl alcohol present in the breath is
oxidized into acetic acid passing through the heat element. With the ethyl alcohol
cascade on the tin dioxide sensing layer, the resistance decreases. By using the
external load resistance, the resistance variation is converted into a suitable voltage
variation.
2.2.7.4 Features
5V operation
LEDs for output and power
Output sensitivity adjustable
Analog/Digital output 0V to 5V
Good Sensitivity to Alcohol Gas
Both Digital and Analog Outputs
On-board LED Indicator
SOFTWARE SPECIFICATIONS
Keil development tools for the ARM Microcontroller Architecture support every level
of software developer.Keil provides a broad range of development tools
like ANSI C compiler, macro assemblers, debuggers andsimulators, linkers, IDE,
library managers, real-time operating systems and evaluation boards for Intel
8051, Intel MCS-251&ARM.The industry-standard Keil C Compilers, Macro
Assemblers, Debuggers, Real-time Kernels, Single-board Computers, and Emulators
support all ARM derivatives.
Tools developed by Keil endorse the most popular microcontrollers and are
distributed in several packages and configurations, dependent on the architecture.
MDK-ARM is the Microcontroller Development Kit, for several ARM7, ARM9, and
Cortex-Mx based devices.
The Keil Uvision Development Kit supports 32-bit (ARM7 and ARM9 based) devices
support complex applications, which require greater processing power. These cores
provide high-speed 32- bit arithmetic within a 4GB address space. The RISC
instruction set has been extended with a Thumb mode for high code density.
Using a program called Flash Magic, the Uvision code can be dumped into the ARM-
7 micro-controller.
The ARM compilation tools support all ARM-specific features and provide:
Task function and RTOS support are built into the C/C++ compiler.
RESULTS
a) The MQ3 Alcohol Sensor and the 16x2 LCD Display is interfaced with ARM-7
(LPC2148) Microcontroller.
b) MQ3 Sensor senses alcohol and indication of high Alcohol content is through the
external LED Light present on the sensor board.
c) The LCD display is used to display the results given by the MQ3 Sensor.
d) The Switch is used to ensure the driver does not tamper with the system.
If high alcohol content is detected, the LCD displays ‘Alcohol Detected’. This message
is sent to the concerned authorities along with the vehicle co-ordinates using the
GSM and GPS modules.
The Switch is pressed during installation and should be kept pressed at all times. Any
tampering which causes the switch to be released displays an “Alert” message on the
LCD Display.
5.1 Conclusion
In this project we have built up areal time model that can automatically lock the
motor engine when a drunken driver tries to drive a car. These days, car collisions
are mostly observed. By fitting this alcohol sensor into the car, we can save the life
of the driver and furthermore the rest of the travelers. The life time of the task is
high. It has low or zero support cost and obviously low power utilization. This is a
developed system to check drunken driving. By executing this outline a safe car
travel is possible decreasing the mishap rate because of drinking. By executing this
outline, drunken drivers can be controlled so are the mishaps because of drunken
driving.
Government must authorize laws to introduce such circuit in each car and must
manage all car organizations to preinstall such systems while manufacturing the car
itself. If it is achieved, the death rate because of drunken drivers can be brought to
least level. In this kind of system, securely landing of car aside without disturbing
other vehicles can also be added as a future extension.
Uvision Code:
#include <lpc214x.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include "LCD.h"
void ser_init(void);
void tx(unsigned char c);
unsigned char rx(void);
void tx_str(unsigned char *s);
void delay_ms(uint16_t j)
{
uint16_t x,i;
void UART0_init(void)
{
PINSEL0 = PINSEL0 | 0x00000005; /* Enable UART0 Rx0 and
Tx0 pins of UART0 */
void get_Time(void)
{
U0IER = 0x00000000; /* Disable RDA interrupts */
uint8_t time_index=0;
uint8_t index;
uint16_t hour, min, sec;
uint32_t Time_value;
uint8_t lat_index = 0;
uint8_t index = (Latitude_Pointer+1);
lat_decimal_value = (lat_decimal_value/100); /*
Latitude in dd.mmmmmm */
lat_degrees = (int)(lat_decimal_value); /* dd of
latitude */
lat_decimal_value = (lat_decimal_value -
lat_degrees)/0.6; /* .mmmm/0.6 (Converting minutes to
eequivalent degrees) */
lat_degrees_value = (float)(lat_degrees +
lat_decimal_value); /* Latitude in dd.dddd format */
uint8_t long_index = 0;
uint8_t index = (Longitude_Pointer+1);
long_decimal_value = (long_decimal_value -
long_degrees)/0.6; /* .mmmmmm/0.6 (Converting minutes to
eequivalent degrees) */
long_degrees_value = (float)(long_degrees +
long_decimal_value); /* Longitude in dd.dddd format */
uint8_t alt_index = 0;
uint8_t index = (Altitude_Pointer+1);
int main(void)
{
IO0DIR&= ~(1<<2);
IO0DIR |=(1<<5);
IO0DIR&= ~(1<<3);
// ser_init();
char a[15],b[15];
IO1DIR=0xffffffff;
// IO0DIR=0x00000C00;
PINSEL0=0x0300
lcd_init();
}
if(!(IO0PIN & (1<<2)))
{
IO0CLR |=(1<<5);
cmd(0x8b);
cmd(0xc0);
show("Alcohol detected");
else{
IO0SET |=(1<<5);
cmd(0x8b);
cmd(0xC0);
show("Normal");
delay_ms(1000);
//tx_str(Latitude_Buffer);
// sms(NUMBER, Latitude_Buffer);
// sms(NUMBER, Longitude_Buffer);
cmd(0x01);
IO0SET|=(1<<5);
}
delay_ms(1000);
UART0_SendString(GGA_String);
UART0_SendString("\r\n");
// UART0_SendString(Time_Buffer);
// UART0_SendString("\r\n");
UART0_SendString("Latitude : ");
get_Latitude(GGA_Comma_Pointers[0]);
UART0_SendString(Latitude_Buffer);
UART0_SendString("\r\n");
UART0_SendString("Longitude : ");
get_Longitude(GGA_Comma_Pointers[2]);
tx_str("AT+CMGF=1");
tx(0x0d);
gsm_delay();
tx_str("AT+CMGS=");
tx('"');
while(*num1)
tx(*num1++);
tx('"');
tx(0x0d);
gsm_delay();
while(*msg)
tx(*msg++);
void gsm_delay()
{
unsigned long int gsm_del,ff;
for(gsm_del=0;gsm_del<=500000;gsm_del++)
for(ff=0;ff<25;ff++);
}
void ser_init()
{
VPBDIV=0x02; //PCLK = 30MHz
PINSEL0=0x5;
U0LCR=0x83;
U0DLL=195;
U0DLM=0;
U0LCR=0x03;
U0TER=(1<<7);
}
LCD Code:
#define bit(x) (1<<x)
void lcd_init(void);
void cmd(unsigned char a);
void dat(unsigned char b);
void show(unsigned char *s);
void lcd_delay(void);
void lcd_init()
{
cmd(0x38);
cmd(0x0e);
cmd(0x01);
cmd(0x06);
cmd(0x0c);
cmd(0x80);
}
void lcd_delay()
{
unsigned int i;
for(i=0;i<=6000;i++);
}