Arduino-Based Alcohol Detection System with GPS and GSM Module
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed to monitor alcohol levels and send GPS coordinates via SMS if the alcohol level exceeds a certain threshold. The circuit includes various components such as an Arduino UNO, a buzzer, an LED, an MQ-3 alcohol sensor, a SIM800L GSM module, a Neo 6M GPS module, a 3.7V battery, a rocker switch, a motor driver, motors with wheels, and an LCD display. The Arduino UNO serves as the central microcontroller, interfacing with all other components.
Component List
Arduino UNO
- Description: Microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0, +, -
Buzzer
- Description: An audio signaling device.
- Pins: PIN, GND
LED: Two Pin (red)
- Description: A red light-emitting diode.
- Pins: cathode, anode
MQ-3 Breakout
- Description: Alcohol sensor module.
- Pins: VCC, GND, DO, AO
3.7V Battery
- Description: Power source.
- Pins: +, -
Rocker Switch (SPST)
- Description: Single Pole Single Throw switch.
- Pins: 1, 2
SIM800L
- Description: GSM/GPRS module.
- Pins: NFT, RING, VCC, DTR, RST, MIC +, RXD, MIC-, TXD, SPK+, GND, SPK-
Neo 6M GPS Module
- Description: GPS module.
- Pins: GND, TX, RX, VCC
Motor and Wheels
- Description: Motor with attached wheels.
- Pins: vcc, GND
LCD 16x2 (Wokwi Compatible)
- Description: 16x2 character LCD display.
- Pins: VSS, VDD, V0, RS, RW, E, D0, D1, D2, D3, D4, D5, D6, D7, A, K
5k Preset
- Description: Variable resistor.
- Pins: fixed end 1, fixed end 2, variable end
L293D Motor Driver
- Description: Motor driver IC.
- Pins: gnd, 9/12 volts, 5volts, motor input 1, motor input 2, +v1, -v1, +v2, -v2
Wiring Details
Arduino UNO
- D13: Connected to Buzzer PIN
- +: Connected to 3.7V Battery -
- D7: Connected to LED anode
- 5V: Connected to 5k Preset fixed end 1, MQ-3 Breakout VCC, LCD VDD, LCD A, Neo 6M GPS Module VCC, L293D Motor Driver 9/12 volts, L293D Motor Driver 5volts
- -: Connected to MQ-3 Breakout GND
- A0: Connected to MQ-3 Breakout AO
- D9: Connected to SIM800L RXD
- D8: Connected to SIM800L TXD
- D0: Connected to Neo 6M GPS Module TX
- D1: Connected to Neo 6M GPS Module RX
- GND: Connected to 5k Preset fixed end 2, LCD VSS, LCD K, LCD RW, L293D Motor Driver gnd
- D5: Connected to LCD D4
- D4: Connected to LCD D5
- D3: Connected to LCD D6
- D2: Connected to LCD D7
- D10: Connected to L293D Motor Driver motor input 1, L293D Motor Driver motor input 2
Buzzer
- PIN: Connected to Arduino UNO D13
- GND: Connected to Arduino UNO +
LED: Two Pin (red)
- cathode: Connected to Arduino UNO +
- anode: Connected to Arduino UNO D7
MQ-3 Breakout
- VCC: Connected to Arduino UNO 5V
- GND: Connected to Arduino UNO -
- AO: Connected to Arduino UNO A0
3.7V Battery
- +: Connected to Rocker Switch 1
- -: Connected to Arduino UNO +
Rocker Switch (SPST)
- 1: Connected to 3.7V Battery +
- 2: Connected to SIM800L VCC
SIM800L
- GND: Connected to Arduino UNO +
- VCC: Connected to Rocker Switch 2
- RXD: Connected to Arduino UNO D9
- TXD: Connected to Arduino UNO D8
Neo 6M GPS Module
- GND: Connected to Arduino UNO +
- TX: Connected to Arduino UNO D0
- RX: Connected to Arduino UNO D1
- VCC: Connected to Arduino UNO 5V
Motor and Wheels
- vcc: Connected to L293D Motor Driver +v2, L293D Motor Driver +v1
- GND: Connected to L293D Motor Driver -v2, L293D Motor Driver -v1
LCD 16x2 (Wokwi Compatible)
- VSS: Connected to Arduino UNO GND
- VDD: Connected to Arduino UNO 5V
- V0: Connected to 5k Preset variable end
- RS: Connected to Arduino UNO D12
- RW: Connected to Arduino UNO GND
- E: Connected to Arduino UNO D11
- D4: Connected to Arduino UNO D5
- D5: Connected to Arduino UNO D4
- D6: Connected to Arduino UNO D3
- D7: Connected to Arduino UNO D2
- A: Connected to Arduino UNO 5V
- K: Connected to Arduino UNO GND
5k Preset
- fixed end 1: Connected to Arduino UNO 5V
- fixed end 2: Connected to Arduino UNO GND
- variable end: Connected to LCD V0
L293D Motor Driver
- gnd: Connected to Arduino UNO GND
- 9/12 volts: Connected to Arduino UNO 5V
- 5volts: Connected to Arduino UNO 5V
- motor input 1: Connected to Arduino UNO D10
- motor input 2: Connected to Arduino UNO D10
- +v1: Connected to Motor and Wheels vcc
- -v1: Connected to Motor and Wheels GND
- +v2: Connected to Motor and Wheels vcc
- -v2: Connected to Motor and Wheels GND
Documented Code
#include <SoftwareSerial.h>
SoftwareSerial sim(8, 9);
#include <TinyGPS++.h>
#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
float lattitude, longitude;
SoftwareSerial gpsSerial(0, 1); //rx,tx
TinyGPSPlus gps; // create gps object
int value; //variable to hold the value of alcohol
#define motor 10
#define buzzer 13
#define led 7
String number = "+919889342918"; //-> change with your number
int a;
void setup()
{
pinMode(motor, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(led, OUTPUT);
a = 700;
Serial.begin(9600);
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print(" Subscribe");
lcd.setCursor(0, 1);
lcd.print(" AEROTECH INDIA");
sim.begin(9600);
gpsSerial.begin(9600); // connect gps sensor
delay(6000);
lcd.clear();
}
void loop()
{
value = analogRead(A0); //reading value from arduino analog pin which is receiving value from sensor pin
lcd.setCursor(0, 0); // setting