Monday, September 25, 2023

Advanced Alcohol Detector

By Rohan Barnwal

- Advertisement -
Comment errors or corrections found for this circuit, and get the chance to win big!

In today’s world, the devastating consequences of accidents caused by drunk driving continue to make headlines. Drawing inspiration from real-life data, a remarkable project called the “Advanced Alcohol Detector” has been developed, utilizing an array of components including the Arduino Uno, Neo 6M GPS module, LEDs, buzzers, OLED display, jumper wires, and breadboard. This innovative creation aims to revolutionize road safety by actively preventing accidents resulting from alcohol impairment. So this projcect is designed to prevent such accidents. 

At the core of this project is an easy-to-read OLED display  and Arduino is used a speedometer. Additionally, the project incorporates LED indicators and buzzers as intuitive communication tools. When alcohol impairment is detected by the highly sensitive MQ3 alcohol sensor and the level of alcohol is greater than the threshold value then the LEDs blink and the buzzers emit distinctive sounds, This alert continues until the reset button is pressed, ensuring that the driver acknowledges their impaired state and takes appropriate action. Furthermore you can also attach the speedometer if you want to this system so the system check speed of vehicle. By default it shows a random speed in code.

Furthermore,  a Neo 6M GPS module to is used for that can give option to extend the project for  real-time tracking of the vehicle’s location. A Raspberry pi or any laptop  can be attached with system. In the event of alcohol impairment detection, the project sends an email to a predetermined address, including the precise location information obtained from the GPS module.

Author prototype

Bill Of Material 

- Advertisement -

components required in project is listed in table 1 .

COMPONENTSQuantity
ARDUINO UNO ( Mod 1)1
JUMPER WIRES20
BREADBOARD1
MQ3 SENSOR ( S2)1
NEO 6M GPS MODULE (S1)1
LEDs (L1,L2,L3,L4)4
BUZZER (B1,B2)2
OLED OF 0.96 INCHES (Mod 2)1

Coding 

The  project software is made in Arduino IDE. First the necessary library required in cde are need to install. Using the the library manager ie found in sketch option on top menu bar of Arduino IDE   “TinyGPS++.h, Adafruit_GFX.h, Adafruit_SSD1306.h” library are installed.

Then the library is insislized in the code and then then the alcohol detetion function in the loop function here in code random speed is set for demonestration with speed you can change the code and implement with nay speedometer to ge speed . otherwise the code works with alcohol sensor with random speed limit set in code .. 

You can download the complete code from electronics for you and then upload the code by seleting the right com port and board . 

Now after uploading the  if you want then you can extednt the project to send the email when drunk drive is deteted. For this function the python is used and it can either be run on your laptop for testing and demonstration and for actual implementation the Raspberry pi / jetson or any similar small SBC can be used.

In python code the serial and the smtp library need to be installed and fater that in python cod eyou can chak the incommesage from the serial port if the message contains the high alcohol value then it will send the meaasge to email set in code. the email of sender and password of sender and the receiver email needed to be set in code refer fig 3.

Fig 3. Python code setting the sender's email , password and receivers email.
Fig 3. Python code setting the sender’s email , password and receivers email.

In email yo nee to some settings in order to allow the bot o send email due to security issue so following steps are taked for that

Creating a third-party app password

Turn on 2-step verification for your Google account:

  • Go to your Google Account and select Security.
  • Under “Signing in to Google,” select 2-Step Verification and follow the on-screen steps.

Generate an app password:

  • Go to your Google Account and select Security.
  • Under “Signing in to Google,” select 2-Step Verification.
  • Scroll down and select App passwords.
  • Enter a name to identify where you’ll use the app password.
  • Select Generate and follow the on-screen instructions.
  • The app password will be a 16-character code that appears on your device.
  • Select Done to complete the process.

Now you’re ready to proceed with the rest of the steps in your project.

Connections

Circuit diagram
Fig 4. Circuit diagram
Connection on breadboard
Fig 4. Connection on breadboard

Tetsing 

Now plug the device in laptop and check the comport change the comport in python code ad run the python code . Now bring the alcohol near the sensor it detet the alchol and the it alert with buzzer after that it send the email to address set in code you open opne email and check the email having the location of drunk and drive detected .you can chek the loaction position on google maps

Oled Display showing value
Fig 5. Oled Display showing value
Email sent from the device on drunk detection
Fig 6. Email sent from the device on drunk detection

SHARE YOUR THOUGHTS & COMMENTS

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Calculators