Hi Martin.
I found on www a few weeks back
------------------------------------------
Two ways to measure the flow rate
• Count the number of pulses in a known time period.
• Time the period between two pulses.
The first is easy and accurate but the more accurate you make it, the fewer measurements you make.
The second is difficult and will usually require a hardware timer but returns results fast.
Don't try to mix them by doing the second and then averaging; that just gives you the worst of both approaches.
When you need a known time period, don't try to wait for exactly 1 second (or ten seconds, or whatever).
Wait for around the right time, but use the clock-time to get the actual time that you waited. Also only read the clock and the counter once, and clear the counter close to when you do the reading or you will miss pulses.
Time-of-day jumps by an hour twice a year.
That will really screw up your measurements.
It can also jump by a few seconds if it is being corrected by NTP.
A clock with insufficient resolution will create jitter in your measurements.
Integers sometimes overflow; if you are reading the number of milliseconds since boot in a 32 bit word it will overflow after 50 days.
That's a nasty bug to find; it took Microsoft five years to recognise it.
------------------------------
Depth measurements
I have a few choices to work with PGA460, PGA460-Q1.
To buy a development board or to make one.
After I finish with the speed project, I will move (have no idea when) to the PGA460, PGA460-Q1 project.
Duration measurement between two pulses
-
viktor_aust
- Posts: 10
- http://meble-kuchenne.info.pl
- Joined: Fri May 17, 2024 1:04 am
- Has thanked: 5 times
- Been thanked: 2 times