TPM-300 Air Quality Module (TPM-300) [S092]
https://www.youtube.com/watch?v=zHqDCyS7dPU
*GitHub : https://github.com/rdiot/rdiot-s092.git
* Specs
Module type: TPM-300
sensor: the air quality sensor
gas detection: ammonia, hydrogen, alcohol, carbon monoxide, methane, propane, Gan, styrene, propylene
glycol, alkyl phenol, toluene, ethylbenzene, xylene, formaldehyde and other volatile organic gases, incense smoke, wood, paper burning smoke
physical interface: XH2.54-4 vertical socket
output data: TTL level (built in 200 ohm current limiting resistor)
input voltage: 5 + 0.2VDC (no reverse voltage protection)
working current: less than 80mA
the preheating time: less than 60 seconds
response time: less than 10 seconds
recovery time: less than 20 seconds
operating temperature: -10 - 40 C
the humidity: less than 95%RH
storage temperature: -20 - 60 C
storage humidity: less than 60%RH
dimensions: 24 x 20 x 15 (L * W * H)
module: weight of about 20 grams
sensitivity: 0.5ppm hydrogen
the sensitivity attenuation: less than 1%/ years
: more than 10 years service life
* Contents
- Connect
B ----- D3
A ----- D2
5V ----- 5V
GND ----- GND
- Level
A B Level
Low Low 0
Low High 1
High Low 2
High High 3
- Key Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
int pinA = 2; // A
int pinB = 3; // B
LiquidCrystal_I2C lcd(0x27,20,4); // LCD2004
void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.print("start LCD2004");
pinMode(pinA, INPUT);
pinMode(pinB, INPUT);
delay(1000);
lcd.clear();
}
void loop()
{
lcd.setCursor(0,0);
lcd.print("S092:TPM-300 Air Q");
int valueA = digitalRead(pinA);
int valueB = digitalRead(pinB);
int airGrade = -1;
lcd.setCursor(0,1);
lcd.print("pinA(H/L)=" + (String)valueA + " ");
lcd.setCursor(0,2);
lcd.print("pinB(H/L)=" + (String)valueB + " ");
if(valueA == LOW && valueB == LOW)
{
airGrade = 0;
}
else if(valueA == LOW && valueB == HIGH)
{
airGrade = 1;
}
else if(valueA == HIGH && valueB == LOW)
{
airGrade = 2;
}
else if(valueA == HIGH && valueB == HIGH)
{
airGrade = 3;
}
lcd.setCursor(0,3);
lcd.print("Air Grade 0~3=" + (String)airGrade + " ");
delay(300);
}
'2) Sensor > Gas' 카테고리의 다른 글
MQ-2 Sensitive for Methane, Butane, LPG, Smoke (MQ-2) [S100] (0) | 2016.09.12 |
---|---|
Air Quality Sensor (MQ135) [S037] (0) | 2016.09.11 |