Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use MQ-7 Gas Sensor: Examples, Pinouts, and Specs

Image of MQ-7 Gas SensorDesign with MQ-7 Gas Sensor in Cirkit Designer

Introduction

The MQ-7 Gas Sensor, manufactured by Flying Fish (Part ID: MQ-7), is a highly sensitive device designed to detect carbon monoxide (CO) concentrations in the air. It operates on the principle of resistive change in the presence of gas, providing an analog output proportional to the CO concentration. This sensor is widely used in air quality monitoring systems, safety devices, and industrial applications to ensure safe environments by detecting harmful CO levels.

Explore Projects Built with MQ-7 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 Arduino UNO Based Multi-Gas Detector: A project utilizing MQ-7 Gas Sensor in a practical application
Arduino UNO Based Multi-Gas Detector

This circuit is designed for environmental monitoring, featuring an Arduino UNO microcontroller interfaced with three different gas sensors: MQ-7 for carbon monoxide (CO) detection, MQ131 for ozone (O3) measurement, and MQ-135 for general air quality assessment. The sensors are powered by the Arduino's 5V output and their analog signals are read through the Arduino's analog input pins A0, A1, and A2 respectively. The embedded code reads the analog values from the sensors and outputs the readings via the serial interface, allowing for real-time monitoring of the gases.

Open Project in Cirkit Designer
Image of Multi-Gas Detection System with Arduino and MQ Sensors: A project utilizing MQ-7 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.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

Key Technical Details

Parameter Value
Operating Voltage 5V DC
Load Resistance (RL) Adjustable (typically 10 kΩ)
Heating Voltage (VH) 5V DC (high) / 1.4V DC (low)
Heating Current < 180 mA (high) / < 35 mA (low)
Detection Range 20 ppm to 2000 ppm (CO)
Preheat Time ≥ 24 hours
Analog Output Voltage 0V to 5V (proportional to CO)
Sensitivity Detects CO with high accuracy
Operating Temperature -20°C to 50°C
Humidity Range 33% to 85% RH
Dimensions 32mm x 20mm x 22mm

Pin Configuration and Descriptions

The MQ-7 sensor module typically has four pins. Below is the pinout description:

Pin Name Description
VCC Power supply input (5V DC)
GND Ground connection
AOUT Analog output voltage (proportional to CO level)
DOUT Digital output (threshold-based signal)

Usage Instructions

How to Use the MQ-7 Gas Sensor in a Circuit

  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 UNO) to read the CO concentration as a voltage.
  3. Digital Output: Optionally, connect the DOUT pin to a digital input pin of a microcontroller. The digital output is HIGH or LOW based on the preset threshold.
  4. Load Resistor: Ensure the load resistor (RL) is properly configured. A typical value is 10 kΩ.
  5. Preheating: Allow the sensor to preheat for at least 24 hours before taking accurate measurements.
  6. Heating Cycle: The MQ-7 requires a heating cycle for accurate readings:
    • Apply 5V (high heating) for 60 seconds.
    • Apply 1.4V (low heating) for 90 seconds.
    • Repeat this cycle continuously during operation.

Important Considerations and Best Practices

Example Code for Arduino UNO

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

// MQ-7 Gas Sensor Example Code for Arduino UNO
// Reads analog output from the sensor and prints CO concentration to Serial Monitor

const int analogPin = A0; // Connect AOUT pin of MQ-7 to Arduino A0
int sensorValue = 0;      // Variable to store analog reading

void setup() {
  Serial.begin(9600); // Initialize serial communication at 9600 baud
  pinMode(analogPin, INPUT); // Set A0 as input
}

void loop() {
  sensorValue = analogRead(analogPin); // Read analog value from MQ-7
  float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage (0-5V)
  
  // Print the sensor value and voltage to 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 next reading
}

Notes on the Code

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output or Incorrect Readings:

    • Ensure the sensor is powered with the correct voltage (5V DC).
    • Verify the load resistor (RL) is properly connected and has the correct value.
    • Allow sufficient preheat time (≥ 24 hours) before taking measurements.
  2. Fluctuating or Unstable Readings:

    • Check for proper implementation of the heating cycle (high and low heating phases).
    • Ensure the sensor is not exposed to contaminants like alcohol or silicone vapors.
  3. Digital Output Always HIGH or LOW:

    • Adjust the onboard potentiometer to set the correct threshold for the digital output.
  4. Sensor Not Responding:

    • Verify all connections, especially the power supply and ground.
    • Check for physical damage to the sensor or module.

FAQs

Q1: Can the MQ-7 detect gases other than CO?
A1: The MQ-7 is specifically designed for carbon monoxide detection. While it may respond to other gases, its sensitivity and accuracy are optimized for CO.

Q2: How do I calibrate the MQ-7 sensor?
A2: Place the sensor in an environment with a known CO concentration and record the analog output. Use this data to create a calibration curve for mapping voltage to ppm.

Q3: Can I use the MQ-7 without the heating cycle?
A3: No, the heating cycle is essential for accurate CO detection. The sensor alternates between high and low heating phases to stabilize its readings.

Q4: What is the lifespan of the MQ-7 sensor?
A4: The typical lifespan of the MQ-7 sensor is around 2-3 years under normal operating conditions.