关于夏普GP2Y1010AU0F使用疑问
按照http://blog.yeelink.net/?p=184组装 发现出口读出的数值始终7或是8 (不是应该小于5V的么 )?!在pin1(Vled)和GND加了一个220uf 电容 数值就变到42 ? 这是怎么回事啊? 参考这个网站 http://sensorapp.net/?p=479 我也是今天试验的这个模块,发现数值偏小,不知道是什么问题。咱们一起探讨一下吧。等我今天进一步试验吧 davidce 发表于 2013-4-5 22:50 static/image/common/back.gif参考这个网站 http://sensorapp.net/?p=479
我就是看的这个网站后加的个220uf电容:) gaotian 发表于 2013-4-6 00:48 static/image/common/back.gif
我也是今天试验的这个模块,发现数值偏小,不知道是什么问题。咱们一起探讨一下吧。等我今天进一步试验吧
您的数值大约在什么范围? 昨天刚学的arduino, 现用了~
模拟输入5v是以0-1024数值显示
所以要转换一下
dustVal=analogRead(dustPin)*(5.0/1023.0) cml1121 发表于 2013-4-6 09:50 static/image/common/back.gif
昨天刚学的arduino, 现用了~
模拟输入5v是以0-1024数值显示
所以要转换一下
0-1023 的数值范围,应该除以 1024 cml1121 发表于 2013-4-6 09:50 static/image/common/back.gif
昨天刚学的arduino, 现用了~
模拟输入5v是以0-1024数值显示
所以要转换一下
受用 非常感谢:) 关于夏普GP2Y1010AU0F,请问您写的程序,灰尘浓度与电压值的关系是什么?我正在做这个空气质量监测的项目。有空告知下,谢谢:lol
1016192756 发表于 2013-7-10 16:10 static/image/common/back.gif
关于夏普GP2Y1010AU0F,请问您写的程序,灰尘浓度与电压值的关系是什么?我正在做这个空气质量监测的项目。 ...
这是我的代码
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); // power on the LED
delayMicroseconds(delayTime);
dustVal=analogRead(dustPin); // read the dust value via pin 5 on the sensor
delayMicroseconds(delayTime2);
digitalWrite(ledPower,HIGH); // turn the LED off
delayMicroseconds(offTime);
delay(3000);
Serial.println((float(dustVal/1024)-0.0356)*120000*0.035);
}
我是参考这个帖子 请问可以用51单片机采样这个传感器的值吗 我用51的AD采样得不到想要的值 采样的方式是什么呢 采集0.28ms时的值?要不要对信号做处理之后再采样? Vicki 发表于 2013-9-4 11:40 static/image/common/back.gif
请问可以用51单片机采样这个传感器的值吗 我用51的AD采样得不到想要的值 采样的方式是什么呢 采集0.28ms时的 ...
51 当然可以做了, 就是找个带AD就行了
采样方式按照特定的时序来就可以了
int dustPin=0;
int dustVal=0;
int ledPower=2;
int delayTime=280;
int delayTime2=40;
float offTime=9680;
void setup(){
Serial.begin(9600);
pinMode(ledPower,OUTPUT);
pinMode(4, OUTPUT);
}
void loop(){
// ledPower is any digital pin on the arduino connected to Pin 3 on the sensor
digitalWrite(ledPower,LOW); // power on the LED
delayMicroseconds(delayTime);
dustVal=analogRead(dustPin); // read the dust value via pin 5 on the sensor
delayMicroseconds(delayTime2);
digitalWrite(ledPower,HIGH); // turn the LED off
delayMicroseconds(offTime);
delay(3000);
Serial.println(dustVal);
}
它的采样很简单 只要到正确搭建硬件,信号不需要什么前处理,
这是网上的例程 你改下就可移植到51上。
1016192756 发表于 2013-7-10 16:10 static/image/common/back.gif
关于夏普GP2Y1010AU0F,请问您写的程序,灰尘浓度与电压值的关系是什么?我正在做这个空气质量监测的项目。 ...
我现在正在做这个,请问,能够测出来吗 wuhaoyc 发表于 2013-9-30 21:06 static/image/common/back.gif
51 当然可以做了, 就是找个带AD就行了
采样方式按照特定的时序来就可以了
要怎么改啊
富利佳電子/edge electronics
朱俊/ AndyZhu
*************************************************
Tel: 86-755-61181811-608
Fax: 86-755-61181889
Mobile:86-13825228661
MSN: [email protected]
Email:[email protected]
QQ: 173973178
Web: www.edgeelectronics.com
**************************************************