Arduino 各种模块篇 粉尘传感器 dust sensor 空气质量检测
Testing a sensor from here.
http://www.seeedstudio.com/wiki/Grove_-_Dust_Sensor
It's a dust sensor. Everyone can buy it anywhere also. It's a cheep one actually.
We can find its document here: http://www.seeedstudio.com/wiki/images/4/4c/Grove_-_Dust_sensor.pdf
It looks good.
It's more cheaper if you buy it from taobao.com or other whole sellers.
Now cut the crap, just send me those codes here:
/* 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 = ;
unsigned long duration;
unsigned long starttime;
unsigned long sampletime_ms = ;//sampe 30s ;
unsigned long lowpulseoccupancy = ;
float ratio = ;
float concentration = ; void setup() {
Serial.begin();
pinMode(,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.8*pow(ratio,)+*ratio+0.62; // using spec sheet curve
Serial.print(lowpulseoccupancy);
Serial.print(",");
Serial.print(ratio);
Serial.print(",");
Serial.println(concentration);
lowpulseoccupancy = ;
starttime = millis();
}
}
Here's what you can get

via serial promte, you can see:

For more information , you can check this out the link above.
Now please let me explain it from the bottom of it:

Let's see what the spec sheet carve of it:
The curve indicates that the bigger of the Concentration value is, the higher of the Low Pluse Occupancy will be.
So what's the Low Pulse Occupancy Time perentage for?
Let's check out this:

we count the time from the starting moment of the low pulse begins until the moment of next high pulse stops.
The time we can get is the cycle period. We can caculate the ratio of the LowPluseOccupancyTime/TheTimeWeSetToMeasure
# radio = LowPluseOccupancyTime/TheTimeWeSetToMeasure
With help of the chart which indicates the relationship of between the LowPulseOccupancyTimePercentage and the concentration, we can get the air quality value.
![]()
the unit of the concentration is : PCS/Liter.
PCS/liter is short for Particals / Liter
####################3
P.S. : There is another good air quality measuring module which looks like this :https://www.sparkfun.com/products/9689
I haven't tested it. But it looks neat and somehow better I guess.
So my next project will have something to do with a LIVE BROADCASTING AIR QUALITY STATION!
Let's see :)
Arduino 各种模块篇 粉尘传感器 dust sensor 空气质量检测的更多相关文章
- Arduino 各种模块篇 光敏感应模块 light sensor
It looks like this one: This one isn't a digital light sensor, so it's very simple. http://www.seeed ...
- Arduino 各种模块篇 摇杆模块
Arduino的另外几种模块,我们常见的joystick摇杆模块. 用起来很爽,摇杆 有X,Y轴可调 这里有一篇非常想尽的示例代码: http://www.geek-workshop.com/foru ...
- Arduino 各种模块篇 蓝牙模块 手机蓝牙控制Arduino LED灯
解决方案. 条件: 1.手机android 商店下载 blueTerm 2.向arduino中载入如下代码: char val; ; void setup() { Serial.begin(); pi ...
- Arduino 各种模块篇 motor shield
根据arduino官方网站出的shield, 类似的情况有很多中motor shield 这里测试采用的是http://www.seeedstudio.com/wiki/Motor_Shield_V1 ...
- Arduino 各种模块篇 震动模块 vibrator module
The vibrator I got works at the voltage ranging from 3.3V ~ 5.5V I want to make it vibrate variably. ...
- Arduino 各种模块篇 GPRS module 手机模块 短信 电话 上网 for texting, calling, internet
---恢复内容开始--- The GPRS shield which I tested is one which looks like this: ---恢复内容结束--- Need to be re ...
- Arduino 各种模块篇 震动模块 vibrator
vibrator is a good thing. it has multi-funtionality . :) Now the vibrator we choose is the one whic ...
- Arduino 各种模块篇 RGB LED灯
示例代码: 类似与这样的led,共阴rgb led,通过调节不同的亮度,组合成不同的颜色. 示例代码: /* 作者:极客工坊 时间:2012年12月18日 IDE版本号:1.0.1 发布地址:www. ...
- 【雕爷学编程】Arduino动手做(42)---PM2.5粉尘传感器
37款传感器与模块的提法,在网络上广泛流传,其实Arduino能够兼容的传感器模块肯定是不止37种的.鉴于本人手头积累了一些传感器和模块,依照实践(动手试试)出真知的理念,以学习和交流为目的,这里准备 ...
随机推荐
- HDU5014Number Sequence(贪心)
HDU5014Number Sequence(贪心) 题目链接 题目大意: 给出n,然后给出一个数字串,长度为n + 1, 范围在[0, n - 1].然后要求你找出另外一个序列B,满足上述的要求,而 ...
- NET 2015
.NET 2015 英文原文:Understanding .NET 2015 Understanding 翻译为了解或理解,对于 .NET 来说,2015 年注定会更加精彩,所以标题就用了“精彩”这个 ...
- Android基础之——startActivityForResult启动界面并返回数据,上传头像
在android应用的开发过程中,常常会出现启动一个界面后填写部分内容后带着数据返回启动前的界面,最典型的应用就是登录过程.在非常多应用程序的模块中,都有"我的"这个模块,在未登录 ...
- 网站静态化处理—CSI(5)
网站静态化处理—CSI(5) 讲完了SSI,ESI,下面就要讲讲CSI了 ,CSI是浏览器端的动静整合方案,当我文章发表后有朋友就问我,CSI技术是不是就是通过ajax来加载数据啊,我当时的回答只是说 ...
- Touch Punch在移动设备上面增加jQuery UI的触摸支持|Jquery UI 支持移动端 触摸滑动等
jQuery UI是我们前台开发常用的UI前端类库,但是目前的jQuery UI用户界面类库在互动和widget上并不支持touch事件.这意味着你在桌面上设计的优雅的UI可能在触摸设备,例如,ipa ...
- 我看PS求职简历照
看新闻<大学生求职简历照片不PS 连面试机会都没有>,忍不住也谈些自己的看法. 个人意见,尽量求真,这个求真要有平时努力的保证.长相一般的,知道自己是普通一员,按普通的方式行事就可以.即使 ...
- 2.3 LINQ查询表达式中 使用select子句 指定目标数据
本篇讲解LINQ查询的三种形式: 查询对象 自定义查询对象某个属性 查询匿名类型结果 [1.查询结果返回集合元素] 在LINQ查询中,select子句和from子句都是必备子句.LINQ查询表达式必须 ...
- APUE学习笔记(1):APUE运行环境
APUE全称<Advanced Programming in the UNIX Environment>(UNIX环境高级编程) 书中例子大都使用作者自己写的头文件,所以需要解决一下,还好 ...
- Hbuilder常用快捷键功能.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- leetcode第25题--Remove Element
problem: Given an array and a value, remove all instances of that value in place and return the new ...