Sekdiy flowmweter sketch not working with Arduino ProMicro

Dear All,
I have I rather lengthy code to monitor some variables in a water reservoir and transmit the info to my house using nRF24L01+.
It took a lot of time to get all the "pieces" of the code working properly.
Although I managed to read and transmit all the variables I need properly, I realized, to my surprise, that the flow measurement is totally off.
The actual flow value is 4.5 l/min and the reading is 47.0-48.5 l/min
I am using the Sekdiy FlowMeter and a YF-S201 to measure the flow, and I have checked the value of the calibration constant, kf, which is 8.0.
I suspect that the problem lies in the use of INT6, which is associated with board pin 7.
I have tried the following:
#1 attachInterrupt(digitalPinToInterrupt(interruptPin), Meter1ISR, RISING); (interruptPin=7)
#2 attachInterrupt(4, Meter1ISR, RISING);

But the readings are about 10 times higher than the actual value.
The complete code is attached.
Any ideas?

Cisterna_rev1.ino (10.3 KB)

You should unpack the program, take out everything that doesn't have to do with the flowmeter, to isolate the problem and make it feasible for other people to troubleshoot it here. This isn't a criticism, because some programs do become large, but now that you are in trouble, you need a minimum program that will demonstrate the problem.

Also you need to explain more about this "calibration constant". How did you "check" it?

Hi,
Thank you for your reply.
I apologize for the complexity of the program but I was in a hurry to get results, since this setup was used to monitor the water reservoirs "conditions" from the house I have moved in"

Here is the explanation of the "calibration constant", given before in this forum (no one was interested at that time).

quote
"I decided to check if I could apply a correction factor to the displayed value (without knowing what is happening).
I grabbed a signal generator, applied a rectangular signal to pin 7 and varied the frequency of the signal applied to the input to mimic the output of the hall effect sensor.

The "flow" was the number displayed on the LCD.
These are the results I obtained:
frequency flow
10 15,5
20 31
30 46,5
40 62
50 77,5

This is a perfectly linear relationship where Flow(l/m) = 1.55 Freq(Hz)

So I decided to apply a correction factor and move on without knowing the explanation.

Unquote

Note "Since I have to measure the flow value using this flow sensor and sketch I came to realize that this "calibration constant" varies.
Since the the Arduino board and sensor used are the same, I came to the conclusion that is "software dependent".

As mentioned, your best chance of getting help is to make an MRE. Doing so may even help you to find the problem yourself.

According to your datasheet link, 16Hz should be 2 LPM and 82Hz, 10 LPM or about 490 pulses per liter.