TechieYan Technologies

Alcohol Detection System

Abstract

The greatest risk to one’s life and the lives of others is drinking while driving, and this risk is growing daily. 5,325 people were killed and 10,564 people were injured in the almost 12,256 accidents that were caused by drunk driving in 2019. As we cannot stop people from drinking alcohol, we can avoid such accidents by checking whether the person is drinking and driving or not, we can keep such devices in vehicles to make sure that they do not drink and drive. In this alcohol detection system, we are building a project to detect the presence of alcohol. It can be used in various fields, so it is a demonstration of alcohol detection system. A simple MQ3 sensor is used to sense alcohol which is interfaced with a controller. When the sensor senses alcohol, the buzzer, and LED will be activated. Besides, it can calculate the accurate alcohol consumed and the value will be displayed on the LCD by which we can find the consumption of alcohol by the person. The main advantage of this project is for a reasonable price.

Introduction

Alcohol-detecting devices are widely used to trace the consumption of alcohol. It can be further advanced by implanting this system in vehicles so that it can detect whether the person has consumed alcohol or not. For further advancement in this alcohol detection system, GPS and GSM modules can be integrated into this system so that the system will track the location and send a message to the family members of the driver. It can provide an automatic safety environment for the vehicles by not allowing the person to drive the vehicle. The major drawback of this system would be that, if a person other than the driver consumes alcohol and the system detects it, then it will not allow the driver to start the vehicle. Well, this glitch can be cleared with further advancement. We are making a simple alcohol-detecting system without further advancement in this project. The MQ3 alcohol sensor can monitor and detect up to 25-50ppm alcohol concentration in the atmosphere. It is a semiconductor that has sensitive SnO2 material which can detect alcohol. The MQ3 gas sensor is very sensitive to alcohol. When this sensor senses alcohol, the conductivity of SnO2 increases. As the increase in sensor conductivity is proportional to the concentration of alcohol, the alcohol concentration can be easily calculated using a microcontroller.

Components Required

Hardware Requirements

  • Arduino Uno : Arduino Uno is a microcontroller from the Arduino Family. It was developed by Arduino. cc and is based on the Microchip ATmega328P microcontroller. Uno has 20 I/O pins, 6 are analog pins and 14 are digital pins.
Arduino circuit of alcohol detection system

For more details,  pinout and datasheet, you can visit : https://docs.arduino.cc/hardware/uno-rev3

  • LED : A light-emitting diode (LED) is a semiconductor light source that emits light when current flows through it. It works on
  • Buzzer : The buzzer is an electric-sounding device that generates sounds.
  • LCD:  LCD stands for liquid crystal display it is a flat panel display.

Software Requirements

  • Arduino IDE : Arduino IDE (Integrated Development Environment) is software that is used to dump the program into boards. Arduino- IDE’s major use is to build electronics-related projects. Arduino is an open-source platform simple and easy-to-understand platform for coding.

HOW TO INSTALL ARDUINO IDE CLICK ON THE LINK :

https://techieyantechnologies.com/2022/10/installation-of-arduino-ide/

Block diagram

In the following block diagram, the MQ3 Alcohol sensor is an input device that sends the information to a microcontroller (Arduino UNO ) and Arduino Uno will send the information to the output devices such as a buzzer, led and LCD will display the values on the screen.

alcohol detection system block diagram

Flow Chart

A flowchart is a diagram that shows a process’s steps in proper order similarly, the following flowchart tells about the steps involved in the project and the sequential flow of the code also.

So, as it starts, first, the MQ3 sensor detects the presence of alcohol, and If the sensor detects the alcohol then the led and buzzer get activated. Else the buzzer and led are turned off, and values will be displayed as per the detection of alcohol

alcohol detection system flow chart

*website used to make Flow Chart and Block Diagram :  https://www.lucidchart.com/pages/

Pin Connections

MQ3 

The following pin connection is about the connection of MQ – 3  with Arduino Uno. The MQ-3  has 4 pins Vcc pin of the MQ-3 is connected to D4 of Arduino Uno, the Digital pin is connected to D3, the analog pin  is connected to A0 and the Ground(GND) is connected to the GND.

alcohol detection system pin connections

LCD

The LCD has 16 pins. VSS is connected to the GND of the Arduino Uno. VCC is connected to the VIN of the Arduino Uno. VEE is connected to the potentiometer of the Arduino Uno.RS is connected to the 13th pin of the Arduino Uno. R/W is connected to the GND of the Arduino Uno. E is connected to the 12th pin of the Arduino Uno.DB4is connected to the A2 pin of the Arduino Uno.DB5 is connected to the A3pin  of the Arduino Uno.DB6 is connected toA4 of the Arduino Uno.DB7 is connected toA5 of the Arduino Uno. LED +ve is connected to the Vin of the Arduino Uno. LED -ve is connected to the GND of the Arduino Uno.

Potentiometer

The potentiometer has 3 pinsThe potentiometer has 3 pins  GND, VCC, and output. where Pin1 is connected to the 5V of the Arduino Uno. Pin2 is Connected to LCD VEE. Pin 3 is connected to the GND of the Arduino Uno.

Buzzer  

Buzzer5 has 2 pins

The below pin connection is about the connection of the buzzer with Arduino Uno. The buzzer has 2 pins, the Buzzer is connected to D8 of Arduino UNO. the other pin is connected to D7 of Arduino UNO.

LED

The pin connection is about the connection of the led with the Arduino UNO. LED has 2 pins, the LED is connected to d10 of Arduino UNO. And the other pin is connected to D11

Circuit diagram

Follow the below circuit diagram to understand the connection made to different devices.

Note: Make sure to take proper precautions while connecting the components.

Working

The next step after setting up the connection is to upload code to Arduino Nano and power it. When the system is turned on, Arduino continues to watch for alcohol if alcohol gets detected then led and a buzzer will get activated else it remains off.

Conclusion

Here we make a drastic change towards people who drink and drive. This will help to avoid accidents and save the lives of people. The main objective of this project is to provide a reasonable price that can help everyone. In future the alcohol detection can be made more powerful using iot and connecting it to the blynk app.

Working Code

 #include <LiquidCrystal.h>               //Using the Arduino as the controller device, the library Allows communication with liquid crystal displays (LCDs).
 LiquidCrystal lcd(13,12,A2,A3,A4,A5);    // initialize the library by associating any needed LCD interface pin with arduino uno 

 #define MQ3 A0                    //MQ3 pin connecetd to pin A0 of Arduino Nano 
 #define Buzzer 8                  //buzzer pin connecetd to pin 8 of Arduino Nano 
 #define LED 10                    //LED pin connecetd to pin 9 of Arduino Nano 
 #define Thres_Val 460             //Threshold value of MQ3 reading should  be trigger
 int value;                        //integer value is define to store the output of MQ3 sensor           
 void setup() {
   pinMode(MQ3, INPUT);            //Set MA3 as INPUT device
   pinMode(Buzzer, OUTPUT);        //Set Buzzer as output device
   pinMode(LED, OUTPUT);           //Set LED  as output device
   lcd.begin(16,2);                // set up the LCD's number of columns and rows:
   lcd.setCursor(0,0);             // to display the values on to the top left of LCD 
   Serial.begin(9600);             //Set a bourdered of 9600 
 }
 void loop() {
   value = analogRead(MQ3);          // reads the analog value from MQ3
   Serial.println(value);

     lcd.setCursor(0,0);             //
     lcd.print("GAS VALUE :");       // display gas 
     lcd.setCursor(0,1);
     lcd.print(value);
     delay(1000);
     
  if ( value > Thres_Val )           //if alcohol is detected
   {
     digitalWrite ( LED , HIGH );    // turns the LED on
     digitalWrite(Buzzer,HIGH);      // turns on (uncomment if buzzer is used) 

 }
 else {
     digitalWrite(LED, LOW);         //  turns the LED off
     digitalWrite(Buzzer,LOW);       //  turns off (uncomment if buzzer is used) 
     }
    delay (500);                     //  a 500ms delay before reading is taken again
 }

If You Face Any Issue Feel Free To Contact us Any Time.

+91 7075575787