一、元件介紹
感測:空氣品質
感測原理:mq135.pdf

| Arduino UNO | MQ-135 元件 |
| A0 | A0 |
| 不接 | D0 |
| GND | GND |
| 5V | VCC |
二、接線範例

三、程式範例
Arduino程式庫下載:https://github.com/GeorgK/MQ135
本地下載:MQ-135程式庫
程式範例:https://github.com/ckalpha/MQ135-Arduino-Sensor/blob/master/MQ135/MQ135.ino
/*
Library Repository : https://github.com/ckalpha/MQ135
Author : Damrongwit Nusuk
Email : jack@racksync.com
Website : http://www.racksync.com
*/
#include "MQ135.h"
#define ANALOGPIN A0 // Define Analog PIN on Arduino Board
#define RZERO 206.85 // Define RZERO Calibration Value
MQ135 gasSensor = MQ135(ANALOGPIN);
void setup()
{
Serial.begin(9600);
float rzero = gasSensor.getRZero();
delay(3000);
Serial.print("MQ135 RZERO Calibration Value : ");
Serial.println(rzero);
}
void loop() {
float ppm = gasSensor.getPPM();
delay(1000);
digitalWrite(13,HIGH);
Serial.print("CO2 ppm value : ");
Serial.println(ppm);
}