The document describes an alcohol detection system for vehicles using an AT89C51 microcontroller. It contains the following key points:
1) An MQ-3 alcohol sensor detects the driver's breath and sends the reading to the microcontroller.
2) If the alcohol level is above the threshold and the car is stopped, the microcontroller will not allow it to start. If the level rises above the threshold while driving, the microcontroller will slowly stop the car using pulse-width modulation of the motor.
3) Other components include an LCD, motor driver, voltage regulator, and other basic electronic parts. The system aims to prevent drunk driving accidents by monitoring the driver's alcohol level.
2. Introduction
Every year millions of people die due to road accidents most of which are because of drunk driving.
Drunk driving is a major reason of accidents in almost all countries all over the world. Alcohol Detector
in Car project is designed for the safety of the people seating inside the car as well as people outside it.
This project will sense the amount of alcohol consumed by the person and if it exceeds above a certain
threshold then there are two cases that are addressed. First if the car is at rest and the alcohol level is above
threshold then the car will not start, second if the car is moving and alcohol level exceeds certain limit the car
stops slowly in few seconds.
3. Micro controller:
Fig: 8051 microcontroller pin diagram
In 40 pin AT89C51, there are four ports designated as P1, P2,
P3 and P0. All these ports are 8-bit bi-directional ports, i.e.,
they can be used as both input and output ports. Except P0
which needs external pull-ups, rest of the ports have internal
pull-ups.
When 1s are written to these port pins, they are pulled
high by the internal pull-ups and can be used as inputs.
These ports are also bit addressable and so their bits
can also be accessed individually.
. Port P0 and P2 are also used to provide low byte and
high byte addresses, respectively, when connected to
an external memory. Port 3 has multiplexed pins for
special functions like serial communication, hardware
interrupts, timer inputs and read/write operation from
external memory. AT89C51 has an inbuilt UART for
serial communication. It can be programmed to operate
at different baud rates. Including two timers & hardware
interrupts, it has a total of six interrupts.
4. Alcohol detectionsensor:
MQ303A is semiconductor sensor is for Alcohol detection,It has good sensitivity and fast
response.
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.
5. LCD:
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 segment LEDs. The reasons
being: LCDs are economical; easily programmable; have no limitation of
displaying special & even custom characters (unlike in seven segments),
animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such
lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has
two registers, namely, Command and Data.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
6. Motors:
A DC motor is any of a class of rotary electrical machines that converts direct current
electrical energy into mechanical energy. The most common types rely on the forces
produced by magnetic fields. Nearly all types of DC motors have some internal
mechanism, either electromechanical or electronic, to periodically change the
direction of current flow in part of the motor.
Features:
12V – 200RPM –
3.6KG•CM torque DC gearhead motor
30:1 Gear Ratio
2mm rear encoder shaft
Good compromise between speed and torque for small robotic designs.
7. L293D (Motor driver IC):
L293D is a typical Motor driver or Motor Driver IC which allows DC
motor to drive on either direction. L293D is a 16-pin IC which can
control a set of two DC motors simultaneously in any direction.
It means that you can control two DC motor with a single L293D IC.
Dual H-bridge Motor Driver integrated circuit (IC). It works on the
concept of H-bridge. H-bridge is a circuit which allows the voltage to be
flown in either direction. As you know voltage need to change its
direction for being able to rotate the motor in clockwise or
anticlockwise direction, Hence H-bridge IC are ideal for driving a DC
motor.
In a single L293D chip there are two h-Bridge circuit inside the IC
which can rotate two dc motor independently. Due its size it is
very much used in robotic application for controlling DC motors.
Given below is the pin diagram of a L293D motor controller.
There are two Enable pins on l293d. Pin 1 and pin 9, for being
able to drive the motor, the pin 1 and 9 need to be high. For
driving the motor with left H-bridge you need to enable pin 1 to
high. And for right H-Bridge you need to make the pin 9 to high. If
anyone of the either pin1 or pin9 goes low then the motor in the
corresponding section will suspend working
8. 7805 (Voltage regulator):
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear
voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not
give the fixed voltage output. The voltage regulator IC maintains the output voltage at a
constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide.
7805 provides +5V regulated power supply. Capacitors of suitable values can be connected
at input and output pins depending upon the respective voltage levels.
Features:
• Output Current up to 1A
• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
• Thermal Overload Protection
• Short Circuit Protection
• Output Transistor Safe Operating Area Protection
9. Speed Control of DC motor
Pulse width modulation (PWM) is a method for binary signals generation, which has 2 signal periods (high and
low). The width (W) of each pulse varies between 0 and the period (T). The main principle is control of power by
varying the duty cycle. Here the conduction time to the load is controlled. Let for a time t1, the input voltage
appears across the load i.e. ON state and for t2 time the voltage across the load is zero.
• The average voltage at output is given by , Va = Vmax. ,where TON =Time period for Pulse ON,TOFF =Time period
for Pulse OFF
• The average load current Ia= Va/R = kVs/R where, T is the total time period =t1+t2, k = t1/T is the duty cycle.
• The duty cycle can be varied from 0 to 1 by varying t1, T or f. Therefore, the output voltage V0 can be varied from
0 to Vs by controlling k, and the power flow can be controlled.
• As the time t1 changes the width of pulse is varied and this type of control is called pulse width modulation (PWM)
control.
11. Working:
To get a blood alcohol content (BAC) reading, the sensors are attached in the car. The machine utilises the
vapours in your breath to calculate an estimation of the level of alcohol in a person’s system. This simple
approach is due to the fact that alcohol is not digested by the body and is merely absorbed through
different parts. These include the mouth, stomach and intestines. As a result, traces of the material can still
be identified minutes after drinking, making it possible for the sensor to calculate an accurate number,
using this information microcontroller 8051 gives the signal to the motor whether to stop running or not.
As soon as alcohol is detected the controller starts reducing the rpm of the motor using the concept of a
PWM the motor is slowed analogous to the varing duty cycle in successive frames the speed of motor
starts to decrease and gradually it comes to halt. Another condition is that the car is being started by user
but the alcohol level is very high in that condition the microcontroller 8051 does not allow the motor to
start ensuring safety of the driver.
12. Components Cost
AT89C51 Microcontroller ₹50
Alcohol Sensor Module (MQ-3) ₹200
LCD ₹135
L293D Motor driver IC ₹45
12V DC Motor ₹50
PCB copper clad ₹50
Crystal (12MHz) ₹10
LEDs (4) ₹8
Resistors (1K*4,10K) and
Capacitors(10uF,33pF)
₹10
Potentiometer (10K) ₹10
7805 Voltage Regulator IC ₹10
Heat sink ₹15
DC jack ₹5
Female to Female Connectors ₹15
Push Button(*2) ₹10
12V DC Adaptor ₹120