Description
Key Features
- Detects a range of gases, including harmful and flammable ones.
- Analog and digital output for interfacing with microcontrollers.
- Built-in potentiometer for sensitivity adjustment.
- Compact and low-cost module.
Specifications
- Operating Voltage: 3.3V–5V DC
- Operating Current: ~150 mA
- Detectable Gases: Ammonia (NH₃), nitrogen oxides (NOₓ), benzene, CO₂, alcohol, and smoke.
- Output Types:
- Analog Output: Proportional to gas concentration.
- Digital Output: HIGH/LOW signal based on the threshold set by the potentiometer.
- Preheat Time: ~20 seconds for stable readings.
- Operating Temperature: -10°C to 50°C
Pinout
- VCC: Power supply (3.3V or 5V)
- GND: Ground
- DO: Digital output
- AO: Analog output
Working Principle
The MQ135 sensor contains a SnO₂ (tin dioxide) sensing layer that has a low conductivity in clean air. When exposed to certain gases, the conductivity increases, and this change is used to measure gas concentration.
Interfacing with Arduino
Hardware Setup
- Connect VCC to the Arduino’s 5V pin.
- Connect GND to the Arduino’s GND pin.
- Connect AO (Analog Output) to an analog input pin (e.g., A0).
- (Optional) Connect DO (Digital Output) to a digital input pin for threshold detection.
Sample Code
const int analogPin = A0; // Analog output pin const int digitalPin = 2; // Digital output pin int analogValue = 0; void setup() { Serial.begin(9600); pinMode(digitalPin, INPUT); } void loop() { // Read analog value analogValue = analogRead(analogPin); // Print analog value (gas concentration) Serial.print("Analog Value: "); Serial.println(analogValue); // Check digital output if (digitalRead(digitalPin) == HIGH) { Serial.println("Gas concentration exceeded threshold!"); } delay(1000); }
Calibrating the Sensor
- Allow the sensor to preheat for at least 24 hours before precise calibration.
- Use the built-in potentiometer to adjust the digital threshold value.
- For accurate measurements, compare the analog output with a reference gas analyzer or known concentrations.
Applications
- Indoor air quality monitoring
- Smart homes and IoT systems
- Industrial gas detection
- Pollution monitoring
- Fire and smoke detection
Reviews
There are no reviews yet.