Measuring water flow with UniPi

  • Hello,
    I need advice which REXYGEN system function block to use for water flow measurement. The sensor is connected to my UniPi v1.1 and gives me input 200-400Hz (according to the flow). I need to measure the flow every second. I tried using the COUNT block, but no success. Illustrative image is attached.
    Thank you in advance for your help.

  • administrators

    Hi Karel,
    the COUNT function block is definitely a good choice, however you should be aware of project timing because of quite high input frequency. I recommend you to have a look at example "0120-23 Frequency of Pulses". Change the project timing so the "tick" parameter is 0.001 s (within the EXEC function block) and "ntick0" according to your needs.
    It means that Quick Task will be executed every 1 ms and task on Level0 every 0.001*ntick0 [s].

    Note that the period of 1ms is quite challenging for Raspberry Pi. I would recommend to use Raspberry Pi 3B+ and watch diagnostics.

    Hope it helps.

    Regards, Tomas