유량 흐름 센서 -3/8 인치
(Water Flow Sensor -G3/8 inch)
개요
- 본 센서는 물이나 액체의 흐름을 측정하는 프로젝트에 필요한 센서로, 물이나 액체의 흐름을 측정하는데 사용합니다.
- 본 센서는 수도관이나 액체를 전달하는 관에 위치하여 얼마나 많은 액체가 통과하였는지를 측정합니다.
- 이를 위해서 센서내에는 자석이 붙어 있는 휠이 있고, 다른 쪽 플라스틱 튜브에는 hall effect magnetic 센서가 있어 얼마나 휠이 회전하였는지를 알수 있습니다.
- 센서의 케이블은 3선이며 빨강(3.5-12VDC), 검정(그라운드), 노랑(hall effect pulse output)색입니다.
- 센서 출력에서 펄스를 카운트하여 쉽게 액체 흐름을 트랙킹할 수 있습니다.
- 유량센서의 출력 펄스는 물이 흐른 양에 비례합니다.
- 펄스 주파수 = Flow(Q) * 23입니다. 만약 출력 주파수가 12.5이라면 유량은 12.5/23 =0.5(L/min) 입니다.
- 아두이노와 같은 마이크로컨트롤러와 아래와 같이 연결합니다.
- 알림: G3/8 규격입니다.
특징
-
1>.Model: YF-S402C2>.Specification: G3/83>.Work Voltage:DC 3.5V-12V4>.Work current:10mA5>.Flow pulse characteristic:F=23*Q;Q=L/min6>.Precision:3%7>.Output current:<10mA8>.Flow range:0.3-10L/min9>.Water pressure environment:<0.8MPa10>.Work Temperature:0℃~80℃11>.Work Humidity:5%~90%RH12>.Size:54*35*27mm13>.Wire length:150mm
문서
-
Pin definition:1>.Red wire:VCC.It is used to connect to positive of input work voltage.2>.Yellow wire: Signal output.3>.Black wire:GND.It is used to connect to negative of input work voltage.
- 센서의 VCC- 5V, Gnd - Gnd, SIG를 아두이노 핀 2번에 연결합니다.
- 아래의 아두이노 코드를 아두이노에 업로드하고 테스트합니다.
-
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 / 98); //(Pulse frequency x 60) / 98Q, = 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
}