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 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.

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

  • Gas leak detection in homes and industries
  • Safety monitoring in kitchens and gas storage facilities
  • Air quality monitoring systems
  • IoT-based environmental sensing projects
  • Integration with microcontrollers like Arduino for real-time gas monitoring

Technical Specifications

The MQ-5 sensor is designed for ease of use and integration into various systems. Below are its key technical details:

Key Specifications

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.)

Pin Configuration

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)

Usage Instructions

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:

Circuit Connection

  1. Power Supply: Connect the VCC pin to a 5V DC power source and the GND pin to ground.
  2. Analog Output: Connect the AOUT pin to an analog input pin of a microcontroller (e.g., Arduino) to read the gas concentration as a voltage.
  3. Digital Output: Optionally, connect the 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.

Important Considerations

  • Preheating: Allow the sensor to preheat for at least 24 hours before taking accurate readings. This ensures the internal heater stabilizes.
  • Calibration: For precise measurements, calibrate the sensor in a known gas concentration environment.
  • Ventilation: Ensure proper ventilation around the sensor to avoid saturation and ensure accurate readings.
  • Avoid Contaminants: Keep the sensor away from water, oil, and corrosive gases, as these can damage the sensing element.

Example Code for Arduino UNO

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
}

Notes on Code

  • The analog value (sensorValue) ranges from 0 to 1023, corresponding to 0-5V.
  • The voltage output can be used to estimate gas concentration based on the sensor's datasheet.

Troubleshooting and FAQs

Common Issues

  1. No Output Signal:

    • Cause: Incorrect wiring or insufficient power supply.
    • Solution: Double-check the connections and ensure a stable 5V power source.
  2. Inconsistent Readings:

    • Cause: Insufficient preheating time or environmental interference.
    • Solution: Allow the sensor to preheat for at least 24 hours and ensure proper ventilation.
  3. Digital Output Not Triggering:

    • Cause: Threshold not set correctly.
    • Solution: Adjust the potentiometer on the module to set the desired threshold.
  4. Sensor Damage:

    • Cause: Exposure to water, oil, or corrosive gases.
    • Solution: Replace the sensor and ensure it is used in a clean, dry environment.

FAQs

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.