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

How to Use MQ-4: Examples, Pinouts, and Specs

Image of MQ-4
Cirkit Designer LogoDesign with MQ-4 in Cirkit Designer

Introduction

The MQ-4 is a highly sensitive gas sensor module designed to detect methane (CH4), natural gas, and other combustible gases in the air. It is widely used in gas leakage detecting equipment for homes and industries. Its fast response time and high sensitivity make it an ideal choice for safety systems in gas line monitoring, methane gas detection systems, and DIY projects that require gas monitoring capabilities.

Explore Projects Built with MQ-4

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-4 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 and MQ-4 Gas Sensor Interface
Image of MQ4 Connections: A project utilizing MQ-4 in a practical application
This circuit is designed to interface an Arduino UNO with an MQ-4 gas sensor for the detection and measurement of gas concentrations. The Arduino provides power to the sensor and reads its analog output for processing. The embedded code for the Arduino is currently a template without specific functionality implemented.
Cirkit Designer LogoOpen Project in Cirkit Designer
Multi-Gas Detection System with Arduino and MQ Sensors
Image of Centrala calitate aer: A project utilizing MQ-4 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-Based Air Quality Monitoring System with Multiple Gas Sensors and GSM Module
Image of AIRMS: A project utilizing MQ-4 in a practical application
This circuit is an air quality monitoring system that uses an Arduino UNO to read data from various sensors, including the MQ-7 for CO detection, MQ131 for ozone detection, MQ-135 for general air quality, and a DHT11 for temperature and humidity. The Arduino processes the sensor data and can communicate the results via a SIM800L module for remote monitoring.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MQ-4

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-4 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 MQ4 Connections: A project utilizing MQ-4 in a practical application
Arduino UNO and MQ-4 Gas Sensor Interface
This circuit is designed to interface an Arduino UNO with an MQ-4 gas sensor for the detection and measurement of gas concentrations. The Arduino provides power to the sensor and reads its analog output for processing. The embedded code for the Arduino is currently a template without specific functionality implemented.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Centrala calitate aer: A project utilizing MQ-4 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 AIRMS: A project utilizing MQ-4 in a practical application
Arduino-Based Air Quality Monitoring System with Multiple Gas Sensors and GSM Module
This circuit is an air quality monitoring system that uses an Arduino UNO to read data from various sensors, including the MQ-7 for CO detection, MQ131 for ozone detection, MQ-135 for general air quality, and a DHT11 for temperature and humidity. The Arduino processes the sensor data and can communicate the results via a SIM800L module for remote monitoring.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Technical Details

  • Sensor Type: Semiconductor
  • Detection Gas: Methane, CNG Gas
  • Concentration Range: 200 to 10,000 ppm (parts per million)
  • Preheat Duration: 20 seconds
  • High Sensitivity and Selectivity to Methane
  • Supply Voltage: 5V ±0.1
  • Heating Voltage: 5V ±0.1
  • Load Resistance: Adjustable
  • Heating Current: ≤180mA
  • Heating Power: ≤900mW
  • Operating Temperature: -10°C to 50°C

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 VCC Power supply (5V)
2 GND Ground
3 DO Digital output (TTL)
4 AO Analog output (Variable voltage)

Usage Instructions

Integration with a Circuit

  1. Power Supply: Connect the VCC pin to a 5V power supply and the GND pin to the ground.
  2. Output Reading: The AO pin provides an analog output voltage that is proportional to the concentration of gas. Connect this to an analog input on your microcontroller.
  3. Digital Output: The DO pin can be connected to a digital input on your microcontroller. It outputs a high (1) or low (0) signal when the gas concentration reaches a certain threshold, which can be adjusted using the onboard potentiometer.

Best Practices

  • Ensure that the sensor is preheated for at least 20 seconds before taking measurements.
  • Avoid exposure to high concentrations of alcohol, smoke, and other volatile organic compounds that can affect sensor performance.
  • Calibrate the sensor for the specific environment where it will be used.
  • Use the sensor in well-ventilated areas to prevent saturation.

Example Code for Arduino UNO

// MQ-4 Gas Sensor with Arduino UNO
int analogPin = A0; // Analog output of MQ-4 connected here
int digitalPin = 2; // Digital output of MQ-4 connected here
int ledPin = 13;    // LED connected to digital pin 13

void setup() {
  pinMode(ledPin, OUTPUT);      // Set the LED pin as output
  pinMode(digitalPin, INPUT);   // Set the digital pin as input
  Serial.begin(9600);           // Start serial communication at 9600 baud
}

void loop() {
  int analogValue = analogRead(analogPin); // Read the analog value from sensor
  int digitalValue = digitalRead(digitalPin); // Read the digital value from sensor

  // Print the analog value to the serial monitor
  Serial.print("Analog Value: ");
  Serial.println(analogValue);

  // Check the digital output and turn on/off the LED
  if (digitalValue == HIGH) {
    digitalWrite(ledPin, HIGH); // Turn on the LED if gas is detected
  } else {
    digitalWrite(ledPin, LOW);  // Turn off the LED if no gas is detected
  }

  delay(100); // Wait for 100 milliseconds
}

Troubleshooting and FAQs

Common Issues

  • Sensor Not Responding: Ensure that the sensor is correctly powered and preheated.
  • Inaccurate Readings: Calibrate the sensor and check for any interference from other chemicals.
  • No Digital Output: Adjust the onboard potentiometer to set the threshold level.

FAQs

Q: How long does the MQ-4 sensor last? A: The lifespan of the MQ-4 sensor can vary based on usage, but typically it can last for several years with proper calibration and maintenance.

Q: Can the MQ-4 sensor detect gases other than methane? A: While the MQ-4 is optimized for methane detection, it may also respond to other combustible gases, albeit with less sensitivity.

Q: Is the MQ-4 sensor suitable for outdoor use? A: The MQ-4 can be used outdoors but should be protected from extreme weather conditions and water exposure to ensure accurate readings.

For further assistance, please refer to the manufacturer's datasheet or contact technical support.