Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Alcohol Detection System with Buzzer and LED Alert

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Alcohol Detection System with Buzzer and LED Alert

Circuit Documentation

Summary

This circuit is designed to interface an MQ-3 gas sensor with an Arduino UNO. The circuit includes a buzzer and an LED to provide visual and auditory alerts based on the sensor readings. The Arduino UNO reads both digital and analog signals from the MQ-3 sensor and controls the LED and buzzer accordingly.

Component List

  1. Arduino UNO

    • Description: A 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
  2. Buzzer

    • Description: An electronic device that produces a sound when a voltage is applied.
    • Pins: PIN, GND
  3. Resistor

    • Description: A passive electrical component with a resistance of 180 Ohms.
    • Pins: pin1, pin2
  4. MQ-3 Breakout

    • Description: A gas sensor module that detects alcohol.
    • Pins: VCC, GND, DO, AO
  5. LED: Two Pin (green)

    • Description: A green light-emitting diode.
    • Pins: cathode, anode

Wiring Details

Arduino UNO

Buzzer

Resistor

MQ-3 Breakout

LED: Two Pin (green)

Code Documentation

/* MQ-3 sensor with Arduino.
   created by the SriTu Tech team.
   Read the code below and use it for any of your creations.
   Home Page
*/

#define sensorDigital 2
#define LED 3
#define buzzer 4
#define sensorAnalog A1

void setup() {
  pinMode(sensorDigital, INPUT);
  pinMode(LED, OUTPUT);
  pinMode(buzzer, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  bool digital = digitalRead(sensorDigital);
  int analog = analogRead(sensorAnalog);

  Serial.print("Analog value : ");
  Serial.print(analog);
  Serial.print("\t");
  Serial.print("Digital value :");
  Serial.println(digital);

  if (digital == 0) {
    digitalWrite(LED, HIGH);
    digitalWrite(buzzer, HIGH);
  } else {
    digitalWrite(LED, LOW);
    digitalWrite(buzzer, LOW);
  }
}

Code Explanation

In the setup function, the pins are initialized, and the serial communication is started. The loop function reads the digital and analog values from the MQ-3 sensor and prints them to the serial monitor. If the digital value is low, the LED and buzzer are turned on; otherwise, they are turned off.