zdayton wrote:This is important because if you put this magnet in the center of a shaft and rotate it, there is not any change of the magnetic field relative to the sensor. I know because I made this exact mistake. One other important thing I learned is that the output of the sensor is affected by the rotation of the magnet as well as the position of the magnet relative to the sensor. This becomes important if the sensor is not exactly lined up with the center of the shaft (It won't be) because the rotation of the magnet gets compounded with the change in position relative to the sensor, and the measurements get crappy. What I found was that I got the cleanest measurements when I intentionally offset the magnet by a large amount, and lined up the poles so the rotation of the magnet would not affect the sensor, only the position of the magnet.
I haven't gotten to testing my sensors in actual use yet, so I'm not sure what my findings will be, but I'm a little surprised you had issues with having the sensor in-line with the magnet on the shaft. Did you get any diametrically opposed magnets to try (with the N and S poles along the face of the cylinder)? All examples of the angular encoders I thought you were using seem to suggest this is how you set things up, I didn't realize they'd be that sensitive to being off-center slightly.
It's an interesting idea to mount the magnet in the pivot arm, I hadn't considered that. Where will you mount your sensor? I'm interested in seeing your new designs! My thought for using an off-center magnet with the ratiometric sensors was to mount them in my shaft collar. My goal then was to mount the sensor towards the base, allowing the rotation of the shaft to move the magnet closer to the sensor. I think this should work to give me clean output, but I still need to set up and test it. The other option would be to have the sensor inline with the center of rotation of the shaft, and have the shaft collar mounted magnets rotate around it. That's more in-line with the Bic pen example a few of us have referenced.
I also got a couple of samples of these that I may try out if I can fab some breakout boards for them. You can request free samples of those parts, though you can only get 2 at a time.