Hall Effect [Water] Flow Sensor

? [Water] Flow Sensor

Application

The water flow sensor is currently used to monitor water usage on my rural property. There are various styles of flow sensor available but they typically employ a rotating magnet and the Hall Effect to measure water flow. However, the size of the bore in the sensor, and the characteristics of the internal paddle, have a direct impact of the frequency of the pulses that are subsequently generated, with the result that the specific characteristics of individual sensors must be taken into account when calculating the measured water flow.

Configuration

Hardware

I originally purchased a 1" 2-100 L/min (Pulsed Output) flow sensor from Nymet, in Australia. While there was no labelling (at all) on this sensor, it is identical in appearance to the Sea YF-G1 sensor and so, for the time being, until I am able to compare what I have to an actual YF-G1 sensor, I'm assuming that's what it is and using the configuration parameters specified for that sensor.

YF-G1 Specs

There are many projects describing the configuration of similar water flow sensors, like this one from How2Electronics). Importantly, others note that, while these sensors are often identified as requiring an operating voltage of 5V – 24V, or even the 3.5V – 24V range identified in the product data illustrated above, they can be driven directly by 3.3V processors, typically the ESP8266-based NodeMCU.

Next, I originally attempted to mate the flow sensor with a Heltec WiFi LoRa 32 dev-board but, for reasons I don't yet understand, I could not get the sensor to trigger an interrupt. Using exactly the same configuration, and essentially the same software, with the NodeMCU DevKit was fine, so I just went with that.

The current NodeMCU/Flow Meter configuration is as illustrated below.

Water Flow Sensor Hardware Configuration

Water Flow Sensor Electrical Circuit
Pin Configuration
NodeMCU RFM95W OLED YF-G1
GND GND GND GND
3V3 3V3 VCC VCC
D6 (GPIO12) MISO
D7 (GPIO13) MOSI
D5 (GPIO14) SCK
D8 (GPIO15) NSS
RST RST
SD3 (GPIO10) DIO0
D3 (GOPIO0) SCL
D4 (GPIO2) SDA
D2 (GPIO4) Sig

I also encountered problems running from battery, and I still do not fully understand why. Again, everything was fine until I 'activated' the sensor—this immediately sucked the life out of the NodeMCU board! Provide power through the on-board USB connector, reset, and all was fine, which left me to question the claim that the sensor draws less than 10mA. I tried different size batteries (14500, 18500, 18650), invariably with different ratings, to no effect, and also to run the sensor at a higher voltage (5V) but, again, regardless of the size of the battery, the Node died—this is probably no surprise, since the power still comes from the battery, regardless of the voltage. This is probably not a major issue in the present case, as there will be no water flow if there is no power to run the associated pump—actually, this may not be true, there may still be leakage through the pump even when it is not actually running... This requires more investigation...

Software

While the operation of most of the examples that I have encountered is similar, one thing that does differ is the pulse frequency, which has a direct impact on the calibration of the sensor. Fortunately, one store on AliExpress includes details of the operating characteristics of several different flow sensors, specifically and most importantly in the present context, their flow pulse characteristics.

In particular, for the present YF‑G1 sensor (see above), 64.8 pulses are generated for each litre of water that passes through. This allows us to calculate the Flow Rate as:

Flow Rate = Pulse Count [pulses]

Time Interval [minutes] × 64.8 [pulses/L]
 L/min

Further details pending

5-11-2024