I'm using a hall effect sensor A1356 (linear application) to measure the amount of fluid in a container. The fluid is in constant use. My doubt is I'm placing the sensor and the magnet assembly in place, such that when it is exactly half filled, the magnet's center will align with the center of the sensor. In this condition I get 100% duty cycle output from the sensor.
Condition 1: If the fluid is filled then the magnet moves above the sensor and the duty cycle reduces say to 90%.
Condition 2: If the fluid is consumed then the magnet will move below the sensor and the duty cycle reduces to say 90%.
How do I differentiate between the rise and fall of the fluid? Or is there a better way of orienting the magnet and the sensor such that this problem could be avoided?
I'm interfacing it with an Arduino UNO