1. Soil Moisture Sensor

이전에 인터넷에서 많이 회자되던 아두이노 프로젝트가 있었죠. 화분에 물이 떨어지면 트위터로 알려주는… 화분 관리를 자동화하기 위해서는 흙에서 사용할 수 있는 전용 센서를  사용해야 하는데 이게 그겁니다. 사용하는 방법은 의외로 간단합니다. 

Feature:

1).This is a simple water sensor ,can be used to detect soil moisture .Module Output is high level when the soil moisture deficit,or output is low.Can be used in module plant waterer device, and the plants in your garden no need people to manage.
2).Adjustable sensitivity by adjusting the digital potentiometer (shown in blue)
3).Operating voltage:3.3V~5V
4).Dual output mode,analog output more accurate.
5).A fixed bolt hole for easy installation
6).Panel PCB Dimension: 30mm * 16mm
7).Soil Probe Dimension:60mm*30mm
8).With power indicator (red) and digital switching output indicator (green)
9).Having LM393 comparator chip, stable

2. 연결방법

Pin definition

Pin Definition
VCC 5V
GND GND
DO Digital output interface (0 and 1)
AO Analog output interface

제가 구입한 모듈은 백보드와 함께 들어 있고 백보드에 4개의 핀이 있습니다. VCC, GND 는 전원용이고 D0, A0 핀은 Digital, Analog 방식의 데이터를 출력해주는 핀입니다. D0에서는 습도상태를 true/false 값으로 출력하고, A0에서는 0~950 의 값을 출력해줍니다. 원하는 방식을 선택해서 쓰면 됩니다. Analog 데이터의 의미는 아래와 같습니다.

Analog value Meaning
0~300 Dry soil (건조한 상태)
300~700 Humid soil (습도가 높음)
700~950 In water (물에 잠김)

아래 연결 그림에서는 백보드가 사용되지 않고 센서의 3핀을 직접 사용한 경우입니다. 백보드가 연결된 경우도 D0, A0 핀 중 하나를 선택해서 아두이노 Digital pin/Analog pin 에 연결하면 됩니다.

Connection Diagram

images

3. 코드 (스케치)

/*
  # 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(57600);
}

void loop(){
  Serial.print("Moisture Sensor Value:");
  Serial.println(analogRead(0));    // 핀 번호 확인!!
  delay(100);
}