Average sensor value. I need Help

yasko

Member
Join Date
Jun 2008
Location
SZ
Posts
9
Ok I need a little advice. I'm using ML1200 and pressure sensor to calculate water level in one tank. When tank is in lowest level water fall and make a waves and they make my sensor incorrect. I want to take values each .1 or .2 seconds up to 20-30 values to calculate average and use it in my program. I tried few ways but no success :( any advices or suggestions ?
 
Have you tried searching this forum? There have been several threads dealing with this exact issue. Search for moving averages, FIFO etc.
 
Alaric said:
Instead of averaging you could try a first order lag filter. Less programming and CPU resources.

Ditto, heres what I use.

FV=FV+C(NV-FV)
Where:
FV= Filtered value
C= constant (range 0.0-1.0) The smaller the number the more dampening.
NV= New Value
 

Similar Topics

Does this instruction calculate values during a single scan, or does it require number of scans based on element count in the array? For Example...
Replies
3
Views
112
I am working on a program in Cscape to take a pulse input from a flow meter and output an average of the last 5 minutes of flow and total flow to...
Replies
1
Views
573
I am storing values into an array. I am wanting to find an average of the highs and an average of the lows. Something like this... After 50...
Replies
36
Views
8,839
I need to keep a running pass/fail yield of the previous 5,000 parts produced. I have used this formula before to calculate average: AvgValue =...
Replies
6
Views
2,151
is it possible to capture a value while its constantly changing then taking its highest reading? I have a nozzle that sprays for 10 seconds. I...
Replies
14
Views
3,434
Back
Top Bottom