- All products
- Sensors & Modules
- Gas
- MQ 5 Gas Sensor
- Gas
The sensor operates based on Metal Oxide Semiconductor MOS technology, also known as a chemiresistor. It detects gases by monitoring changes in the resistance of its sensing material when exposed to different gas concentrations. This makes the MQ5 a reliable and practical solution for real time gas detection.
Features
- Analog output voltage from 0 to 5V proportional to gas concentration
- High sensitivity to LPG, natural gas, and city gas
- Detects LPG and CH4 in the range of 300 to 10000 ppm
- Also responsive to hydrogen, carbon monoxide, and alcohol
- Fast response and recovery time
- Long life and stable performance
- Operates at a standard 5V DC supply
Principle of Work
The MQ5 Gas Sensor uses Metal Oxide Semiconductor technology. Inside the sensor, a metal oxide sensing layer is heated using an internal heater coil. When the sensor is exposed to gas, a chemical reaction occurs on the heated surface, changing the electrical conductivity of the sensing material.
As the concentration of gas increases, the conductivity of the sensing layer increases, resulting in a change in the output voltage. This analog voltage is read by a microcontroller using an ADC and can be processed to estimate gas concentration and trigger alerts when predefined limits are exceeded.
Pinout of the Sensor

The MQ5 Gas Sensor has six pins divided into three categories:
- A Pins: Two pins connected together and supplied with +5V
- B Pins: Two pins connected together to provide the analog output signal
- H Pins: Heater pins connected to +5V and GND for heating the sensing element
A load resistor Rl between 2K and 47K ohms is used to adjust sensitivity. Lower resistance reduces sensitivity, while higher resistance increases sensitivity.
Applications
- Gas leakage detection systems
- Industrial safety monitoring
- Gas powered appliance safety
- Environmental gas monitoring
- Laboratory gas detection
- Automotive gas monitoring
- Fire detection systems
- Agricultural gas monitoring
Circuit

- Connect A and one H pin to Arduino 5V
- Connect the other H pin to Arduino GND
- Connect both B pins to Arduino analog pin A0
- Use a variable resistor instead of a fixed 10K resistor for adjustable sensitivity
Library
This module does not require any external libraries.
Arduino Code
#define MQ5pin A0
int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
Serial.println("MQ5 warming up");
delay(20000);
}
void loop() {
int sensorValue = analogRead(MQ5pin);
Serial.print("Sensor Value: ");
Serial.println(sensorValue);
if (sensorValue > 400) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
delay(2000);
}
The sensor output is read from analog pin A0. When the reading exceeds a threshold value, an LED connected to pin 13 turns on to indicate gas detection.
Technical Details
- Heater Voltage: 5.0V
- Power Supply: 5V
- Working Current: 150mA
- Preheat Time: More than 20 seconds
- Heater Resistance: 31 ±10 percent
- Sensing Resistance Range: 10K to 60K
- Power Consumption: 0.5 to 800 mW
- Detecting Concentration: 200 to 10000 ppm
Comparisons
Using the standalone MQ5 sensor provides greater flexibility and lower cost, while MQ5 sensor modules offer easier integration with built in circuitry. The best choice depends on whether ease of use or customization is more important for the project.
The sensor operates based on Metal Oxide Semiconductor MOS technology, also known as a chemiresistor. It detects gases by monitoring changes in the resistance of its sensing material when exposed to different gas concentrations. This makes the MQ5 a reliable and practical solution for real time gas detection.
Features
- Analog output voltage from 0 to 5V proportional to gas concentration
- High sensitivity to LPG, natural gas, and city gas
- Detects LPG and CH4 in the range of 300 to 10000 ppm
- Also responsive to hydrogen, carbon monoxide, and alcohol
- Fast response and recovery time
- Long life and stable performance
- Operates at a standard 5V DC supply
Principle of Work
The MQ5 Gas Sensor uses Metal Oxide Semiconductor technology. Inside the sensor, a metal oxide sensing layer is heated using an internal heater coil. When the sensor is exposed to gas, a chemical reaction occurs on the heated surface, changing the electrical conductivity of the sensing material.
As the concentration of gas increases, the conductivity of the sensing layer increases, resulting in a change in the output voltage. This analog voltage is read by a microcontroller using an ADC and can be processed to estimate gas concentration and trigger alerts when predefined limits are exceeded.
Pinout of the Sensor

The MQ5 Gas Sensor has six pins divided into three categories:
- A Pins: Two pins connected together and supplied with +5V
- B Pins: Two pins connected together to provide the analog output signal
- H Pins: Heater pins connected to +5V and GND for heating the sensing element
A load resistor Rl between 2K and 47K ohms is used to adjust sensitivity. Lower resistance reduces sensitivity, while higher resistance increases sensitivity.
Applications
- Gas leakage detection systems
- Industrial safety monitoring
- Gas powered appliance safety
- Environmental gas monitoring
- Laboratory gas detection
- Automotive gas monitoring
- Fire detection systems
- Agricultural gas monitoring
Circuit

- Connect A and one H pin to Arduino 5V
- Connect the other H pin to Arduino GND
- Connect both B pins to Arduino analog pin A0
- Use a variable resistor instead of a fixed 10K resistor for adjustable sensitivity
Library
This module does not require any external libraries.
Arduino Code
#define MQ5pin A0
int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
Serial.println("MQ5 warming up");
delay(20000);
}
void loop() {
int sensorValue = analogRead(MQ5pin);
Serial.print("Sensor Value: ");
Serial.println(sensorValue);
if (sensorValue > 400) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
delay(2000);
}
The sensor output is read from analog pin A0. When the reading exceeds a threshold value, an LED connected to pin 13 turns on to indicate gas detection.
Technical Details
- Heater Voltage: 5.0V
- Power Supply: 5V
- Working Current: 150mA
- Preheat Time: More than 20 seconds
- Heater Resistance: 31 ±10 percent
- Sensing Resistance Range: 10K to 60K
- Power Consumption: 0.5 to 800 mW
- Detecting Concentration: 200 to 10000 ppm
Comparisons
Using the standalone MQ5 sensor provides greater flexibility and lower cost, while MQ5 sensor modules offer easier integration with built in circuitry. The best choice depends on whether ease of use or customization is more important for the project.

