SafeStop: Revolutionizing Road Safety With Drunk Driving Intervention

by Kingeta in Circuits > Arduino

32 Views, 0 Favorites, 0 Comments

SafeStop: Revolutionizing Road Safety With Drunk Driving Intervention

Picsart_24-12-10_14-47-50-503.jpg

SafeStop: Revolutionizing Road Safety with Drunk Driving Intervention

Every year, thousands of lives are lost due to drunk driving accidents. The devastating consequences of impaired driving are a stark reminder of the need for innovative solutions to prevent such tragedies. Imagine a world where vehicles can detect and respond to drunk driving, automatically intervening to prevent accidents.

This is the vision behind SafeStop, a groundbreaking drunk driving intervention system that leverages cutting-edge technology to save lives. At its core, SafeStop utilizes an Arduino microcontroller paired with a highly sensitive MQ-3 alcohol sensor, GPS module & GSM module that sends co- ordinates to the police to apprehend such suspect while the vehicle is in an off position. This powerful combination enables the detection of alcohol presence in the driver's system, triggering a swift response to prevent vehicle operation.

By harnessing the potential of advanced sensor technology and intelligent system design, SafeStop offers a beacon of hope in the fight against drunk driving. Join me as we dive into the implementation of this life-saving innovation, and discover how SafeStop can be revolutionizing road safety

Supplies

Screenshot_20241210-151317.png

ARDUINO UNO

LCD DISPLAY

MQ3

SIM900 GSM MODULE

GPS MODULE NEO 6 UBLOX

5v RELAY MODULE

JUMPERS WIRES

5v DC MOTORS

9v BATTERY

Casing box

TOY TIRES

COMPONENT DETAILS

Meet the SafeStop System: A Revolutionary Drunk Driving Intervention Solution

At the heart of the SafeStop system lies an ingenious combination of cutting-edge technologies, carefully designed to prevent drunk driving accidents and save lives.


The Brain: Arduino Uno

The Arduino Uno serves as the central processing unit, receiving analog signals from the MQ3 sensors and triggering the intervention protocol when alcohol levels exceed the predetermined threshold.


The Eyes: LCD Display and MQ3 Sensors

The LCD display provides real-time feedback on the quality of alcohol detected, while the MQ3 sensors utilize semiconductor technology to detect even the slightest presence of alcohol particles in the air.


The Communicator: SIM900 GSM Module

In the event of suspected drunk driving, the SIM900 GSM module springs into action, transmitting critical coordinates to the authorities via a secure communication protocol.


The Navigator: GPS Module NEO 6 UBLOX

The GPS module provides pinpoint accuracy, tracking the coordinates of the suspected drunk driver and facilitating swift response from law enforcement.


The Enforcer: 5V Relay Module and 5V DC Motors

When the system detects excessive alcohol levels, the 5V relay module triggers the 5V DC motors to immobilize the vehicle, preventing further movement and potential accidents.



The Powerhouse: 9V Battery

A reliable 9V battery provides the necessary power to keep the SafeStop system operational and effective.


The Protector: Casing Box and Toy Tires

A sturdy casing box encloses and protects the system's components, while toy tires demonstrate the SafeStop system's ability to safely immobilize a vehicle.


Together, these components form a powerful and innovative solution to the pressing problem of drunk driving. The SafeStop system is poised to revolutionize road safety and save countless lives.

CIRCUIT DIAGRAM

Screenshot_20241210-172823.png

Schematic diagram of the system

Connections of Sensor and Modules to Arduino Uno

bf7d1b0d19f64b499a1dc420e9f66c94.gif
01d4eadda2744d9f95f7406f9d1bea63.gif

I2C TYPE LCD DISPLAY CONNECTED TO. ARDUINO UNO

Vcc---------------------------------------------------------5v

GND---------------------------------------------------------GND

SDA---------------------------------------------------------A4

SCL---------------------------------------------------------A5


MQ3 ALCOHOL SENSOR CONNECTED TO ARDUINO

Vcc----------------------------------------------------------5V

GND--------------------------------------------------------GND

A0---------------------------------------------------------A0


RELAY CONNECTION TO ARDUINO

Vcc---------------------------------------------------------5v

GND---------------------------------------------------------GND

IN---------------------------------------------------------D6


GSM MODULE CONNECTION TO ARDUINO

Vcc---------------------------------------------------------5v

GND---------------------------------------------------------GND

TX------------------------------------------------------------- D0

RX--------------------------------------------------------------D1


GPS MODULE NEO 6 UBLOX CONNECTIONS TO ARDUINO

Vcc---------------------------------------------------------5v

TX---------------------------------------------------------D2

RX---------------------------------------------------------D3


BUZZER CONNECTION TO ARDUINO

V+---------------------------------------------------------D12

V- ---------------------------------------------------------GND


DC MOTOR TO RELAY

V+---------------------------------------------------------ON

V- ---------------------------------------------------------GND SUPPLY

VCC SUPPLY--------------------------------------------------------COM


CASING

Using hot gun carefully place your set-up in a casing box

CODE

Using your Arduino IDE



Upload This code


##include <LiquidCrystal_I2C.h> // Include the I2C LCD library

#include <SoftwareSerial.h> // Include SoftwareSerial for GSM communication

#include <TinyGPS++.h> // Include TinyGPS++ library for GPS parsing


// Define the I2C LCD address and dimensions

LiquidCrystal_I2C lcd(0x27, 16, 2); // Adjust the I2C address if necessary


// Define pins and variables

#define sensor_pin A0 // Define the sensor pin

#define G_led 8 // Define the green LED pin

#define R_led 9 // Define the relay LED pin

#define buzzer 12 // Define the buzzer pin


float adcValue = 0, val = 0, mgL = 0; // Variables for sensor readings


// GSM and GPS module pins

#define GSM_TX 0// GSM module TX pin

#define GSM_RX 1// GSM module RX pin

#define GPS_TX 2// GPS module TX pin

#define GPS_RX 3 // GPS module RX pin


SoftwareSerial gsmSerial(GSM_RX, GSM_TX); // Software serial for GSM

SoftwareSerial gpsSerial(GPS_RX, GPS_TX); // Software serial for GPS


TinyGPSPlus gps; // Create a GPS object


void setup() {

pinMode(sensor_pin, INPUT); // Set the sensor pin as input

pinMode(R_led, OUTPUT); // Set the red LED pin as output

pinMode(G_led, OUTPUT); // Set the green LED pin as output

pinMode(buzzer, OUTPUT); // Set the buzzer pin as output


// Initialize the LCD

lcd.init();

lcd.backlight();

lcd.clear();

lcd.setCursor(0, 0);

lcd.print(" Welcome To ");

lcd.setCursor(0, 1);

lcd.print("Alcohol Detector");

delay(2000); // Display welcome message for 2 seconds

lcd.clear();


// Initialize GSM and GPS modules

gsmSerial.begin(9600); // Start GSM module

gpsSerial.begin(9600); // Start GPS module

}


void loop() {

adcValue = 0;


// Read the sensor value 10 times for averaging

for (int i = 0; i < 10; i++) {

adcValue += analogRead(sensor_pin);

delay(10); // Small delay between readings

}


// Calculate the average sensor value and convert to voltage

val = (adcValue / 10) * (5.0 / 1024.0);

mgL = 0.67 * val; // Convert voltage to mg/L


// Display the BAC value on the LCD

lcd.setCursor(0, 0);

lcd.print(" BAC: ");

lcd.print(mgL, 3);

lcd.print("mg/L ");


// Check if the BAC value exceeds the threshold

lcd.setCursor(0, 1);

if (mgL > 2.4) {

lcd.print(" Drunk ");

digitalWrite(buzzer, HIGH); // Activate the buzzer

digitalWrite(G_led, LOW); // Turn off the green LED

digitalWrite(R_led, HIGH); // Turn on the relay LED


// Get location and send an SMS

sendAlert();

} else {

lcd.print(" Normal ");

digitalWrite(G_led, HIGH); // Turn on the green LED

digitalWrite(R_led, LOW); // Turn off the relay LED

digitalWrite(buzzer, LOW); // Deactivate the buzzer

}


delay(300); // Delay to ensure the user can see the output

}


// Function to send an SMS alert with location

void

String message = "ALERT: Alcohol detected! Location: ";

message += "Lat: ";

message += String(latitude, 6);

message += ", Lon: ";

message += String(longitude, 6);


// Send SMS via GSM module

gsmSerial.println("AT+CMGF=1"); // Set SMS to text mode

delay(100);

gsmSerial.println("AT+CMGS=\"+1234567890\""); // Replace with the recipient's phone number

delay(100);

gsmSerial.println(message); // Send the message

delay(100);

gsmSerial.write(26); // End the SMS with Ctrl+Z

delay(1000);

}


Final Results

IMG_20240526_184445_020.jpg

After following the series of steps, you would have made your very own Revolutionizing Road Safety with Drunk Driving Intervention

Demonstration

b6c821635dd545ce9053225b11e89497.gif

The system in action!!