查看“Microduino-Dust”的源代码
←
Microduino-Dust
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{Language|Microduino-Dust}} {| style="width: 800px;" |- | [[File: Microduino-Dust.jpg|400px|thumb|center| Microduino-Dust]] Microduino-Dust is a PM2.5 sensor. ==Features== *Adopt SHARP GP2Y1010AUOF air quality sensor; *Independent air duct and fast detection speed; ==Specification== *Operation voltage: 4.5V~5.5V *Detection sensibility: 0.5V/0.1mg/m3 *1.27mm-pitch 4PIN interface *Input: Fan control /5V digital signal & LED control/5V digital signal *Output 0~5V analog signal * Pin Description for Fan Control: GND, VCC, fan signal input and NC(empty). Since the output signal is digital, it needs to use digital interface to detect (D0~D13). Microduino-Dust can be connected to the pins (3~10) of the Sensorhub with the corresponding pins (D0,D2,D4,D6,D8,D10,D12). *Pin Description for Sensor Control: GND, VCC, detection signal output and LED control signal output. Since the output signal is simulated, it needs to use the analog interface to detect (A0~A7). The control signal is digital, it needs to be driven by the digital interface(D0~D13). You can use Microduino-IO-Split to divide the two signals, by connecting the interface of Microduino-Dust with the IN interface of Microduino-IO-Split: The IO-Split's A-OUT interface can be connected to the pin (10, 11 or 12) of the Sensorhub with the corresponding pin (A6,A2 or A0); The IO-Split's B-OUT interface can be connected to the pin (3~10) of the Sensorhub with the corresponding pin (D0,D2,D4,D6,D8,D10,D12). [[file:mCookie-sensorhub_rule.JPG|thumb|800px|center]] [[File: Microduino-Dust_rule1.jpg|600px|thumb|center]] ==Document== *Schematic: '''[[File: Microduino_Dust.Zip]]''' ==Development== Microduino-Dust can be applied in outdoor air quality detection or indoor dust detection. ==Application== *All hardware needed: [[Microduino-CoreUSB]], [[Microduino-sensorhub]], [[Microduino-IO split]], a USB cable and several wires; ** Make sure you build Microduino IDE or refer to: [[Microduino Getting started]] *Program <source lang="cpp"> #define FAN_PIN 10 //Fan control pin #define LED_PIN 12 //Sensor LED control pin #define DUST_PIN A0 //Sensor detection #define TIME1 280 #define TIME2 40 #define TIME3 9680 int dustVal = 0; float dustVoltage = 0; float dustDensity = 0; void setup(){ Serial.begin(9600); pinMode(FAN_PIN, OUTPUT); pinMode(LED_PIN, OUTPUT); digitalWrite(FAN_PIN, LOW); } void loop(){ digitalWrite(FAN_PIN, HIGH); //Open the fan before detecting delay(3000); digitalWrite(FAN_PIN, LOW); //Close the fan after 3s delay digitalWrite(LED_PIN,LOW); //Turn on LED inside the sensor delayMicroseconds(TIME1); //Wait for 280us dustVal = analogRead(DUST_PIN); //Analog value sampling delayMicroseconds(TIME2); // Wait for 40us digitalWrite(LED_PIN,HIGH); //Turn off the LED delayMicroseconds(TIME3); dustVoltage = dustVal * (5.0/1024.0); //Convert the analog value to voltage value. dustDensity = 0.17 * dustVoltage - 0.1; //Convert the voltage value to dust density (Output unit: mg / m³) Serial.println(dustDensity); delay(1000); } </source> *Software: *Stack all modules together and then connect the Dust sensor's fan control interface with the D10 pin of the Sensorhub with a wire. *Connect Microduino-Dust sensor's control detection interface to the IO splitter's IN interface with a wire. And then connect the IO splitter's A-OUT interface to Sensorhub A0, the IO splitter's *B-OUT interface to Sensorhub D12. *Open Arduino IDE, copy the program to IDE and then choose the right board from Tools→Board and then compile. *Select the right port from Tools→Serial Port in Arduino IDE after compiling, then download program. *After the download, you can open the serial monitor. After the Dust sensor's fan works for three seconds, the serial console will display the current air dust density and the Dust sensor will have another detection after one second. ==Purchase== ==History== ==Pictures== *Front [[file: Microduino-Dust-F.JPG|thumb|600px|center|Microduino-Dust Front]] *Back [[file: Microduino-Dust -b.JPG|thumb|600px|center|Microduino-Dust Back]] |}
该页面使用的模板:
模板:Language
(
查看源代码
)
模板:Nmbox
(
查看源代码
)
返回至
Microduino-Dust
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
Welcome
首页
创客大赛
大赛详情
3D打印
安装月球车
图形化编程
操控月球车
升级月球车
编程工具下载
软件下载
Arduino
Processing
Mixly
Scratch
模块套件
Microduino 102
mCookie 102
mCookie 202
mCookie 302
IBC
其他
应用套件
四轴飞行器
平衡车
小车CUBE
音乐播放器
刷卡音乐播放器
wifi气象站
彩虹音乐触摸灯
分贝检测仪
迎门汇报
LED点阵时钟
LED点阵屏幕
硬件
mCookie
Sensor
Microduino
MicroWrt
MicroNux
MicroRobot-Core
MicroRobot-CoreESP
ideaBoard
ideaBox
MicroMV
MicroAI
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息