2024-02-12 06:21 AM
Hi,
I have question, I wanted to check whether a condition has reached below threshold level. How many check do I need to do whether it has reached the level below. Does it need to be three check or do a 20 check and average out to see if it below that level. Is there better way of doing ? alogortihm perhaps.
2024-02-12 06:25 AM
Hello,
Do you mean a reading from ADC?
2024-02-12 06:28 AM
That all depends entirely on your particular situation, application, and requirements - you haven't given enough information to make any specific suggestions.
2024-02-12 08:08 AM
Thanks for the reply. I am measuring liquid level. if it below the level with sensor readings. whether it has reached low level from the sensor.
2024-02-12 08:19 AM
So think about the nature of the signal you're getting, and the nature of the system you're controlling:
2024-02-12 11:42 AM
Yes, the signal spikes up and down suddenly. Yes it matter if the low indication a bit early. Because I am trying to measure the liquid ion level below the level. and it needs to be low enough for the test.
2024-02-12 12:00 PM
Hi Andrew,
Will it work if it implemented as a moving average as a condtion check
2024-02-12 01:08 PM
It definitely might work, depending on how bad the errors are.
If you are getting bad readings from a sensor of any kind, it would be better to address that problem directly rather than put a bandaid on it with an averaging scheme. Why are you getting bad readings? How do you know you can trust the other readings that aren't bad?
2024-02-12 01:29 PM
Thank you for reply. I am looking for stable conditon when its reached the below the level that I require. And then for example taking 20 readings reading and average it to see level is below.
2024-02-12 02:00 PM
Averaging 20 readings will definitely improve the accuracy of the result, if the level is stable. If you have the liberty of taking many readings, for instance if your application doesn't see fast changes in fluid level, it seems smart to average many readings together to improve accuracy.
But it really depends on your application, maybe this improvement isn't buying you anything.