DEV Community

Cover image for Low-Cost Air Quality Monitor with Arduino and MQ135 for STEM Education
Enviro Education Tools
Enviro Education Tools

Posted on Edited on

Low-Cost Air Quality Monitor with Arduino and MQ135 for STEM Education

At Enviro Education Tools, we document low-cost environmental monitoring tools for STEM education.

This article describes a basic air quality monitor concept using Arduino and MQ135 for classroom understanding β€” presented as a qualitative educational experiment, not a certified monitor.

What the MQ135 can and cannot tell us

The MQ135 is a broad metal-oxide sensor sensitive to NH3, NOx, alcohol, benzene, smoke, and CO2.

Important: The raw analog value is not a calibrated PPM or Air Quality Index.

  • Cross-sensitivity: It responds to multiple gases at once. You cannot reliably isolate CO2 without laboratory calibration and compensation.
  • Environmental dependence: Temperature and humidity affect sensor resistance. Readings shift without correction.
  • Qualitative use: In STEM education, use it to discuss relative changes (e.g., window open vs closed) rather than absolute air-quality scores.

Hardware concept

  • Arduino Uno R3
  • MQ135 module (AOUT to A0)
  • Breadboard, jumper wires, USB cable

This article is a project guide and documentation β€” no hardware demonstration is claimed here.

Wiring concept

MQ135 VCC -> Arduino 5V
MQ135 GND -> Arduino GND

MQ135 AOUT -> Arduino A0

Note: Ensure stable 5V supply β€” unstable USB hubs affect analog readings.

Sensor conditioning vs warm-up

Per Winsen MQ135 datasheet:

  • Initial conditioning: When new, power the sensor for over 48 hours in clean air for initial stabilization. This is a one-time burn-in.
  • Pre-heat before readings: After initial conditioning, allow 20-30 minutes warm-up at each power-on before taking comparative readings.

Full sketch (reproducible)

This sketch is provided in the repository at examples/arduino/air_quality_demo/air_quality_demo.ino.
It logs raw ADC and estimated voltage. Voltage calculation assumes nominal 5.0V ADC reference.

const int SENSOR_PIN = A0;
const float ADC_REF = 5.0;

void setup() {
  Serial.begin(9600);
  delay(1000);
  Serial.println("MQ135 Concept - Raw reading and voltage");
  Serial.println("Allow 20-30 min warm-up after initial 48h conditioning");
  Serial.println("Raw, Voltage(V)");
}

void loop() {
  int sensorValue = analogRead(SENSOR_PIN);
  float voltage = sensorValue * (ADC_REF / 1023.0);
  Serial.print(sensorValue);
  Serial.print(", ");
  Serial.println(voltage, 3);
  delay(2000);
}
Enter fullscreen mode Exit fullscreen mode

Expected serial output at 9600 baud:

245, 1.197
247, 1.207
Enter fullscreen mode Exit fullscreen mode

Setup steps

  1. Wire as above, upload via Arduino IDE
  2. Open Serial Monitor at 9600 baud
  3. Allow 20-30 min warm-up after initial 48h conditioning
  4. Log relative changes for classroom discussion, not as official AQI ```

Resources


What do you think about using low-cost sensors for STEM? Drop a comment below πŸ‘‡

Top comments (0)