I'm designing my own rotary encoder using magnets and a Hall-effect sensor.
I'm not getting the linear output I was hoping for. I'm using two magnets and putting the sensor in the middle - like this:
ns X ns
ns is the magnets, and the
X is the sensor. I do get the middle value when it's in neutral position, and the minimum/maximum value when it's 90 degrees to each side (trying for a full 180 degree encoder). But the values in between is more logarithmic then linear.
When looking at the data sheet for any Hall-effect sensor it shows a linear output based on gauss. I have no idea how this Hall effect works and if I should expect a linear gauss based on angle and therefore a linear output.
At this point I'm hoping it's my cheap-directly-from-china-components that are bad so if I buy locally I will automagically get the result I'm looking for.
If this is how Hall effect sensors are supposed to behave then it simply cannot be used in a rotary encoder and I have to go for potentiometers.
EDIT: As requested - a photo:
The outer ring with the magnets are rotating while the sensor is stationary. It can rotate indefinitely, but I'm only interested in 180 degrees.