Experiment No: 8
AIM: Design and Implementation of Alcohol detection device using Arduino Uno.
APPARATUS REQUIRED :
1. Arduino Uno
2. MQ-3 Alcohol Sensor
3. Jumper wire
4. Buzzer
5. Breadboard
6. Power supply / Battery.
THEORY :
The MQ-3 alcohol sensor is a low-cost, versatile sensor designed to detect alcohol vapors in the air. It
features a sensitive tin dioxide (SnO2) layer that changes resistance in response to alcohol levels. The
sensor operates within a 5V range and outputs an analog voltage proportional to the alcohol
concentration detected. The MQ-3 is often used in breathalyzer projects and automotive applications to
detect alcohol in the breath. It has a fast response time and high sensitivity, with the ability to detect
alcohol levels from 0.04 mg/L to 4 mg/L. Calibration is essential for accuracy, and the sensor is generally
resistant to humidity and temperature variations, making it suitable for both indoor and outdoor use.
PROGRAM USED:
// Define pin connections
const int mq3Pin = A0; // MQ-3 sensor output connected to analog pin A0
const int ledPin = 9; // LED or buzzer pin (output pin)
const int threshold = 400; // Define alcohol threshold (adjust based on your need)
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
// Set the LED/buzzer pin as output
pinMode(ledPin, OUTPUT);
// Start with LED/buzzer off
digitalWrite(ledPin, LOW);
}
void loop() {
// Read analog value from the MQ-3 sensor
int sensorValue = analogRead(mq3Pin);
// Print the sensor value to the Serial Monitor for debugging
Serial.print("MQ-3 Sensor Value: ");
Serial.println(sensorValue);
// Check if the sensor value exceeds the threshold
if (sensorValue > threshold) {
// Turn on the LED/buzzer as an alert
digitalWrite(ledPin, HIGH);
} else {
// Turn off the LED/buzzer when alcohol level is below threshold
digitalWrite(ledPin, LOW);
// Add a small delay before the next reading
delay(500);
PROCEDURE:
1. Assemble the MQ-3 sensor and display on the breadboard.
2. Now make the connections as per the circuit diagram.
3. The connections are as follows:
Sensor Vcc +5v Arduino
Sensor Gnd Arduino Gnd
Sensor data pin A0
Buzzer (+ve) D7
Buzzer (_ve_ Gnd
1. After making the connections now open arduino IDE and write the code.
2. Connect the arduino and with laptop.
3. Select Arduino UNO board and then select the port which automatically comes after the plugging
in the Arduino cable.
4. Compile and upload the code.
5. After successful uploading test the model.
CIRCUIT DIAGRAM :
PRECAUTIONS:
1. All the connections should be tight.
2. Handle all the equipment carefully.
3. Compile and upload the correct program.
4. Check the connections before turning the circuit ON.
5. While connecting the jumper wires, take care of their pins.
6. Make sure that sensitivity of sensors is not zero.
7. DO not touch the MQ-3 sensor as it may cause burns due to hot nichrome wire.
8. Do not directly spray the sanitizer on MQ-3 sensor
RESULT:
Alcohol Detection system has been successfully designed which can detect alcohol content and turns on
the buzzer .