

The MQ-5 gas sensor, manufactured by Flying Fish (Part ID: MQ-5), is a versatile and reliable component designed to detect the presence of various gases, including natural gas, LPG (liquefied petroleum gas), methane, and hydrogen. It operates on the principle of resistive change in the presence of gas, providing an analog output proportional to the gas concentration. This sensor is widely used in gas leak detection systems, industrial safety applications, and home automation projects.








The MQ-5 sensor is designed for ease of use and integration into various systems. Below are its key technical details:
| Parameter | Value |
|---|---|
| Operating Voltage | 5V DC |
| Load Resistance (RL) | Adjustable (typically 10 kΩ) |
| Heater Voltage (VH) | 5V ± 0.2V |
| Heater Power Consumption | ≤ 800 mW |
| Detection Range | 200 ppm to 10,000 ppm |
| Preheat Time | ≥ 24 hours for stable output |
| Output Signal | Analog (voltage proportional to gas concentration) |
| Sensitivity | High sensitivity to LPG, methane, and natural gas |
| Operating Temperature | -20°C to 50°C |
| Humidity Range | ≤ 95% RH |
| Dimensions | 32mm x 20mm x 22mm (approx.) |
The MQ-5 sensor module typically comes with a 4-pin interface. Below is the pinout description:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (5V DC) |
| GND | Ground connection |
| AOUT | Analog output signal (proportional to gas level) |
| DOUT | Digital output signal (threshold-based) |
The MQ-5 sensor is straightforward to use and can be integrated into a variety of circuits. Below are the steps and best practices for using the sensor effectively:
VCC pin to a 5V DC power source and the GND pin to ground.AOUT pin to an analog input pin of a microcontroller (e.g., Arduino) to read the gas concentration as a voltage.DOUT pin to a digital input pin of a microcontroller. The digital output is triggered when the gas concentration exceeds a preset threshold, which can be adjusted using the onboard potentiometer.Below is an example of how to use the MQ-5 sensor with an Arduino UNO to read analog values:
// MQ-5 Gas Sensor Example Code for Arduino UNO
// This code reads the analog output of the MQ-5 sensor and prints the value
// to the Serial Monitor. Ensure the sensor is connected to the correct pins.
const int analogPin = A0; // Connect AOUT pin of MQ-5 to A0 on Arduino
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
Serial.println("MQ-5 Gas Sensor Test");
}
void loop() {
int sensorValue = analogRead(analogPin); // Read analog value from MQ-5
float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage (0-5V)
// Print the raw sensor value and voltage to the Serial Monitor
Serial.print("Sensor Value: ");
Serial.print(sensorValue);
Serial.print(" | Voltage: ");
Serial.print(voltage);
Serial.println(" V");
delay(1000); // Wait for 1 second before the next reading
}
sensorValue) ranges from 0 to 1023, corresponding to 0-5V.No Output Signal:
Inconsistent Readings:
Digital Output Not Triggering:
Sensor Damage:
Q1: Can the MQ-5 detect gases other than LPG and methane?
Yes, the MQ-5 can also detect hydrogen and other combustible gases, but its sensitivity is optimized for LPG, methane, and natural gas.
Q2: How do I calibrate the MQ-5 sensor?
To calibrate, expose the sensor to a known concentration of gas and adjust the load resistance (RL) or use software calibration to map the analog output to the gas concentration.
Q3: Can I use the MQ-5 with a 3.3V microcontroller?
The MQ-5 requires a 5V power supply for the heater. However, you can use a voltage divider or level shifter to interface the analog output with a 3.3V microcontroller.
Q4: How long does the MQ-5 sensor last?
The sensor typically lasts for several years under normal operating conditions. However, its sensitivity may degrade over time, especially in harsh environments.
By following this documentation, users can effectively integrate the MQ-5 gas sensor into their projects for reliable gas detection and monitoring.