06-09-2022 09:47 AM - edited 06-09-2022 09:59 AM
You need to decide how quickly the pressure can possibly change and how often you really need to measure it. My guess is that a few times per second would be plenty!
Having a loop without timing, spinning as fast as the code allows is not reasonable because now the result will strongly depend on the hardware. It never should.
(Many years ago, I implemented a pressure jump controller that allowed changing from any pressure to any other pressure within milliseconds while doing EPR measurements. Pressures up to 7-8x higher than at the bottom of the Mariana trench! Here we needed a very fast rate, of course. That's a very different story. 😄 )
06-09-2022 11:31 AM
from the datasheet the response time is 1ms should I put the timing of my loop like that?
06-09-2022 01:26 PM
That's just the fastest you can go doing everything else right. How quickly does the pressure typically change? If you measure one pressure value and another 1ms later, how much different do you expect it to be and would that difference be a noteworthy result?
06-10-2022 07:42 AM - edited 06-10-2022 07:50 AM
I've been trying to measure the atmospheric pressure and it is giving the wrong measurements I guess
06-10-2022 09:22 AM - edited 06-10-2022 09:26 AM
We can't really debug blurry, truncated pictures.
How is the gauge calibrated?
What are the pressure units?
What is the raw data received from the sensor?
Did you read all the footnotes of the datasheet?
How is everything connected?
...