03-PM2.5灰塵傳感器

台南市 http://pm25.tn.edu.tw/xoops/modules/tad_book3/page.php?tbdsn=5

起因於2016/04/13在淘寶網買了一個「代理銷售日本神榮PM2.5灰塵傳感器PPD42NS/PPD42NJ,特價!」(39.5RMB)

後發現我買的應該不是日本製而是山寨,因為跟這個很像「arduino單片機/粉塵灰塵傳感器模塊/PM2.5傳感器/替代進口PPD42NS」(25RMB)這網站有更詳細的商品解說

還有更便宜的「替換神榮的DPM 灰塵傳感器 PM2.5傳感器模塊 arduino 檢測模塊」(18RMB)這網站有更詳細的商品解說

又發現真正的日本神榮「精品 arduino 粉塵 顆粒濃度 空氣質量 霧霾檢測 PM2.5傳感器」(85RMB)這網站還有arduino的程式可複製

又找到「Grove – Dust Sensor 細懸浮微粒 粉塵感測器 pm2.5 粉塵傳感器」,這網站有非常多的資料

後來又發現「阿簡生物筆記」有一篇「使用Arduino動手監測空氣懸浮微粒」,就是俾用「使用的懸浮微粒偵測器是日本神榮的Shinyei PPD42」是很好的參考文章!!

PPD42NS產品介紹:

粉塵傳感器可以通過在給定的單位時間內,計算羅脈衝佔用時間(LPO時間)來測量空氣中的顆粒物水平,該傳感器可以為您提供可靠的粉塵數據。它可以檢測直徑為1微米的粉塵顆粒。此傳感器使用計數法測試粉塵濃度,測量結果單位為pcs/0.01cf。

注意事項

    • 請保證傳感器正面朝上。

    • 第一次使用前,請保證3分鐘的預熱時間。

    • VR1和VR2針腳已經進行預設,請不要調整它們的配置。

    • 該粉塵傳感器測量的顆粒大小與PM2.5顆粒大小不同,不能直接用於PM2.5的測量,但顆粒大小相近,可略作參考。

應用示例

這個示例我們將演示如何用粉塵傳感器檢測粉塵濃度。

1.將粉塵傳感器接在Base Shield的D8口,再將Base Shield與Arduino UNO相連。你也可以通過跳線將傳感器與Arduino UNO相連,連接示意圖如下:

2. 複製下列代碼至sketch文件,下載到Arduino上。

/* Grove - Dust Sensor Demo v1.0 Interface to Shinyei Model PPD42NS Particle Sensor Program by Christopher Nafis Written April 2012 http://www.seeedstudio.com/depot/grove-dust-sensor-p-1050.html http://www.sca-shinyei.com/pdf/PPD42NS.pdf JST Pin 1 (Black Wire) => Arduino GND JST Pin 3 (Red wire) => Arduino 5VDC JST Pin 4 (Yellow wire) => Arduino Digital Pin 8 */ int pin = 8; unsigned long duration; unsigned long starttime; unsigned long sampletime_ms = 30000;//sampe 30s ; unsigned long lowpulseoccupancy = 0; float ratio = 0; float concentration = 0; void setup() { Serial.begin(9600); pinMode(8,INPUT); starttime = millis();//get the current time; } void loop() { duration = pulseIn(pin, LOW); lowpulseoccupancy = lowpulseoccupancy+duration; if ((millis()-starttime) > sampletime_ms)//if the sampel time == 30s { ratio = lowpulseoccupancy/(sampletime_ms*10.0); // Integer percentage 0=>100 concentration = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; // using spec sheet curve Serial.print("concentration = "); Serial.print(concentration); Serial.println(" pcs/0.01cf"); Serial.println("\n"); lowpulseoccupancy = 0; starttime = millis(); } }

lowpulseoccupancy單位是微秒,sampletime_ms單位是毫秒, 所以要單位換算為(lowpulseoccupancy/(sampletime_ms*1000))*100%

在這個代碼中,主控板記錄了30秒內的低電平脈衝佔用時間,通過它描繪了環境粉塵濃度。打開串口監視器,我們可以讀出具體的數值。 上圖的結果包括三個部分:羅脈衝佔用時間,比例,粉塵水平。 “lo pulse occupancy”表示30秒內羅脈衝佔用時間,它的單位是微秒。 “ratio”反映的是LPO時間佔總時間的比例。 “concentration”具有物理意義,它是通過下表,將LPO時間比例對應到粉塵濃度得出的數據。它的單位是pcs/0.01cf。

SHARP 原裝夏普 GP2Y1014AU PM2.5 空氣品質感測器 送排線,電容,電阻套件

2016新推出的 GP2Y1014AU 取代 舊款 GP2Y1010AU0F

日本夏普SHARP 原產灰塵感測器GP2Y1014AU,比上代GP2Y11010AU精度提高15%,在一致性上可以和PM2.5激光感測器對比.可測量0.8微米以上的微小粒子,感知煙草產生的煙氣和花粉,房屋粉塵等.體積小,重量輕,便於安裝.

主要參數

    • 灰塵感測器GP2Y1014AU

    • 靈敏度:0.5V/(0.1mg/m3)

    • 輸出電壓(無灰塵): 0.9V(TYP)

    • 消耗電流:11mA

GP2Y1014AU0F 是一款光學空氣品質感測器,設計用來感測空氣中的塵埃粒子,其內部對角安裝紅外線發光二極體和光電晶體,使其能夠探測空氣中塵埃反射光,即使非常細小的如煙草煙霧顆粒也能夠被檢測到,通常應用在空氣淨化系統中。

int measurePin = 0; //Connect dust sensor to Arduino A0 pin int ledPower = 2; //Connect 3 led driver pins of dust sensor to Arduino D2int samplingTime = 280; int deltaTime = 40; int sleepTime = 9680;float voMeasured = 0; float calcVoltage = 0; float dustDensity = 0;void setup(){ Serial.begin(9600); pinMode(ledPower,OUTPUT); }void loop(){ digitalWrite(ledPower,LOW); // power on the LED delayMicroseconds(samplingTime);voMeasured = analogRead(measurePin); // read the dust value delayMicroseconds(deltaTime); digitalWrite(ledPower,HIGH); // turn the LED off delayMicroseconds(sleepTime); // 0 - 5V mapped to 0 - 1023 integer values // recover voltage calcVoltage = voMeasured * (5.0 / 1024.0); // linear eqaution taken from http://www.howmuchsnow.com/arduino/airquality/ // Chris Nafis (c) 2012 dustDensity = 0.17 * calcVoltage - 0.1; Serial.print("Raw Signal Value (0-1023): "); Serial.print(voMeasured); Serial.print(" - Voltage: "); Serial.print(calcVoltage); Serial.print(" - Dust Density: "); Serial.print(dustDensity * 1000); // 這裡將數值呈現改成較常用的單位( ug/m3 ) Serial.println(" ug/m3 "); delay(1000); }

測試得到的資料和空氣品質對照:

3000 + = 很差

1050-3000 = 差

300-1050 = 一般

150-300 = 好

75-150 = 很好

0-75 = 非常好

产品手册(资料):http://pan.baidu.com/s/1eQjaACa

GP2Y1010AU_设计参考指南及原理:http://pan.baidu.com/s/1o6kglNs

1、如需面包板,请点击以下链接加入购物车:http://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-2896213843.18.4AbQ7r&id=21323428056

2、如需Arduino UNO R3 开发板,请点击以下链接加入购物车: http://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-2896213843.9.dVvk4R&id=40649732928

发货清单:

1,GP2Y1014AU0F 灰尘传感器(1个)代替已经停产的GP2Y1010AU0F

2,150ohm的电阻(1个)

3,220uF的电容(1个)

4,6pin连接线(1个)【实验必备元件】

概观

夏普光学灰尘传感器(GP2Y1014AU0F)在检测非常细的颗粒,如香烟烟雾,是特别有效的,

并且是常用的空气净化器系统。

该装置中,一个红外发光二极管和光电晶体管,对角布置成允许其检测到在空气中的灰尘反射光。

该传感器具有极低的电流消耗(最大20mA,11毫安典型的),可以搭载高达7VDC的传感器。输出的是一个模拟电压正比于所测得的粉尘浓度,敏感性为0.5V/0.1mg/m3。

规范

电源电压:5-7V

工作温度:-10-65摄氏度

消耗电流:20mA最大

最小粒子检出值:0.8微米

灵敏度:0.5V/(0.1mg/m3)

清洁空气中电压:0.9V 典型值

工作温度:-10~65℃

存储温度:-20~80℃

使用寿命:5年

尺寸大小:46mm×30mm×17.6mm

重量大小:15g

检测原理

其原理如下图,传感器中心有个洞可以让空气自由流过,定向发射LED光,通过检测经过空气中灰尘折射过后的光线来判断灰尘的含量。

使用测试代码:

int dustPin=0;

float dustVal=0;

int ledPower=2;

int delayTime=280;

int delayTime2=40;

float offTime=9680;

void setup(){

Serial.begin(9600);

pinMode(ledPower,OUTPUT);

pinMode(dustPin, INPUT);

}

void loop(){

// ledPower is any digital pin on the arduino connected to Pin 3 on the sensor

digitalWrite(ledPower,LOW);

delayMicroseconds(delayTime);

dustVal=analogRead(dustPin);

delayMicroseconds(delayTime2);

digitalWrite(ledPower,HIGH);

delayMicroseconds(offTime);

delay(1000);

if (dustVal>36.455)

Serial.println((float(dustVal/1024)-0.0356)*120000*0.035);

}

测试得到的数据和空气质量对照:

3000 + = 很差

1050-3000 = 差

300-1050 = 一般

150-300 = 好

75-150 = 很好

0-75 = 非常好

排线位置:

不接电容电阻接线示意图:

注意:添加一个150ohm的电阻和一个220uF的电容,接线如下图:

Sensor Pin Arduino Pin

1 Vled –> 5V (150ohm resistor)

2 LED-GND –> GND

3 LED –> Digital pin 2

4 S-GND –> GND

5 Vo –> Analog pin 0

6 Vcc –> 5V

LED引脚必须调节成1ms的周期。

LED似乎使用的是PNP晶体管来通电,LED引脚必须接收一个较低的电压。