풍속 측정 센서 -펄스 출력
(Anemometer)
개요
- 본 제품은 풍속 측정 센서입니다.
- 실외에서 바람의 속도를 쉽게 측정할 수 있게 디자인된 제품으로 튼튼하며 쉽게 마운트할 수 있게 디자인되었습니다.
- 바람이 불면 컵이 회전하면서 펄스를 출력합니다.
- 출력된 펄스의 주파수를 F라고 하면 속도는 S = 0.1 + 0.0875 × f 입니다. F가 0일 경우 S는 0입니다.
- 와이어는 방수커넥터로 연결이 되어 있으며 빨강 VCC, 초록 Gnd, 노랑 Pulse ouput입니다.
- 5V로 동작하는 제품입니다.
특징
- Output: Pulse
- Power: 5VDC
- Cable: 2.5M
- Load capacity: current-output impedance ≤600Ω; voltage-output impedance ≥1KΩ
- IP Rating: IP45
- Operating Temperature: -40 ℃ ~ 50 ℃
- Operating humidity: ≤100% RH
문서
- 펄스 출력핀을 아두이노의 디지털 핀 2번에 연결합니다.
- 아래의 아두이노 코드를 업로드합니다.
int pulse; //measuring the rising edges of the signal float wind_speed; int air_velocity_transducer = 2; //The pin location of the sensor void rpm () //This is the function that the interupt calls { pulse++; //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(air_velocity_transducer, 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 () { pulse = 0; sei(); //Enables interrupts delay (1000); //Wait 1 second cli(); //Disable interrupts wind_speed = ( pulse * 0.0875+0.1); Serial.print (wind_speed, 1); //Prints the number calculated above Serial.print (" m/s\n"); //Prints "m/s" and returns a new line }