Rectronx Circuits
Components

MQ135 Air Quality Sensor

Low-cost gas sensor for relative air quality and smoke-style FYP demos.

Environmental Gas Sensor4.8/5RM6-RM15Intermediate
ArduinoESP32STM32Raspberry Pi with ADC
MQ135 gas sensor module with blue PCB and metal mesh sensor can

AI Ready Overview

Quick Summary

MQ135 is a environmental gas sensor commonly used in FYP and embedded projects. It is best for relative air quality trend and smoke detection demos, with wiring and testing planned around Arduino, ESP32, STM32.

Difficulty

Intermediate

Time Required

1-2 weeks for wiring, basic code, platform integration and repeated test readings

Cost

RM6-RM15 module range in Malaysia; full project cost depends on scope.

Components

MQ135, Arduino, ESP32, STM32

Overview

What is MQ135?

MQ135 is a popular gas sensor module used in air quality projects. It can react to gases such as ammonia, alcohol, benzene and smoke, but it is best used for relative trend detection rather than accurate certified PPM measurement.

Engineering Reference

Quick Specs

Operating Voltage5V
OutputAnalog and digital threshold
DetectsNH3, alcohol, benzene, smoke and air quality changes
InterfaceAnalog
Warm-up TimeUp to 24 hours for stable readings
PowerAround 150mA heater current

Real Usage Notes

Suitable / Not Suitable

Suitable for

  • Relative air quality trend
  • Smoke detection demos
  • Educational IoT air monitoring
  • Classroom or greenhouse prototypes

Not suitable for

  • Accurate CO2 measurement
  • Certified gas safety systems
  • Medical or industrial compliance monitoring

Build Planning

Difficulty

MQ135 is rated Intermediate. Plan around 1-2 weeks for wiring, basic code, platform integration and repeated test readingsdepending on wiring, libraries, calibration, dashboard/app integration and testing evidence.

Build Planning

Time Required

1-2 weeks for wiring, basic code, platform integration and repeated test readings

Malaysia Price Guidance

Cost

Typical module price range: RM6-RM15. This is component guidance only; a complete FYP cost depends on controller, sensors, casing, display, app/dashboard, documentation and timeline.

Connections

Pinout

VCC

5V supply for the sensor heater and module.

GND

Ground connection.

A0

Analog output for reading gas concentration trend.

D0

Digital threshold output adjusted by onboard potentiometer.

Platform Notes

Wiring Guides

MQ135 with Arduino

Arduino Uno can read the MQ135 analog output directly on A0.

MQ135 VCCArduino 5V
MQ135 GNDArduino GND
MQ135 A0Arduino A0

Example code

void setup() {
  Serial.begin(9600);
}

void loop() {
  int reading = analogRead(A0);
  Serial.println(reading);
  delay(1000);
}

MQ135 with ESP32

Use a divider or module output check if the analog signal may reach 5V. ESP32 ADC pins are not 5V tolerant.

MQ135 VCC5V
MQ135 GNDESP32 GND
MQ135 A0ESP32 GPIO34 through safe scaling

Example code

void setup() {
  Serial.begin(115200);
}

void loop() {
  int reading = analogRead(34);
  Serial.println(reading);
  delay(1000);
}

Fix Common Problems

Troubleshooting

Check wiring against the pinout before debugging code.
Use a stable power supply and common ground between modules.
Test the component with a simple example sketch before adding dashboard, app or database features.
Allow warm-up time and treat low-cost gas readings as relative detection, not laboratory ppm accuracy.

Troubleshooting

Common Mistakes

No warm-up time before taking readings
Expecting accurate PPM without calibration
Connecting 5V analog output directly to ESP32 ADC
Ignoring indoor airflow and sensor placement

FYP Ideas Using MQ135

Related Projects

Compare Options

Alternative Components

Student Questions

FAQ

Can MQ135 measure CO2 accurately?

MQ135 is not recommended for accurate CO2 measurement. It is better for relative air quality changes and educational demos.

Can MQ135 work with ESP32?

Yes, but protect the ESP32 ADC from 5V analog signals by using proper scaling or a safe module output.