其他传感器

Arduino风向风速传感器

字号+ 作者:Dylan 来源:未知 2016-05-06 01:08 我要评论( )

风速传感器现被广泛运用于物联网项目中,该传感器输出模拟电压值,配合arduino的驱动,使测量风速变得更加简单。同时风速传感器可连续监测地点的风速风量大小,能够对所处巷道的风速风量进行实时显示,是矿井通风安全参数测量的重要仪表。

简介:

风速传感器现被广泛运用于物联网项目中,该传感器输出模拟电压值,配合arduino的驱动,使测量风速变得更加简单。同时风速传感器可连续监测地点的风速风量大小,能够对所处巷道的风速风量进行实时显示,是矿井通风安全参数测量的重要仪表。

特点:

  1. 体积小,携带方便,安装简捷
  2. 测量精度高,量程宽,稳定性好
  3. 结构设计合理,外观质量佳
  4. 数据信息线新能好,信号输出距离长,抗外界干扰能力强

应用范围:

可广泛应用于温室、环境保护、气象站、船舶、码头、养殖等环境的风速测量。

接线方式





风向参考代码

/*************Winddirection test**************/

char* dirstring[16] = {"North","North1","Northeasterly","Northeasterly1","East","East1","Southeast",
                       "Southeast1","South","South1","Southwest","Southwest1","West","West1","Northwest","Northwest1"};
void setup() {
  Serial.begin(9600);
}
void loop() {
  int sensorValue = analogRead(A0);
  float value = sensorValue * (5.0 / 1024.0);
//Serial.println(value);
  int winddirection =( value *10) ;
  winddirection = winddirection - 4 ;
  Serial.println(winddirection);
//   if(winddirection < 0)
//   winddirection = 0; 
// if(winddirection > 15)
//  winddirection = 15;  
  Serial.print("winddirection is ");
if(winddirection == 0 || winddirection == 15 )
   { Serial.println( dirstring[0] );}
  else 
   { Serial.println( dirstring[winddirection] );}
delay(500);

}
风速参考代码

/******windspeed test**********/

void setup() {
  Serial.begin(9600);
}
void loop() {
  int sensorValue = analogRead(A0);
// Serial.println(sensorValue);
  float value = sensorValue * (5.0 / 1024.0);
//  Serial.println(value);
  float fanspeed = value - 0.4 ;
// Serial.print( fanspeed );
  fanspeed = fanspeed * 1.6*32.4 ;
  Serial.print("fanspeed is ");
  Serial.print( fanspeed );
  Serial.println( "m/s" );
delay(500);

}

如需更详细资料,如有好资源分享,请加入QQ交流群:214461008

欢迎阅读,欢迎转载,不用注明出处!本站只提供入门和进阶资料,做您学习的小伙伴!

老司机也欢迎光临指导!有好内容请加群:214461008 不要看声明了,看内容吧!

相关文章
网友点评