water flow sensor YF-B5

  • Hi,

    I would like to use YF-B5 water flow sensor with default mysensors water-meter sketch. I need help getting correct PULSE_FACTOR value based on below specs:

    1 Appearance Product identification clear, accurate and meet the requirements
    2 water pressure> 1.75MPa
    3 Operating voltage range DC5 ~ 15V
    4 Insulation resistance> 100MΩ
    5 Accuracy (in 1 ~ 25L \ MIN) ± 3%
    6 Flow Pulse Characteristics (6.6 * Q) Q = L / Min ± 3%
    7 Output pulse high> DC 4.7V (input voltage DC 5V)
    8 Output pulse low level <DC 0.5V (input voltage DC 5V)
    9 Output pulse duty cycle 50% ± 10%

    #define MY_DEBUG
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_NRF5_ESB
    //#define MY_RADIO_RFM69
    //#define MY_RADIO_RFM95
    #include <MySensors.h>
    #define DIGITAL_INPUT_SENSOR 3                  // The digital input you attached your sensor.  (Only 2 and 3 generates interrupt!)
    #define PULSE_FACTOR 1000                       // Number of blinks per m3 of your meter (One rotation/liter)
    #define SLEEP_MODE false                        // flowvalue can only be reported when sleep mode is false.
    #define MAX_FLOW 40                             // Max flow (l/min) value to report. This filters outliers.

  • Mod

    @niccodemi the default water meter sketch measures water volume in m3, this sensor measures water flow in l/min.
    Here you can find an example of how to convert flow sensor output to volume.

  • @yveaux is there any way to convert flow in l/min to pulses per liter?

    Another user posted below info; is that accurate?

      • Flow meter using Honeywell C7195A2001B which has a hall sensor that pulses at 7 Hz per liter/min
    • we count only upgoing pulses, so in our case we get:
    • 7 pulses per second at 1 l/min
    • 420 pulses per liter
    • 420000 pulses per m3
    • Flow meter Caleffi 316 which has a hall sensor that pulses at 8.8 Hz per liter/min (according to specs)
    • In reality the frequency is about 30% lower in my case, so we have to correct this with a factor of 1.3.
    • 8.8 pulses per second at 1 l/min
    • 528 pulses per liter
    • 528000 pulses per m3
    • 528000/1.3 = 406154

  • Mod

    @niccodemi said in water flow sensor YF-B5:

    convert flow in l/min to pulses per liter

    You can; read the example code I pointed to. And as always, Google is your friend


Suggested Topics