Fuel level meter

What is the solution so that the fuel level indicator does not oscillate so much with movements of the vehicle with the fuel swinging inside the tank, that it only changes after a certain time doing that same reading? Thank you.

SMOOTHING 99.92

It was not yet necessary to correct, it would be something that would only change on the panel, if the value remains for a certain time, like 1 minute, if after 1 minute the value is constant, it would change on the panel, thus avoiding that in a sharp curve, the fuel moving in the tank, make the float indicate a different value than the real one, and the panel changes after a few seconds.

explain easier. the translation of what you wrote is so terrible that it is not possible to read it

Let’s say I have 30 liters in the tank that can fit 60 liters. The meter will show half the tank. When making a curve, brake, accelerate, stop on a slope, the fuel moves, changing the position of the float, changing the value of the meter. In the old, analog dials, there was a resistance that warmed up and made the hand move. So sudden movements were not able to move the pointer instantly. It was necessary for the buoy to stay in that position for a longer time so that the resistance would increase the heating or cool down. On newer dials, this process is done electronically. So what I’m trying to say, would be to analyze the measured value, and if he makes sudden movements, he doesn’t move the meter instantly, he only changes the meter, if the new value remains for a certain time, as if it were an update to every minute, and within that minute, he averages, discarding variation values ​​above 5%, 10%, as examples.

If you mean reading the readings is not instantaneous, but at some period of time, for example once a second, then this is bad practice. I already went through this. there is no guarantee that at the time of reading the data will be at the same level. In practice, when driving a car, it looks something like this:
interrogation of the sensor every 100ms - 30L … 29 … 28 … 27 … 26 … 27 … 28 … 29 … 30 … 31 … 32 … 33L
etc. everything fluctuates around 30 liters very quickly.
polling the burner sensor once a second -
30L … … 32 …
data will not be more reliable from this.
I have already tried.
the only output that simulates the “heating of the resistor” as on the analog systems of the past decades is the parameter “SMOOTING”, and continuous data in the real world.
I repeat, no average arithmetic calculations on the controller will give you the smoothness and accuracy of the fuel.
unless you assemble a delay circuit before the ADC. But this will also distort the fuel level data.

One reading per second could be taken, added together, and then divided by 60, and updated once a minute, the variation would be minine.

You can try any options, I just refer to my practice in setting.
I added a video on how this is done with me. this is the only thing that suited me.
https://youtu.be/HV3TOaQ6Quc