Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Arduino Smoke Level Detector using MQ-135 Sensor with Alarm
Arduino Projects

Arduino Smoke Level Detector using MQ-135 Sensor with Alarm

Mamtaz AlamBy Mamtaz AlamUpdated:August 22, 20228 Comments3 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Smoke Detector Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Introduction

In this project, we have designed Arduino Smoke Level Detector using MQ-135 Sensor for measuring the level of smoke in the environment. Simply we have interfaced MQ-135 Gas Sensor module with Arduino and 16*2 LCD module for display. The Smoke sensor we used is the MQ-135 sensor. Smoke Detectors are very useful in detecting smoke or fire in buildings, and so are the important safety parameters.

Smoke Detector Circuit which not only senses the smoke in the air but also reads and displays the level of Smoke in the Air. This circuit triggers the Buzzer when Smoke level becomes higher than the desirable limit, this threshold value can be changed in the Code according to the requirement. Instead of MQ-135, you can use MQ2, MQ3, MQ5 module as well. Basically they all have similar functions.




Bill of Materials

For Arduino Smoke Level Detector using MQ-135 Sensor with Alert Alarm we need the following components:

S.N.Components NameQuantityPurchase Links
1Arduino UNO Board1Amazon | AliExpress
316x2 LCD Display1Amazon | AliExpress
4Potentiometer 10K1Amazon | AliExpress
5MQ-135 Air Quality Sensor1Amazon | AliExpress
7Buzzer 5V1Amazon | AliExpress
8LED 5mm Any Color2Amazon | AliExpress
9Connecting Wires10-20Amazon | AliExpress
10Breadboard1Amazon | AliExpress


Arduino Smoke Level Detector using MQ-135 Sensor

Now after managing this component do this following connection for designing Arduino Smoke Level Detector using MQ-135 Sensor.

LCD Pins 1, 3 ,5 ,16 ——— GND
LCD Pins 2, 16 ————— VCC (+5V)
LCD Pin 4 ——————– Arduino pin D7
LCD Pin 6 ——————– Arduino pin D6
LCD Pin 11 ——————- Arduino pin D5
LCD Pin 12 ——————- Arduino pin D4
LCD Pin 13 ——————- Arduino pin D3
LCD Pin 14 ——————- Arduino pin D2
MQ-135 Module Pin -GND —— GND
MQ-135 Module Pin +VCC —— VCC
MQ-135 Module Pin A0 — Arduino Pin A0
LED1 Pin +ve end ————- Arduino PinD10
LED1 Pin -ve end ————-GND

LED2 Pin +ve end ————- Arduino PinD12
LED2 Pin -ve end ————-GND

Buzzer Pin +ve end ————- Arduino PinD8
Buzzer Pin -ve end ————-GND

A connection diagram is given below as well. Simply assemble the circuit as this.

Arduino Smoke Level Detector using MQ-135 Sensor


MQ-135 Smoke Sensor Module

Introduction

Alcohol Level Meter using Arduino & MQ-135 Alcohol/Gas Sensor

MQ-135 Module sensor has lower conductivity in clean air. When the target combustible gas exists, the sensor’s conductivity is higher along with the gas concentration rising. Convert change of conductivity to correspond output signal of gas concentration. MQ135 gas sensor has high sensitivity to Ammonia, Sulphide and Benzene steam, also sensitive to smoke and other harmful gases. It is with low cost and suitable for different applications such as harmful gases/smoke detection.

Features

  1. Wide detecting scope
  2. Fast response and High sensitivity
  3. Stable and long life Simple drive circuit
  4. Used in air quality control equipment for buildings/offices, is suitable for detecting of NH3, NOx, alcohol, Benzene, smoke, CO2, etc.
  5. Size: 35mm x 22mm x 23mm (length x width x height)
  6. Working voltage: DC 5 V
  7. Signal output instruction.
  8. Dual signal output (analog output, and high/low digital output)
  9. ~ 4.2V analog output voltage, the higher the concentration the higher the voltage.

Working Mechanism

The MQ-135 smoke sensor consists of a tin dioxide (SnO2), a perspective layer inside aluminum oxide microtubes (measuring electrodes) and a heating element inside a tubular casing. The end face of the sensor is enclosed by a stainless steel net and the backside holds the connection terminals. Smoke is emitted from the source by burning anything. With the smoke cascade on the tin dioxide sensing layer, the resistance decreases. By using the external load resistance the resistance variation is converted into a suitable voltage variation.



Arduino Source Code

So here is a source code for designing Arduino Smoke Level Detector using MQ-135 Sensor. Simply copy the code and upload it to your Arduino board using Arduino IDE.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
 
int redLed = 10;
int greenLed = 12;
int buzzer = 8;
int smokeA0 = A0;
// Your threshold value
int sensorThres = 100;
 
void setup() {
  pinMode(redLed, OUTPUT);
  pinMode(buzzer, OUTPUT);
  pinMode(smokeA0, INPUT);
  Serial.begin(9600);
  lcd.begin(16,2);
}
 
void loop() {
  int analogSensor = analogRead(smokeA0);
 
  Serial.print("Pin A0: ");
  Serial.println(analogSensor);
  lcd.print("Smoke Level:");
  lcd.print(analogSensor-50);
  // Checks if it has reached the threshold value
  if (analogSensor-50 > sensorThres)
  {
    digitalWrite(redLed, HIGH);
    lcd.setCursor(0, 2);
    lcd.print("Alert....!!!");
    digitalWrite(12, LOW);
    tone(buzzer, 1000, 200);
  }
  else
  {
    digitalWrite(redLed, LOW);
    digitalWrite(12, HIGH);
    lcd.setCursor(0, 2);
    lcd.print(".....Normal.....");
    noTone(buzzer);
  }
  delay(500);
  lcd.clear();
}


Video Preview & Explanation

Smoke Level Detector with Alarm using Arduino & MQ-2/MQ-5/MQ-135 Sensor
Watch this video on YouTube.

For similar other Arduino projects, you may visit Arduino Projects.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleBlind Walking Stick Using Arduino & Ultrasonic Sensor HC-SR04
Next Article Lithium-Ion Battery Charger Circuit using MCP73831

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 8 Comments

8 Comments

  1. Abhijit Kumar Gupta on February 25, 2019 10:30 PM

    why -50

    Reply
    • Alex Newton on February 25, 2019 11:08 PM

      for calibration

      Reply
  2. sravya on December 6, 2019 10:53 AM

    I interfaced aurdino with mq135 sensor, I got the output displaying in serial monitor.I Want to push these values to p10 led board using Arduino throw hub12 port How is it possible…?

    Reply
  3. Rahul on August 30, 2020 5:17 PM

    Sir project related PDF file send kar di jiye

    Reply
  4. Filrrp on January 23, 2021 7:11 AM

    Sir. How to connect display .
    Please send reply throughly

    Reply
  5. Satis on April 14, 2021 1:16 PM

    Pls give the flowchart for this project

    Reply
  6. Desandu on September 1, 2021 7:38 PM

    Hey there what is the programme if we don’t use the LED panel
    please answer fast becuase I am getting grade for this

    Reply
  7. Aayan on April 6, 2023 10:18 AM

    the code i put in is giving me the error of [object, Object] do you know how to fix that problem and i used the code given above.

    Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 21, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • Half Wave Rectifier Basics, Circuit, Working & Applications
    Half Wave Rectifier Basics, Circuit, Working & Applications
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.