Industrial IoT using YF-S201 Hall Effect Water Flow Sensor Interfaced with
Node MCU for automated water flow calculation connected to cloud system with Blynk App

Chemical industries have to constantly measure and quantify the liquids that they are handling during this automation process, and the most common sensor used to measure the flow of a liquid is a Flow Sensor. By using a flow sensor with a microcontroller like Arduino, we can calculate the flow rate, and check the volume of liquid that has passed through a pipe, and control it as required. A water flow sensor will be a good addition to projects like Automatic Water Dispenser and Smart Irrigation Systems where we need to monitor and control the flow of liquids. We will interface the water flow sensor with Arduino and LCD, and program it to display the volume of water, which has passed through the valve.
The liquid pushes against the fins of the rotor, causing it to rotate. The shaft of the rotor is connected to a Hall effect sensor. It is an arrangement of a current flowing coil and a magnet connected to the shaft of the rotor, thus a voltage/pulse is induced as this rotor rotates. In this flow meter, for every liter of liquid passing through it per minute, it outputs about 4.5 pulses. This is due to the changing magnetic field caused by the magnet attached to the rotor shaft. We measure the number of pulses using an Arduino and then calculate the flow rate in liters per hour (L/hr) and total volume in Litre using a simple conversion formula

YF-S201 Hall Effect Water Flow Sensor Interfacing with Node MCU:

There are only three terminals for water flow sensor. VCC and GND are connected to 3.3 volts DC and ground respectively to Node MCU. Output pulse terminal is connected to pin 7 of Node MCU which will count the pulses and arrive at the flow rate and volume of water. Pin 7 will trigger Pin 3 & Pin 4 which are connected to Red LED and Buzzer respectively to indicate that there is water flowing or it can be given the other way like when water flow stops. Green LED is connected to Pin 2 which indicates that the Node MCU is on.