DEV Community

FallingDownCat
FallingDownCat

Posted on • Originally published at fallingdowncat.com on

AS5600 Magnetic Encoder

AS5600 Magnetic Encoder

First goal with AS5700 was to track the movement of a stepper motor, but as i dug in tutorial it seems that the IC is not meant for it. It works great for tracking the rotation of the motor shaft, but magnetic encoders are used in those rotating dials that can rotate in both direction indefinitely.

AS5700 goes for about 3 EUR for 3 x ICs, on AliExpress.

AS5600 Magnetic Encoder

It comes with a small magnet that you glue to the shaft of the stepper motor. For doing so i recommend using tweezers and superglue, and a lot of patience.

AS5600 Magnetic Encoder

After that we need to set that small chip just under the magnet. I did that by printing a stand for AS5700 that i found on Thingiverse. Great thing about that particular 3D model is that it requires no screws.

AS5600 Magnetic Encoder

Wiring for Arduino uno R4:

VCC -> 5V/3V

GND -> GND

SCL -> A5

SDA -> A4

That's for communicating over I2C protocol, and I'm pretty sure it can be done in another way but i never did that. For the coding part there is a great library by Adafruit called Adafruit AS5600 Library... When said library is installed among Examples should be an example for basic reading of the magnetic position.

And that's it, the setup is working.

Top comments (0)