I am working on a project in which I have to read data from liquid level sensor installed in tank which measures fluid level and sends output in millivolt. The device has predefined ranges of voltage to decide fluid level from voltage. The tank might be fitted on moving vehicle as well. I have to represent this data on graph.
Now, the problem is that the data sent by some devices is very fluctuating as you can see in below screenshot.
In order to show smooth line, I used linear regression by creating bunch of 30 minute duration data and applied it on each bunch.
The result is as below.
As you can see, linear regression works pretty well and gives me smooth line but, the problem is that the refill event is delayed by hours.
So, my question is what are the possible methods which I can use to by which I can show smooth line and refill events on actual time as well?