In this post we are going to construct a digital water flow meter using Arduino and 16 x 2 LCD display. We will be taking a look at YF-S201 water flow sensor, its construction and working and how to interface with Arduino to extract some useful readings.
By Girish Radhakrishnan
The proposed project can measure the rate of water flow in litre / minute and total water flow in litres.
Let’s take a look at YF-S201 water flow sensor.
Illustration of YF-S201:
YF-S201 is a Hall Effect based water sensor. It has three terminals 5V (nominal working voltage), GND and output. The +5V is red coloured wire, the black one is GND and yellow one is output.
The sensor gives out frequency directly proportional to water flow. The YF-S201 sensor can measure from 1 litre / minute to 30 litre / minute. The water pressure should be less than or equal to 1.75 MPa.
The water can be injected from one end and water flows through the other end.
The sensor may be placed after the main gate-valve of tank; if you want to measure the water flow in a network of water pipes or you can place just before a water tap to measure the water flow of single tap.
The placement of the sensor can be anywhere according to user’s need but, care must be taken to avoid leakage of water.
The sensor has a magnet and Hall Effect sensor; if we take a look at the sides of the water flow sensor, we can witness a plastic turbine in the path of water flow.
A round shaped magnet is embedded at the centre of the turbine and the Hall Effect sensor is sealed and protected from moisture and placed above the magnet. The Hall Effect sensor produces a pulse for every revolution of the turbine.
We can see the pulses generated by water flow sensor on serial plotter of arduino IDE, shown below (Using Arduino Single channel Oscilloscope).
We have blown air through the sensor to rotate the turbine as a test and the waveform generated is shown above. The denser waveform on left hand side represents higher frequency and faster rotation of turbine, the less dense waveform at right hand side signifies the vice versa.
A consistent water flow gives out consistent frequency output.
We have to convert the frequency into litre/minute scale. To do this, the manufacturer has given a formula:
Water flow rate (litre/min) = frequency / 7.5
So, we need to measure the generated frequency and apply the above formula in the program code.
Here are the other technical specifications of YF-S201:
· Accuracy: +/- 10%, if you need better precision, we need to calibrate.
· Working Temperature: -25 to + 80 degree Celsius.
· Working humidity: 35% to 80% RH.
· Output duty cycle: 50% +/- 10%.
· Maximum water pressure: 1.75 MPa.
· Pulses per Litre: 450.
· Maximum current draw: 15 mA at 5V
That concludes the YF-S201 water flow sensor.
Now let’s move to the schematic.
The water flow sensor’s output pin is connected to A0 of Arduino. Use the 10K potentiometer for adjusting display contrast. Wire the Arduino and LCD display as per the above diagram.
The “L/Min” indicates the current water flow rate and the “Total” indicates the total water flowed since the circuit turned ON.
You can also flow any liquids whose viscosity value is near to water.
If you have any questions regarding this digital water flow meter using Arduino, feel free to express in the comment section, you may receive a quick reply.