I have been trying to Get stable Reading for My Ground tank Water Level Measurement.But ultrasonic sensor output sometimes swings…more than 10% of its value.
An easy way would be using rrd4j to do that.
Look how you configured the rrd4j archives (or do you use the default?).
The archive 2 and following compute their values from the minute-wise readings, that computing could be an average. By configuring an archive that condenses 10 readings into 1 you could get what you want.
BTW: I like the setup of rrd4j with Grafana and NOT InfluxDB.
I think this can be handled in Grafan as well. I can’t get to my Grafana right now for some reason but when you add the data to the graph, one of the fields lets you define a function that will let you smooth spikes like these.
I bet many would appreciate a tutorial on how to set that up. Since rrd4j is an embedded database it isn’t immediately clear how one would connect Grafana to it.