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!
This circuit is a multi-gas sensor system that uses an Arduino Uno to read analog values from four different gas sensors (MQ-135, MQ-7, MQ-8, and MQ-9). The Arduino collects data from these sensors and prints the readings to the Serial Monitor for monitoring air quality.
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.
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.
This is a simple gas detection alarm system that uses an MQ-2 sensor to detect gas presence and sound a buzzer when gas is detected. It is powered by a rechargeable 18650 battery, with a TP4056 module for battery management and charging. A rocker switch is used to control the power to the system.
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
Power Supply: Connect the VCC pin to a 5V DC power source and the GND pin to ground.
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.
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.
Load Resistor: Ensure the load resistor (RL) is properly configured. A typical value is 10 kΩ.
Preheating: Allow the sensor to preheat for at least 24 hours before taking accurate measurements.
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
Preheat Time: The sensor requires a long preheat time (≥ 24 hours) for stable operation.
Heating Cycle: Implement the heating cycle in your circuit to ensure accurate CO detection.
Calibration: Calibrate the sensor in a known CO concentration environment for precise measurements.
Ventilation: Use the sensor in a well-ventilated area to avoid saturation or false readings.
Avoid Contaminants: Keep the sensor away from silicone vapors, alcohol, and other contaminants that may affect its performance.
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
The analog value (sensorValue) corresponds to the CO concentration. You can map this value to ppm using a calibration curve.
Ensure the heating cycle is implemented in hardware or software for accurate readings.
Troubleshooting and FAQs
Common Issues and Solutions
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.
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.
Digital Output Always HIGH or LOW:
Adjust the onboard potentiometer to set the correct threshold for the digital output.
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.