Interfacing MQ135 Sensor with Arduino

Basic Circuit

Instructions

Objective:

Learn to use the MQ135 air quality sensor to detect harmful gases (CO2, ammonia, benzene, smoke) and display air quality levels with visual indicators (RGB LED) and audio alerts (buzzer).

Steps to Perform:

  1. Click 'Start Simulation' to power the circuit
  2. Click 'Add Smoke' to introduce pollutants
  3. Use the slider to increase Smoke Intensity
  4. Watch the Buzzer Warning indicator near the slider
  5. Once level crosses 66%, the Buzzer will start beeping
  6. Click 'Stop Simulation' to reset the circuit

Key Concepts:

  • MQ135 Sensor: Connected to Analog Pin A1. It detects smoke and gases.
  • Buzzer: Connected to Digital Pin 10. Triggers when pollution is dangerous.
  • Threshold Alert: Code monitors sensor and triggers alarm at > 66%.

Arduino Code