Smoke Gas Sensor

Z2M Parts: EMS-00010-A to G, EDT-00001-A to G

Detect smoke or gas with MQ-series sensor.

Circuit Diagram
Circuit diagram for Smoke Gas Sensor
Wire Connections & Pin Configuration

Wire Color Connections:

Yellow → A5 to sensor A0, Pin 12 to LED
Red → 5V to sensor VCC
Black → GND to sensor, LED cathode

Pin Configuration:

Arduino Analog Pin A5 → Smoke/gas sensor A0 output
Arduino Digital Pin 12 → LED anode (via 220Ω resistor)
Arduino 5V → Smoke/gas sensor VCC
Arduino GND → Smoke/gas sensor GND, LED cathode
Arduino Code
Edit
#define led 12       // Connect LED to pin 12
#define smoke A5     // Connect sensor analog output to A5

int threshold = 400; // Threshold for smoke detection

void setup() {
  pinMode(led, OUTPUT);   // Set LED as output
  pinMode(smoke, INPUT);  // Set smoke sensor as input
  Serial.begin(9600);     // Start serial communication
}

void loop() {
  int value = analogRead(smoke);  // Read sensor value
  Serial.println(value);          // Print sensor reading to Serial Monitor

  // Check if smoke level exceeds threshold
  if (value > threshold) {
    digitalWrite(led, HIGH);      // Turn LED ON (smoke detected)
  } else {
    digitalWrite(led, LOW);       // Turn LED OFF (no smoke)
  }

  delay(1000); // Wait 1 second before next reading
}

Instruction Details

Wiring: Connect smoke/gas sensor VCC to 5V, GND to GND, A0 to Analog Pin A5. Connect LED anode to Digital Pin 12 via 220Ω, cathode to GND.
Library: Not required (built-in).
Upload Code: Tools → Board → Arduino Uno. Tools → Port → select your COM port. Click Upload button.
View Output: Open Serial Monitor at 9600 baud. LED turns ON when smoke detected. Heat sensor 24–48 hours before first use.

How to Use

  1. Connect the required components as per the Pin Configuration above
  2. Open Arduino IDE and create a new sketch
  3. Copy and paste the code above
  4. Select your Arduino board and COM port from Tools menu
  5. Click the Upload button to upload the code to your Arduino
  6. Open Serial Monitor (if applicable) to see the output

Components Required

  • Arduino Uno
  • MQ-2 or MQ-5 Gas/Smoke Sensor Module
  • LED
  • 220Ω Resistor
  • Breadboard
  • Jumper Wires

Category: Sensors