Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use MQ-5: Examples, Pinouts, and Specs

Image of MQ-5
Cirkit Designer LogoDesign with MQ-5 in Cirkit Designer

Introduction

The MQ-5 is a versatile gas sensor designed to detect various gases, including natural gas, liquefied petroleum gas (LPG), and other combustible gases. It operates on the principle of resistive change, where the sensor's resistance varies in the presence of target gases. This change is converted into an analog output, making it easy to interface with microcontrollers and other electronic systems.

Explore Projects Built with MQ-5

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO and A9G GSM/GPRS GPS-Based Air Quality Monitoring System
Image of A9G Smoke Sensor: A project utilizing MQ-5 in a practical application
This circuit features an Arduino UNO microcontroller interfaced with an A9G GSM/GPRS+GPS module and an MQ2 gas sensor. The Arduino communicates with the A9G module via digital pins D11 and D10 for data transmission, and it reads analog gas concentration levels from the MQ2 sensor through analog pin A5. Both the A9G module and the MQ2 sensor are powered by the Arduino's 5V output, and all components share a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Air Quality Monitoring and GSM Notification System
Image of Arduino wild: A project utilizing MQ-5 in a practical application
This circuit features an Arduino UNO microcontroller interfaced with an MQ135 air quality sensor, an MPU-6050 accelerometer/gyroscope, a SIM900A GSM communication module, and a buzzer. The Arduino reads analog data from the MQ135 sensor and communicates with the MPU-6050 via I2C, while also controlling the buzzer and handling serial communication with the SIM900A module. The purpose of this circuit is likely to monitor air quality and motion, provide alerts through the buzzer, and enable remote communication via GSM.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Gas Detection and GSM Notification System
Image of gsm home security system: A project utilizing MQ-5 in a practical application
This circuit features an Arduino UNO microcontroller interfaced with an MQ-5 gas sensor, a SIM900A GSM module, a green LED, a red LED, and a piezo buzzer. The MQ-5 sensor's analog output is connected to the Arduino's A5 pin for gas concentration measurement. The Arduino controls the LEDs and buzzer, and communicates with the SIM900A module for potential SMS notifications or calls in response to gas detection.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Based Air Quality Monitoring System with Bluetooth Connectivity
Image of Air quality part 2: A project utilizing MQ-5 in a practical application
This circuit is an air quality monitoring system that uses an Arduino UNO to collect data from a PM2.5 air quality sensor (PMS5003) and an ozone sensor (MQ131). The collected data is then transmitted via an HC-05 Bluetooth module for remote monitoring, with a rocker switch used to control the power supply.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MQ-5

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of A9G Smoke Sensor: A project utilizing MQ-5 in a practical application
Arduino UNO and A9G GSM/GPRS GPS-Based Air Quality Monitoring System
This circuit features an Arduino UNO microcontroller interfaced with an A9G GSM/GPRS+GPS module and an MQ2 gas sensor. The Arduino communicates with the A9G module via digital pins D11 and D10 for data transmission, and it reads analog gas concentration levels from the MQ2 sensor through analog pin A5. Both the A9G module and the MQ2 sensor are powered by the Arduino's 5V output, and all components share a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Arduino wild: A project utilizing MQ-5 in a practical application
Arduino UNO Based Air Quality Monitoring and GSM Notification System
This circuit features an Arduino UNO microcontroller interfaced with an MQ135 air quality sensor, an MPU-6050 accelerometer/gyroscope, a SIM900A GSM communication module, and a buzzer. The Arduino reads analog data from the MQ135 sensor and communicates with the MPU-6050 via I2C, while also controlling the buzzer and handling serial communication with the SIM900A module. The purpose of this circuit is likely to monitor air quality and motion, provide alerts through the buzzer, and enable remote communication via GSM.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of gsm home security system: A project utilizing MQ-5 in a practical application
Arduino UNO Based Gas Detection and GSM Notification System
This circuit features an Arduino UNO microcontroller interfaced with an MQ-5 gas sensor, a SIM900A GSM module, a green LED, a red LED, and a piezo buzzer. The MQ-5 sensor's analog output is connected to the Arduino's A5 pin for gas concentration measurement. The Arduino controls the LEDs and buzzer, and communicates with the SIM900A module for potential SMS notifications or calls in response to gas detection.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Air quality part 2: A project utilizing MQ-5 in a practical application
Arduino-Based Air Quality Monitoring System with Bluetooth Connectivity
This circuit is an air quality monitoring system that uses an Arduino UNO to collect data from a PM2.5 air quality sensor (PMS5003) and an ozone sensor (MQ131). The collected data is then transmitted via an HC-05 Bluetooth module for remote monitoring, with a rocker switch used to control the power supply.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Gas leak detection in homes and industries
  • Safety systems for detecting combustible gases
  • Air quality monitoring
  • IoT-based gas monitoring systems
  • Automotive applications for gas detection

Technical Specifications

The MQ-5 sensor is designed for ease of use and reliable performance. Below are its key technical details:

Parameter Value
Operating Voltage 5V DC
Load Resistance (RL) Adjustable (typically 10 kΩ)
Heater Resistance (RH) 31 Ω ± 3 Ω
Heating Voltage (VH) 5V ± 0.2V
Sensing Range 200 ppm to 10,000 ppm
Preheat Time ≥ 24 hours for stable operation
Output Signal Analog voltage
Operating Temperature -10°C to 50°C
Humidity Range ≤ 95% RH
Power Consumption ≤ 800 mW

Pin Configuration and Descriptions

The MQ-5 sensor typically comes in a module form with the following pinout:

Pin Name Description
1 VCC Power supply pin (5V DC)
2 GND Ground pin
3 AOUT Analog output pin, provides a voltage proportional to the gas concentration
4 DOUT Digital output pin, triggers when gas concentration exceeds a preset threshold

Note: The digital output (DOUT) is available only on MQ-5 modules with an onboard comparator circuit.

Usage Instructions

How to Use the MQ-5 in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 5V DC power supply and the GND pin to ground.
  2. Connect the Output:
    • For analog readings, connect the AOUT pin to an analog input pin of your microcontroller.
    • For digital readings, connect the DOUT pin to a digital input pin. Adjust the onboard potentiometer to set the threshold level.
  3. Preheat the Sensor: Allow the sensor to preheat for at least 24 hours for optimal accuracy.
  4. Read the Output:
    • The analog output voltage (AOUT) increases with the concentration of the target gas.
    • The digital output (DOUT) goes HIGH when the gas concentration exceeds the preset threshold.

Important Considerations and Best Practices

  • Preheating: The sensor requires a preheating period of at least 24 hours for stable and accurate readings.
  • Ventilation: Ensure proper ventilation around the sensor to avoid saturation and false readings.
  • Calibration: Calibrate the sensor in a controlled environment with known gas concentrations for accurate measurements.
  • Avoid Contaminants: Keep the sensor away from water, oil, and other contaminants that may damage the sensing element.
  • Power Supply: Use a stable 5V power supply to avoid fluctuations in the sensor's output.

Example: Using MQ-5 with Arduino UNO

Below is an example of how to interface the MQ-5 sensor with an Arduino UNO to read analog gas concentration values:

// MQ-5 Gas Sensor Example with Arduino UNO
// Connect AOUT to Arduino A0, VCC to 5V, and GND to GND

const int gasSensorPin = A0; // Analog pin connected to MQ-5 AOUT

void setup() {
  Serial.begin(9600); // Initialize serial communication at 9600 baud
  Serial.println("MQ-5 Gas Sensor Test");
}

void loop() {
  int sensorValue = analogRead(gasSensorPin); // Read analog value from MQ-5
  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
}

Note: The analog readings from the MQ-5 sensor are not directly in ppm. To convert to ppm, you need to calibrate the sensor using known gas concentrations and derive a conversion formula.

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output or Incorrect Readings:

    • Cause: Insufficient preheating time.
    • Solution: Ensure the sensor is preheated for at least 24 hours before use.
  2. Fluctuating Analog Output:

    • Cause: Unstable power supply or environmental noise.
    • Solution: Use a regulated 5V power supply and ensure proper grounding.
  3. Digital Output Not Triggering:

    • Cause: Incorrect threshold setting on the potentiometer.
    • Solution: Adjust the potentiometer to set the desired gas concentration threshold.
  4. Sensor Not Responding to Gas:

    • Cause: Sensor contamination or damage.
    • Solution: Replace the sensor if it has been exposed to water, oil, or other contaminants.

FAQs

Q1: Can the MQ-5 detect gases other than natural gas and LPG?
A1: Yes, the MQ-5 can detect other combustible gases, but its sensitivity and accuracy may vary. Refer to the sensor's datasheet for detailed sensitivity characteristics.

Q2: How do I calibrate the MQ-5 sensor?
A2: Expose the sensor to a known concentration of gas and record the analog output. Use this data to derive a formula for converting the sensor's output to ppm.

Q3: Can I use the MQ-5 with a 3.3V microcontroller?
A3: 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?
A4: The sensor's lifespan depends on usage and environmental conditions. Under normal conditions, it can last several years.

By following this documentation, you can effectively use the MQ-5 gas sensor in your projects for reliable gas detection and monitoring.