Component guide · Beginner · 3 min read
MQ-3 Alcohol Sensor

Pinout, Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The MQ-3 is a heated metal-oxide gas sensor that responds mainly to alcohol vapour. Modules give an analog voltage that rises with alcohol level and a digital output that switches at a threshold you set with the trim pot. Power the heater from 5 V, let it warm up, and calibrate in clean air. Use it for breath demonstrations and fermentation monitoring.
Key specs at a glance
- Detects
- Alcohol
- Range
- About 0.04 to 4 mg/L alcohol vapour (roughly 25 to 500 ppm ethanol)
- Heater
- 5 V, about 150 mA (about 0.75 W)
- Output
- Analog (AO) and digital threshold (DO) on modules
- Warm-up
- A few minutes before use; 24 to 48 hours of burn-in for stable readings
- Most sensitive to
- Ethanol; low response to benzene, little to smoke and CO
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1MQ-3 Alcohol Gas Detector Sensor Module – Analog & Digital Output₹109
Option 2DFRobot Gravity Analog Alcohol Sensor MQ3 for Arduino₹804
Option 3Mikroe Alcohol Click (Mikroe-1586) – MQ-3 Alcohol Gas Sensor Board, Analog Output, Range: 0.04~4mg/l₹1,129
Option 4Seeed Studio Grove MQ3 Alcohol Gas Sensor Module – Analog Output₹2,089
Option 5Waveshare MQ-3 Alcohol Gas Sensor Module – Analog & Digital Output₹459
What the MQ-3 is
The MQ-3 is a tin dioxide (SnO2) gas sensor tuned for alcohol. Its heater keeps the sensing layer hot; when alcohol vapour reaches it, the layer's resistance drops, and the module's load resistor turns that into a rising voltage on AO.
It is the classic sensor for breath-alcohol demonstrations and fermentation monitors. MQ sensors are for hobby and learning projects. They are not certified gas alarms; for safety use an approved detector.
MQ-3 pinout
The pins on the MQ-3 and what each one does.
| Pin | Function |
|---|---|
| VCC | 5 V supply for the heater and the comparator |
| GND | Ground |
| AO | Analog output: rises as the gas level rises |
| DO | Digital output from the LM393 comparator; switches at the level set by the trim pot |
- VCC
- 5 V supply for the heater and the comparator
- GND
- Ground
- AO
- Analog output: rises as the gas level rises
- DO
- Digital output from the LM393 comparator; switches at the level set by the trim pot
Wiring the MQ-3
The heater draws about 150 mA, so power it from the 5 V rail, not a 3.3 V pin. The analog output can reach 5 V, so an ESP32 needs a divider (10 kΩ over 20 kΩ gives a third off) on AO.
| MQ-3 pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 5V | 5V (VIN) |
| GND | GND | GND |
| AO | A0 | GPIO 34 through a 10k/20k divider |
| DO | D2 (optional) | GPIO 27 (optional, via divider) |
- VCC
- Arduino Uno:
- 5V
- ESP32:
- 5V (VIN)
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- AO
- Arduino Uno:
- A0
- ESP32:
- GPIO 34 through a 10k/20k divider
- DO
- Arduino Uno:
- D2 (optional)
- ESP32:
- GPIO 27 (optional, via divider)
Example code
Rs/R0 falls as the gas level rises. Convert it to ppm with the curve in the datasheet; treat the result as an estimate, not a certified reading.
const int AO = A0;
const float RL = 10.0; // load resistor on the module, kOhm (check yours)
const float CLEAN_AIR = 60; // Rs/R0 in clean air from the datasheet curve
float R0 = 0;
float readRs() {
long sum = 0;
for (int i = 0; i < 50; i++) { sum += analogRead(AO); delay(5); }
float v = (sum / 50.0) * 5.0 / 1023.0;
return RL * (5.0 - v) / v; // sensor resistance, kOhm
}
void setup() {
Serial.begin(115200);
Serial.println("Warming up 3 minutes in clean air...");
delay(180000);
R0 = readRs() / CLEAN_AIR; // calibrate in clean air
Serial.print("R0 = "); Serial.println(R0);
}
void loop() {
float ratio = readRs() / R0; // lower ratio = more gas
Serial.print("Rs/R0 = "); Serial.println(ratio, 2);
delay(1000);
}Setup and tuning
run a new sensor for 24 to 48 hours before calibrating.
in clean air at room temperature, then save it in EEPROM.
blow gently from about 5 to 10 cm; wait for the reading to recover between tests.
set the DO trim pot for a simple on/off alarm.
What you need
Shop this list8 of 9 found in our store · ₹4,845
MQ-3 alcohol gas detector module: the sensor this guide coversMQ-3 Alcohol Gas Detector Sensor Module – Analog & Digital Output₹109Closest match, check the specs
DFRobot Gravity Analog Alcohol Sensor MQ3 for Arduino: another version this guide coversDFRobot Gravity Analog Alcohol Sensor MQ3 for Arduino₹804
Mikroe Alcohol Click (Mikroe-1586) – MQ-3 Alcohol Gas Sensor Board, Analog Output, Range: 0.04~4mg/l: another version this guide coversMikroe Alcohol Click (Mikroe-1586) – MQ-3 Alcohol Gas Sensor Board, Analog Output, Range: 0.04~4mg/l₹1,129
Seeed Studio Studio Grove MQ3 Alcohol Gas Sensor Module – Analog Output: another version this guide coversSeeed Studio Grove MQ3 Alcohol Gas Sensor Module – Analog Output₹2,089Closest match, check the specs
Waveshare MQ-3 Alcohol Gas Sensor Module – Analog & Digital Output: another version this guide coversWaveshare MQ-3 Alcohol Gas Sensor Module – Analog & Digital Output₹459- Uno R3 development board: the controller used in the wiring tableFind this part
16x2 LCD with I2C: to show readings on a character display16×2 LCD with I2C (RG1602A)₹179Closest match, check the specs
Buzzer module 3.3-5 V: for an audible alarmBuzzer Module 3.3–5V₹27
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- MQ gas sensors: how the whole MQ family works.
- MQ-135: general air quality.
- Electrochemical gas sensors: for accurate, selective readings.
Try it: Voltage divider calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Reading it straight after power-up, before the heater has warmed it.
- Powering the heater from a 3.3 V pin.
- Treating the result as a legal breath-alcohol value.
- Blowing directly into the sensor with moist breath, which saturates it.
Frequently asked questions
What does the MQ-3 detect?
Mainly alcohol (ethanol) vapour, with a small response to some other gases.
Can it be used as a breathalyser?
For a demonstration only; it is not accurate or certified for legal tests.
How long does it need to warm up?
A few minutes for readings, and 24 to 48 hours of burn-in when new.
Can I use it with an ESP32?
Yes, power the heater from 5 V and divide the analog output to under 3.3 V.
Why is my reading drifting?
Temperature and humidity change the sensor; recalibrate R0 and compensate if you need stable values.
Parts for this guide
Calculators
Projects that use it
Put this into practice: 13 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

