Arduino Uno with MQ-5 Gas Sensor Module: Monitoring Gas Concentrations



, ,


The MQ-5 gas sensor module is a versatile component that enables the detection and measurement of various gases in the environment. In this guide, we will explore how to use the MQ-5 sensor module with an Arduino Uno to monitor gas concentrations.


image of mq5 sensor along with arduino uno, complete circuit diagram

The MQ-5 gas sensor operates based on the principle of resistance change in response to the presence of different gases. It consists of a gas-sensitive material whose resistance changes when exposed to specific gases. By measuring this resistance, we can determine the type and concentration of gases in the surroundings.

Components Required

To get started, gather the following components:

  1. Arduino Uno
  2. MQ-5 Gas Sensor Module
  3. Jumper Wires
  4. Breadboard (optional)


Connect the MQ-5 sensor module to the Arduino Uno as follows:

  1. Connect the module’s VCC pin to the 5V pin on the Arduino.
  2. Connect the module’s GND pin to any ground (GND) pin on the Arduino.
  3. Attach the module’s OUT pin to an analog pin on the Arduino, such as analog pin A0.


Here’s a basic Arduino code example to read gas concentrations from the MQ-5 module and display them in the Serial Monitor:

const int mq5Pin = A0; // Define the analog pin connected to the MQ-5 module

void setup() {



void loop() {

  int sensorValue = analogRead(mq5Pin); // Read the analog value from the MQ-5 module

  float voltage = (sensorValue / 1024.0) * 5.0; // Convert the analog value to voltage

  Serial.print("Voltage: ");


  Serial.print("V | ");

  Serial.print("Gas Concentration: ");

  if (voltage < 1.0) {

    Serial.println("High Concentration");

  } else {

    Serial.println("Low Concentration");


  delay(1000); // Delay for 1 second before the next reading



Integrating the MQ-5 gas sensor module with an Arduino Uno provides a powerful tool for gas concentration monitoring. Whether you are concerned about air quality, gas leaks, or safety applications, the MQ-5 module offers reliable gas sensing capabilities.


  1. What gases can the MQ-5 sensor module detect?
  • The MQ-5 module is sensitive to a range of gases, including natural gas (methane), liquefied petroleum gas (LPG), hydrogen, and various combustible gases.
  1. Can the MQ-5 sensor be used for industrial applications?
  • While the MQ-5 module is suitable for many applications, it may require calibration and validation for precise industrial use. Consult the sensor’s datasheet for specific details.

Troubleshooting Q&A

  1. I’m getting unstable readings from the MQ-5 sensor. What could be the issue?
  • Ensure that the sensor is adequately powered (5V) and that the connections are secure. Calibration and environmental factors can also impact stability.
  1. The MQ-5 sensor is not detecting gas. How do I troubleshoot this?
  • Confirm that the sensor is functioning correctly. Check for proper connections, and ensure that the gases you want to detect are present in the environment. Calibration may be necessary for accurate readings.

By following this guide, you can effectively utilize the MQ-5 gas sensor module with your Arduino Uno projects, enabling you to monitor gas concentrations and enhance safety or environmental monitoring applications. Whether you are an enthusiast or working on a specific project, the MQ-5 module is a valuable tool for gas sensing.

Leave a Reply

Your email address will not be published. Required fields are marked *

Explore our other blogs.

  • 8-bit vs. 32-bit Microcontrollers in Today’s Projects

  • Nintendo Sues Creators of Popular Switch Emulator Yuzu, Citing Piracy Concerns

  • Raspberry Pi CPU Temperature Range – Everything You Need to Know

  • image of tunnel

    Reverse Tunneling with Raspberry Pi: A Comprehensive Guide