Serial programming hall sensor using Manchester Encoding?

Hi everyone,

I’m trying to use a hall sensor(s) to determine the angular position of a rotating gear (about 4cm in diameter). I’m not entirely sure the best way to do this, but am considering creating a ring of magnets near the circumference of the gear and just counting the pulses using a hall sensor as the gear rotates.

I found this Allegro A1377 hall sensor, and the data sheet says I can program its voltage output range and sensitivity. The default voltage (no magnetic field) output is 2.5 volts when plugged into the Arduino Nano, and it increases the output by 6mV per Gauss by default.

To program it to do something different (e.g 14mV/Gauss), page 15 of the data sheet says I need to program it using a serial connection and Manchester encoding.

Data sheet:

So my main question is: is there a readily available guide or program that would allow me to use the arduino to re-program the hall sensor?

But more broadly, I’m just looking to measure the gear position, so if you have an alternative suggestion I am open!

Thank you!

what level of accuracy do you need? That chip seems like a pretty high-end hall sensor vs. one that is either on/off. Normally, you would use a rotary encoder on the gear shaft. Is that possible?

Thank you! Hmm maybe a rotary encoder is what I need. I will look into it a bit more. Accuracy doesn’t have to be too crazy.. it would be nice to be within 2 degrees accurate of the rotation of the gear.