

The MQ5 Gas Sensor, manufactured by DFRobot (Part ID: SEN0130), is a versatile and reliable gas detection sensor designed to detect various gases, including natural gas, LPG (liquefied petroleum gas), and smoke. It operates on the principle of resistive change in the presence of gas, providing an analog output proportional to the gas concentration in the environment. This sensor is widely used in safety systems, gas leak detection, and environmental monitoring applications.








The MQ5 Gas Sensor is designed for ease of use and integration into various systems. Below are its key technical details:
| Parameter | Value |
|---|---|
| Operating Voltage | 5V DC |
| Power Consumption | ≤ 800 mW |
| Detection Range | 200 - 10,000 ppm (LPG, CH4) |
| Preheat Time | ≥ 24 hours (for stable output) |
| Output Signal | Analog (0-5V) |
| Sensitivity Adjustment | Potentiometer on the module |
| Operating Temperature | -10°C to 50°C |
| Dimensions | 32mm x 22mm x 27mm |
The MQ5 Gas Sensor module has a 4-pin interface for easy connection to microcontrollers or other circuits. Below is the pin configuration:
| Pin Name | Description |
|---|---|
| VCC | Power supply pin (5V DC) |
| GND | Ground pin |
| AOUT | Analog output pin (proportional to gas level) |
| DOUT | Digital output pin (triggered by threshold) |
The MQ5 Gas Sensor is simple to use and can be integrated into a variety of circuits. Follow the steps below to use the sensor effectively:
VCC pin to a 5V power source and the GND pin to ground.AOUT pin to read the analog signal, which varies with gas concentration.DOUT pin for a digital signal. The threshold for the digital output can be adjusted using the onboard potentiometer.VCC to Arduino 5VGND to Arduino GNDAOUT to an analog input pin (e.g., A0)DOUT to a digital input pin for threshold-based detection.Below is an example code snippet to read the analog output of the MQ5 Gas Sensor using an Arduino UNO:
// MQ5 Gas Sensor Example Code
// Manufacturer: DFRobot
// Part ID: SEN0130
const int analogPin = A0; // Connect AOUT pin of MQ5 to A0 on Arduino
int sensorValue = 0; // Variable to store the sensor reading
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
Serial.println("MQ5 Gas Sensor Test");
}
void loop() {
sensorValue = analogRead(analogPin); // Read the analog value from the sensor
Serial.print("Gas Concentration (Analog Value): ");
Serial.println(sensorValue); // Print the sensor value to the Serial Monitor
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:
Q1: Can the MQ5 detect gases other than LPG and natural gas?
A1: Yes, the MQ5 can detect other gases, such as smoke and hydrogen, but it is most sensitive to LPG and natural gas.
Q2: How do I calibrate the sensor?
A2: To calibrate the sensor, expose it to a known concentration of gas and adjust the potentiometer until the desired output is achieved.
Q3: Can I use the MQ5 with a 3.3V microcontroller?
A3: The MQ5 requires a 5V power supply for proper operation. Use a level shifter or voltage regulator if interfacing with a 3.3V microcontroller.
Q4: How long does the sensor last?
A4: The MQ5 has a typical lifespan of 2-3 years under normal operating conditions.