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

How to Use MQ5 Gas Sensor: Examples, Pinouts, and Specs

Image of MQ5 Gas Sensor
Cirkit Designer LogoDesign with MQ5 Gas Sensor in Cirkit Designer

Introduction

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.

Explore Projects Built with MQ5 Gas Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Multi-Gas Detection System with Arduino and MQ Sensors
Image of Centrala calitate aer: A project utilizing MQ5 Gas Sensor in a practical application
This circuit is designed to monitor various gases using a series of MQ gas sensors (MQ-2, MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-9, and MQ-135), each providing digital outputs to an Arduino UNO microcontroller. The Arduino is also connected to a piezo speaker for audible alerts and multiple LEDs with resistors, likely for visual status indicators. An Adafruit TCA9548A I2C multiplexer is included, suggesting the potential for I2C sensor expansion or managing multiple I2C devices.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Gas Detection and GSM Alert System
Image of Copy of Copy of gas sensor: A project utilizing MQ5 Gas Sensor in a practical application
This circuit is designed to monitor air quality using an MQ135 sensor and provide visual and audible alerts. It features an Arduino UNO microcontroller interfaced with a GSM module for communication, an I2C LCD for display, and LEDs and a buzzer for local alerts. The Arduino runs embedded code to read the MQ135 sensor data, display air quality index (AQI) on the LCD, and trigger SMS and call alerts via the GSM module when gas is detected above a certain threshold.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Gas Leak Detection System with LCD Display and Buzzer Alert
Image of alcohol detection and engine lock system...!: A project utilizing MQ5 Gas Sensor in a practical application
This circuit is a gas detection and alert system using an Arduino UNO, an MQ-5 gas sensor, a relay, a buzzer, and an LCD display. The MQ-5 sensor detects gas levels and sends analog data to the Arduino, which processes the data and activates the relay to control a motor and the buzzer for alerts. The LCD display shows the gas levels, providing real-time monitoring.
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 MQ5 Gas Sensor 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

Explore Projects Built with MQ5 Gas Sensor

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 Centrala calitate aer: A project utilizing MQ5 Gas Sensor in a practical application
Multi-Gas Detection System with Arduino and MQ Sensors
This circuit is designed to monitor various gases using a series of MQ gas sensors (MQ-2, MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-9, and MQ-135), each providing digital outputs to an Arduino UNO microcontroller. The Arduino is also connected to a piezo speaker for audible alerts and multiple LEDs with resistors, likely for visual status indicators. An Adafruit TCA9548A I2C multiplexer is included, suggesting the potential for I2C sensor expansion or managing multiple I2C devices.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of Copy of gas sensor: A project utilizing MQ5 Gas Sensor in a practical application
Arduino UNO Based Gas Detection and GSM Alert System
This circuit is designed to monitor air quality using an MQ135 sensor and provide visual and audible alerts. It features an Arduino UNO microcontroller interfaced with a GSM module for communication, an I2C LCD for display, and LEDs and a buzzer for local alerts. The Arduino runs embedded code to read the MQ135 sensor data, display air quality index (AQI) on the LCD, and trigger SMS and call alerts via the GSM module when gas is detected above a certain threshold.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of alcohol detection and engine lock system...!: A project utilizing MQ5 Gas Sensor in a practical application
Arduino UNO Gas Leak Detection System with LCD Display and Buzzer Alert
This circuit is a gas detection and alert system using an Arduino UNO, an MQ-5 gas sensor, a relay, a buzzer, and an LCD display. The MQ-5 sensor detects gas levels and sends analog data to the Arduino, which processes the data and activates the relay to control a motor and the buzzer for alerts. The LCD display shows the gas levels, providing real-time monitoring.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of gsm home security system: A project utilizing MQ5 Gas Sensor 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

Common Applications and Use Cases

  • Gas leak detection in homes and industries
  • Smoke detection in fire alarm systems
  • Environmental monitoring for air quality
  • IoT-based gas monitoring systems
  • Safety systems in kitchens and laboratories

Technical Specifications

The MQ5 Gas Sensor is designed for ease of use and integration into various systems. Below are its key technical details:

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

Pin Configuration and Descriptions

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)

Usage Instructions

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:

How to Use the Component in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 5V power source and the GND pin to ground.
  2. Read the Output:
    • Use the AOUT pin to read the analog signal, which varies with gas concentration.
    • Alternatively, use the DOUT pin for a digital signal. The threshold for the digital output can be adjusted using the onboard potentiometer.
  3. Connect to a Microcontroller: For example, connect the sensor to an Arduino UNO as follows:
    • VCC to Arduino 5V
    • GND to Arduino GND
    • AOUT to an analog input pin (e.g., A0)
    • Optionally, connect DOUT to a digital input pin for threshold-based detection.

Important Considerations and Best Practices

  • Preheat Time: Allow the sensor to preheat for at least 24 hours before taking stable readings.
  • Ventilation: Ensure proper ventilation around the sensor for accurate gas detection.
  • Calibration: Calibrate the sensor in a known gas concentration environment for precise measurements.
  • Avoid Contamination: Keep the sensor away from water, oil, and other contaminants that may affect its performance.
  • Power Supply: Use a stable 5V power source to avoid fluctuations in readings.

Example Code for Arduino UNO

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
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output or Incorrect Readings:

    • Cause: Insufficient preheat time.
    • Solution: Allow the sensor to preheat for at least 24 hours before use.
  2. Fluctuating Readings:

    • Cause: Unstable power supply or environmental interference.
    • Solution: Use a regulated 5V power source and ensure the sensor is placed in a stable environment.
  3. Digital Output Not Triggering:

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

    • Cause: Sensor contamination or damage.
    • Solution: Ensure the sensor is clean and free from contaminants. Replace if necessary.

FAQs

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.