Water flow rotor/motor sensor wiring guide on Arduino
A water flow sensor is a plastic valve body with rotor that provides a hall-effect sensing when water flows through the motor. The motor will roll and the speed will change on a different rate flow. The hall-effect sensor will read the corresponding voltage pulse signal and send the signal to the micro controller and provide liquid flow rate as data.
How it works?
As liquid passes through the valve and the magnetic rotor spins at a rate proportional to flow, a series of magnetic field to stimulate the hall effect sensor and producing a series of voltage pulses. The output voltage pulses are the same voltage level as the input with a frequency proportional flow rate. The output signal can be digital rate totalizes or other electronic controller.
Wiring the Sensor to Arduino Board
Arduino Source Code / Sketch Using the Water Flow Sensor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
Demo sketch reading the water flow sensor
*/
intTORBINE;//Measures incrementing signal
intCalc;
intHSensor=2;//Assign to Arduino Digital Pin 2
voidrpm()//Function interrupt call
{
TORBINE++;//Function measures the incrementing falling edge
}
voidsetup()
{
pinMode(HSensor,INPUT);//initializes Arduino digital pin 2 as an input
Serial.begin(9600);//Serial communication begin to see the output data
attachInterrupt(0,rpm,RISING);//interrupt is attached
}
voidloop()
{
TORBINE=0;//Set TORBINE to 0 for calculations
sei();//Enables interrupts
delay(1000);//Delay wait for 1 second
cli();//Disable interrupts
Calc=(TORBINE *60/7.5);//PULSE multiply by 60 divided by 7.5Q, equal FLOW RATE in L / hour
Serial.print(Calc,DEC);//Show the number calculated above to communication port
Serial.print(" L/hour\r\n");//Prints L / hour & returns a new line
}
Water flow rotor/motor sensor wiring guide on Arduino
We use cookie to provide you the best possible experience, this site uses cookies and by continuing to use the site you agree that we can save them on your device. Cookies are small text files which are placed on your computer and which remember your preference / some details of your visit. Our cookies don’t collect any personal information. For information, please read our Privacy Statement and Cookie Policy , which also explains how to disable this option in your browser. Cookie SettingsACCEPT
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalit...
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.