This document provides a detailed overview of an alcohol detection circuit. The circuit uses an MQ-3 alcohol sensor to detect alcohol levels. If the detected alcohol level exceeds a predefined threshold, the circuit triggers a relay, lights up an LED, and sounds a buzzer. The circuit is controlled by an Arduino UNO microcontroller.
Arduino UNO
MQ-3 Breakout
Relay module 5v-30v
Buzzer
LED: Two Pin (red)
GND connected to:
5V connected to:
A0 connected to:
D8 connected to:
D7 connected to:
D6 connected to:
GND connected to:
VCC connected to:
AO connected to:
V- connected to:
V+ connected to:
trigger connected to:
GND connected to:
PIN connected to:
cathode connected to:
anode connected to:
/*
* Arduino Sketch for Alcohol Detection Circuit
* This code reads the analog output from an MQ-3 alcohol sensor. If the alcohol
* level exceeds a certain threshold, it triggers a relay, lights up an LED, and
* sounds a buzzer.
*/
const int mq3Pin = A0; // MQ-3 sensor analog output connected to A0
const int relayPin = 8; // Relay module trigger pin connected to D8
const int buzzerPin = 7; // Buzzer pin connected to D7
const int ledPin = 6; // LED anode connected to D6
const int threshold = 300; // Threshold for alcohol level detection
void setup() {
pinMode(relayPin, OUTPUT); // Set relay pin as output
pinMode(buzzerPin, OUTPUT); // Set buzzer pin as output
pinMode(ledPin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int sensorValue = analogRead(mq3Pin); // Read the analog value from MQ-3
Serial.println(sensorValue); // Print the sensor value to the serial monitor
if (sensorValue > threshold) { // If alcohol level exceeds threshold
digitalWrite(relayPin, HIGH); // Activate relay
digitalWrite(buzzerPin, HIGH); // Sound buzzer
digitalWrite(ledPin, HIGH); // Light up LED
} else {
digitalWrite(relayPin, LOW); // Deactivate relay
digitalWrite(buzzerPin, LOW); // Turn off buzzer
digitalWrite(ledPin, LOW); // Turn off LED
}
delay(500); // Wait for 500 milliseconds before next reading
}
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This documentation provides a comprehensive overview of the alcohol detection circuit, including component descriptions, wiring details, and the code used to control the circuit.