Skip to main content
cjaya.2
Associate III
February 12, 2024
Solved

condition check below low level

  • February 12, 2024
  • 2 replies
  • 2429 views

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.

 

Best answer by TDK

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.

2 replies

mƎALLEm
Technical Moderator
February 12, 2024

Hello,

Do you mean a reading from ADC?

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Andrew Neil
Super User
February 12, 2024

That all depends entirely on your particular situation,  application, and requirements - you haven't given enough information to make any specific suggestions.

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
cjaya.2
cjaya.2Author
Associate III
February 12, 2024

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. 

Andrew Neil
Super User
February 12, 2024

So think about the nature of the signal you're getting, and the nature of the system you're controlling:

  • How quickly does the signal change?
  • Does the signal "jitter" up and down?
  • Does it matter if you give a "low" indication a bit early/late?
  • etc, etc, ...
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.