MQ135 Air Quality Sensor
Low-cost gas sensor for relative air quality and smoke-style FYP demos.
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 Voltage | 5V |
|---|---|
| Output | Analog and digital threshold |
| Detects | NH3, alcohol, benzene, smoke and air quality changes |
| Interface | Analog |
| Warm-up Time | Up to 24 hours for stable readings |
| Power | Around 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 VCC | Arduino 5V |
|---|---|
| MQ135 GND | Arduino GND |
| MQ135 A0 | Arduino 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 VCC | 5V |
|---|---|
| MQ135 GND | ESP32 GND |
| MQ135 A0 | ESP32 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
Troubleshooting
Common Mistakes
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.
