Component guide · Beginner · 3 min read
MQ-6 LPG / Propane / Butane and MQ-8 Hydrogen Gas Sensor Modules

with Mikroe Hydrogen Click)
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The MQ-6 detects LPG, propane and butane (about 200 to 10,000 ppm) and is the usual choice for kitchen cylinder leak alarms. The MQ-8 detects hydrogen (about 100 to 1000 ppm) for battery rooms and electrolysis projects. Both are tin-oxide sensors with a 5 V heater, an analog output and, on modules, a digital alarm output with a trimmer.
Key specs at a glance
- Heater
- 5 V, about 150 mA
- MQ-6
- LPG, propane, butane, about 200 to 10,000 ppm
- MQ-8
- Hydrogen, about 100 to 1000 ppm
- Output
- Analog and digital threshold
- Warm-up
- About 2 minutes; 24 hours burn-in
- Supply
- 5 V
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
What the MQ-6 LPG and MQ-8 hydrogen sensors is
The MQ6 (LPG and butane) and MQ8 (hydrogen) are metal-oxide gas sensors used in gas leak alarms, kitchen monitors and hydrogen experiments.
LPG is heavier than air, so mount an MQ-6 about 30 cm above the floor. Hydrogen is lighter than air, so mount an MQ-8 near the ceiling.
The MQ-6 is more selective for LPG than the MQ-2, which also reacts strongly to smoke and alcohol.
MQ-6 LPG and MQ-8 hydrogen sensors pinout
The pins on the MQ-6 LPG and MQ-8 hydrogen sensors and what each one does.
| Pin | Function |
|---|---|
| VCC | 5 V |
| GND | Ground |
| AO | Analog output |
| DO | Alarm output (set with trimmer) |
- VCC
- 5 V
- GND
- Ground
- AO
- Analog output
- DO
- Alarm output (set with trimmer)
Wiring the MQ-6 LPG and MQ-8 hydrogen sensors
Connect the MQ-6 LPG and MQ-8 hydrogen sensors like this.
| MQ-6 LPG and MQ-8 hydrogen sensors pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 5 V | 5 V (VIN) |
| GND | GND | GND |
| AO | A0 | GPIO 34 via divider |
| DO | D2 | GPIO 27 |
- VCC
- Arduino Uno:
- 5 V
- ESP32:
- 5 V (VIN)
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- AO
- Arduino Uno:
- A0
- ESP32:
- GPIO 34 via divider
- DO
- Arduino Uno:
- D2
- ESP32:
- GPIO 27
Example code
A minimal sketch to check the part works.
const int BUZZ = 8;
const int LIMIT = 400; // set after watching clean-air readings
void setup() { Serial.begin(115200); pinMode(BUZZ, OUTPUT); delay(120000); }
void loop() {
int v = analogRead(A0);
Serial.println(v);
digitalWrite(BUZZ, v > LIMIT ? HIGH : LOW);
delay(500);
}Setup and tuning
feed 5 V at about 150 mA from the supply rail.
use AO for a gas level and DO with the trimmer for a simple alarm.
burn in for 24 hours first, then a few minutes each start.
LPG sinks, so mount the MQ6 near the floor; hydrogen rises, so mount the MQ8 high.
set thresholds from readings in clean air and with a safe test gas.
What you need
Shop this list7 of 8 found in our store · ₹1,930
MQ-6 Propane Isobutane LPG Gas Sensor Module: the part this guide coversMQ-6 Propane Isobutane LPG Gas Sensor Module₹86
MQ-8 Hydrogen H2 Gas Sensor Alarm Detection Module: another version this guide coversMQ-8 Hydrogen H2 Gas Sensor Alarm Detection Module₹97
Winsen MQ-8 Hydrogen Gas Sensor Module – 5V DC, 100-1000ppm: another version this guide coversWinsen MQ-8 Hydrogen Gas Sensor Module – 5V DC, 100-1000ppm₹129
Mikroe HYDROGEN Click (Mikroe‑1629) – MQ‑8 Hydrogen Gas Sensor Board, Analog, mikroBUS: another version this guide coversMikroe HYDROGEN Click (Mikroe‑1629) – MQ‑8 Hydrogen Gas Sensor Board, Analog, mikroBUS₹1,129- Uno R3 development board: the controller used in the wiring tableFind this part
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
Buzzer module 3.3-5 V: for an audible alarmBuzzer Module 3.3–5V₹27
5 V relay module with optocoupler: to switch a fan or alarm5V Relay Module with Optocoupler₹74
Alternatives and when to choose them
- MQ-5 LPG sensor: similar target gases.
- MQ-2 sensor: smoke and LPG.
- Gas leak detectors and alarms: ready-made alarms.
Common mistakes to avoid
- Mounting the LPG sensor high on the wall.
- Testing with an open flame.
- Trusting readings during warm-up.
- Relying on it as the only safety device.
Frequently asked questions
Which sensor is best for an LPG leak alarm?
The MQ6 is tuned for LPG and butane, with the MQ5 as an alternative.
Where should I place an LPG sensor?
Near the floor, about 30 cm up, because LPG is heavier than air.
Can the MQ8 detect other gases?
It reacts mainly to hydrogen but has some sensitivity to alcohol and LPG.
How do I test the sensor safely?
Release a tiny amount of gas from an unlit lighter nearby; never use a flame.
Can I use it as a certified gas alarm?
No. Use it for learning and add a certified alarm for safety.
Parts for 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.

