Gas Leak Detection with MQ-7 Sensor

Gas Leak Detection with MQ-7 Sensor

Objective

This experiment uses the MQ-7 gas sensor to detect the presence of carbon monoxide (CO) gas.

Required Components

Working Principle

The MQ-7 sensor detects carbon monoxide by measuring changes in resistance in the presence of CO.

Circuit Diagram

MQ-7 Circuit Diagram

Arduino Code


/*
 * Gas Leak Detection with MQ-7
 * This code reads the carbon monoxide concentration from the MQ-7 sensor.
 */

const int mq7Pin = A0;  // MQ-7 sensor connected to analog pin A0
int sensorValue = 0;

void setup() {
  Serial.begin(9600);  // Initialize serial communication
}

void loop() {
  sensorValue = analogRead(mq7Pin);  // Read the sensor value
  Serial.print("CO Concentration: ");
  Serial.println(sensorValue);
  delay(1000);  // Wait for 1 second before the next reading
}
            

Results

The serial monitor will display the concentration of carbon monoxide detected by the sensor.

Applications

Conclusion

The MQ-7 gas sensor provides an effective way to detect carbon monoxide, making it useful in safety systems and air quality monitoring.