

The MQ-5 Gas Sensor, manufactured by Tengxing (Part ID: Gas Sensor), is a versatile and reliable sensor designed to detect various gases, including natural gas, LPG (liquefied petroleum gas), and other combustible gases. 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 applications such as gas leak detection, air quality monitoring, and safety systems in industrial and domestic environments.








| 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 - 10,000 ppm (gas-specific) |
| Preheat Time | ≥ 24 hours for stable output |
| Output Signal | Analog (voltage proportional to gas concentration) |
| Operating Temperature | -20°C to 50°C |
| Humidity Range | ≤ 95% RH |
| Dimensions | 32mm x 20mm x 22mm |
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (5V DC) |
| 2 | GND | Ground pin |
| 3 | AOUT | Analog output pin (voltage proportional to gas concentration) |
| 4 | DOUT | Digital output pin (high/low signal based on threshold) |
// MQ-5 Gas Sensor Example Code for Arduino UNO
// This code reads the analog output (AOUT) of the MQ-5 sensor and prints the
// gas concentration to the Serial Monitor.
const int analogPin = A0; // Connect AOUT pin of MQ-5 to Arduino A0
int sensorValue = 0; // Variable to store the analog reading
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
Serial.println("MQ-5 Gas Sensor Test");
}
void loop() {
sensorValue = analogRead(analogPin); // Read the analog value from the sensor
float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage (0-5V)
// Print the 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
}
No Output or Incorrect Readings:
Fluctuating Readings:
Digital Output Not Triggering:
Sensor Not Responding to Gas:
Q: Can the MQ-5 detect gases other than natural gas and LPG?
Q: How do I calibrate the MQ-5 sensor?
Q: Can I use the MQ-5 with a 3.3V microcontroller?
Q: How long does the MQ-5 sensor last?
By following this documentation, users can effectively integrate the MQ-5 Gas Sensor into their projects and ensure reliable performance.