밸브 형태의 센서로 양쪽에 유체가 흐르는 관을 연결하면 유속을 측정할 수 있습니다. 아래 링크에 있는 제품인데 다른 제품도 사용법은 비슷할 겁니다.

http://www.seeedstudio.com/forum/viewtopic.php?f=4&t=989&p=3632

유체에 의해 회전하는 프로펠러가 있고 프로펠러의 회전을 hall-effect 센서로 측정하는 원리입니다. 하나의 디지털 핀을 사용해서 값을 읽을 수 있는데, 일정 시간동안 디지털 핀을 통해 들어오는 신호를 읽어 [신호 수/시간]으로 계산하면 회전 속도를 알수 있습니다. 회전 속도를 다시 유체의 속도로 변환하면 됩니다.

센서는 양쪽에 연결할 파이프 직경에 따라 여러 종류가 있으므로 구매시 주의해야 합니다.

Features

  • Compact, Easy to Install
  • High Sealing Performance
  • High Quality Hall Effect Sensor
  • RoHS Compliant
Specifications
  • Mini. Wokring Voltage: DC 4.5V
  • Max. Working Current: 15mA (DC 5V)
  • Working Voltage: DC 5V~24V
  • Flow Rate Range: 1~30L/min
  • Load Capacity: ≤10mA (DC 5V)
  • Operating Temperature: ≤80℃
  • Liquid Temperature: ≤120℃
  • Operating Humidity: 35%~90%RH
  • Water Pressure: ≤1.75MPa
  • Storage Temperature: -25~+ 80℃
  • Storage Humidity: 25%~95%RH

아래처럼 연결해서 사용이 가능합니다. 인터럽트 기능을 사용할 경우 D2 또는 D3 핀을 사용해야 하지만  인터럽트 기능을 사용하지 않는다면 다른 디지털 핀 아무거나 사용해도 됩니다. 10k 풀업 저항을 사용했다는 점만 주의하면 됩니다.

water_flow

아래 예제는 인터럽트를 이용합니다만, 굳이 인터럽트 기능을 사용하지 않고 짧은 시간동안만 측정하고 다른 작업을 하는 방식으로 해도 좋습니다.

// reading liquid flow rate using Seeeduino and Water Flow Sensor from Seeedstudio.com
// Code adapted by Charles Gantt from PC Fan RPM code written by Crenn @thebestcasescenario.com
// http:/themakersworkbench.com http://thebestcasescenario.com http://seeedstudio.com

volatile int NbTopsFan; //measuring the rising edges of the signal
int Calc;                               
int hallsensor = 2;    //The pin location of the sensor

void rpm ()     //This is the function that the interupt calls 
{ 
  NbTopsFan++;  //This function measures the rising and falling edge of the hall effect sensors signal
} 
// The setup() method runs once, when the sketch starts
void setup() //
{ 
  pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input
  Serial.begin(9600); //This is the setup function where the serial port is initialised,
  attachInterrupt(0, rpm, RISING); //and the interrupt is attached
} 

// the loop() method runs over and over again,
// as long as the Arduino has power
void loop ()    
{
  NbTopsFan = 0;   //Set NbTops to 0 ready for calculations
  sei();      //Enables interrupts
  delay (1000);   //Wait 1 second
  cli();      //Disable interrupts
  Calc = (NbTopsFan * 60 / 7.5); //(Pulse frequency x 60) / 7.5Q, = flow rate in L/hour 
  Serial.print (Calc, DEC); //Prints the number calculated above
  Serial.print (" L/hour\r\n"); //Prints "L/hour" and returns a  new line
}
참고자료 :