最新消息:

【Arduino基础教程】Moisture Sensor土壤湿度传感器

Arduino 少儿编程 1828浏览 0评论
【Arduino基础教程】Moisture Sensor土壤湿度传感器
Moisture Sensor土壤湿度传感器

Moisture Sensor土壤湿度传感器可读取在其周围的土壤存在的水分的量。因此,它可以用于监视你的花园土壤湿度并提醒你适时浇花。

模块特征

  • 供电: 3.3v 或者 5v
  • 输出信号: 0~4.2v
  • 额定电流: 35mA
  • 输出范围及对应的土壤湿度

0 ~300 : 干燥
300~700 : 湿润
700~950 : 水分充足

准备材料

  • Arduino Uno *1
  • Moisture Sensor土壤湿度传感器 *3
  • 跳线 *3

模块接线

【Arduino基础教程】Moisture Sensor土壤湿度传感器
接线示意图
Moisture Sensor Arduino
S -> A0
+ -> 5V
- -> GND

示例程序

/*
  # Example code for the moisture sensor
  # Editor     : Lauren
  # Date       : 13.01.2012
  # Version    : 1.0
  # Connect the sensor to the A0(Analog 0) pin on the Arduino board
   
  # the sensor value description
  # 0  ~300     dry soil
  # 300~700     humid soil
  # 700~950     in water
*/
 
void setup(){
  Serial.begin(9600);
}
 
void loop(){ 
  Serial.print("Moisture Sensor Value:");
  Serial.println(analogRead(A0));  
  delay(100);
}

上传程序后,在工具->串口监视器中就可以看到土壤的实时湿度值。

参考文献

http://www.dfrobot.com/wiki/index.php?title=Moisture_Sensor_(SKU:SEN0114)

您必须 登录 才能发表评论!