Alcohol Sensor MQ-3

Alcohol Sensor MQ-3

Introduction

This experiment demonstrates how to use the MQ-3 alcohol sensor with Arduino to detect alcohol concentration in the air.

Alcohol Sensor MQ-3

Components Needed

Circuit Setup

  1. Connect the MQ-3 sensor to the analog input pin A0 on the Arduino.
  2. Connect the LED to a digital output pin on the Arduino using a 220-ohm resistor in series.

The LED will light up when the alcohol concentration exceeds a certain threshold.

Alcohol Sensor Circuit Setup

Code for Alcohol Sensor MQ-3

Upload the following code to your Arduino to detect alcohol concentration:


const int alcoholPin = A0;
const int ledPin = 13;
int sensorValue = 0;

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  sensorValue = analogRead(alcoholPin);
  Serial.println(sensorValue);

  if (sensorValue > 400) {  // Threshold value
    digitalWrite(ledPin, HIGH);  // Turn on LED if alcohol concentration is high
  } else {
    digitalWrite(ledPin, LOW);   // Turn off LED if alcohol concentration is low
  }
  delay(100);
}
            

Explanation

The MQ-3 alcohol sensor detects alcohol in the air and outputs an analog signal, which is read by the Arduino. If the sensor value exceeds the threshold, the LED turns on.

Troubleshooting