Component guide · Intermediate · 4 min read
Magnetic Angle Encoders

AS5600 12-bit Module and Grove AS5600, MT6701 and MT6816 (XJX-134, XJX-135), MT6835 21-bit SPI, Infineon TLI5012B, TE KMT39 AMR and OE-28 and OE-37 Hall Motor Encoders
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
A magnetic encoder reads the angle of a small diametric magnet spun above the chip, so it is contactless and does not wear. AS5600 gives 12 bits over I2C, analog or PWM and is the easy start. MT6701 and MT6816 add SSI and ABZ outputs, and MT6835 gives 21 bits for gimbal and FOC motor control. OE-28 and OE-37 are Hall A/B encoders for gear motors.
Key specs at a glance
- AS5600
- 12-bit, I2C 0x36, analog or PWM out
- MT6701 / MT6816
- 14-bit, I2C/SSI, ABZ and PWM
- MT6835
- 21-bit, SPI, ABZ and UVW
- TLI5012B
- 15-bit GMR, SSC/SPI
- KMT39
- AMR, analog bridge output, ±0.2°
- Magnet
- Diametric, 4-6mm, 0.5-3mm air gap
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1AS5600 Magnetic Encoder Sensor Module – 12-bit, I2C/PWM/Analog Output₹144
Option 2Seeed Studio Grove AS5600 12-bit Magnetic Rotary Position Sensor – I2C/PWM/Analog Output₹749
Option 3MT6835 Magnetic Encoder Module PWM/SPI Brushless Motor 21BIT Encoder with 4x2mm Magnet₹729
Option 4MagnTek MT6835 Magnetic Encoder Module PWM/SPI 21BIT Absolute Angle Sensor with Magnet – ABZ/UVW Output₹619
Option 5MagnTek MT6835 Magnetic Encoder Module – 21BIT Absolute AMR Encoder with SPI/PWM/ABZ/UVW Outputs₹729
Option 6XJX-134 MT6701 Magnetic Rotary Encoder Module – IIC/ABZ/PWM/SSI₹249
What the Magnetic angle encoders: AS5600, MT6701, MT6816, MT6835, TLI5012B, KMT39 and OE-28/OE-37 is
Magnetic angle encoders such as the AS5600 (12-bit) and MT6835 (21-bit) read the angle of a diametric magnet on a shaft without contact, for motors, knobs and robot joints.
Use them for FOC brushless gimbal motors (SimpleFOC supports AS5600, MT6701 and MT6835), robot joints, knobs that never wear out and steering angle. Glue a diametrically magnetised magnet to the end of the shaft, centred over the chip, with the gap from the data sheet.
AS5600 runs on 3.3V or 5V; set the DIR pin for the rotation direction you want. The OE-28 and OE-37 boards fit motor shafts and give two-channel pulses, so read them like any incremental encoder.
Magnetic angle encoders: AS5600, MT6701, MT6816, MT6835, TLI5012B, KMT39 and OE-28/OE-37 pinout
The pins on the Magnetic angle encoders: AS5600, MT6701, MT6816, MT6835, TLI5012B, KMT39 and OE-28/OE-37 and what each one does.
| Pin | Function |
|---|---|
| VCC | 3.3V or 5V by board |
| GND | Ground |
| SDA / SCL | I2C (AS5600, MT6701) |
| CS / SCK / MISO / MOSI | SPI (MT6835, TLI5012B 3-wire) |
| OUT / A / B / Z | Analog, PWM or ABZ outputs |
| DIR | Direction select on AS5600 |
- VCC
- 3.3V or 5V by board
- GND
- Ground
- SDA / SCL
- I2C (AS5600, MT6701)
- CS / SCK / MISO / MOSI
- SPI (MT6835, TLI5012B 3-wire)
- OUT / A / B / Z
- Analog, PWM or ABZ outputs
- DIR
- Direction select on AS5600
Wiring the Magnetic angle encoders: AS5600, MT6701, MT6816, MT6835, TLI5012B, KMT39 and OE-28/OE-37
Centre the magnet within about 0.25mm of the chip axis for best accuracy.
| Magnetic angle encoders: AS5600, MT6701, MT6816, MT6835, TLI5012B, KMT39 and OE-28/OE-37 pin | Connection | Note |
|---|---|---|
| VCC | 3.3V | ESP32 3V3 |
| GND | GND | Common |
| SDA | GPIO21 | I2C |
| SCL | GPIO22 | I2C |
| DIR | GND | Clockwise increases |
- VCC
- Connection:
- 3.3V
- Note:
- ESP32 3V3
- GND
- Connection:
- GND
- Note:
- Common
- SDA
- Connection:
- GPIO21
- Note:
- I2C
- SCL
- Connection:
- GPIO22
- Note:
- I2C
- DIR
- Connection:
- GND
- Note:
- Clockwise increases
Example code
Register 0x0B (STATUS) tells you if the magnet is too weak, too strong or missing.
#include <Wire.h>
const uint8_t AS5600 = 0x36;
uint16_t readAngle() {
Wire.beginTransmission(AS5600);
Wire.write(0x0E); // ANGLE register (high byte)
Wire.endTransmission(false);
Wire.requestFrom(AS5600, (uint8_t)2);
uint16_t hi = Wire.read(), lo = Wire.read();
return ((hi << 8) | lo) & 0x0FFF;
}
void setup() { Serial.begin(115200); Wire.begin(21, 22); }
void loop() {
Serial.println(readAngle() * 360.0 / 4096.0, 2);
delay(50);
}Setup and tuning
use a diametrically magnetised magnet centred over the chip at 0.5 to 3 mm.
AS5600 uses I2C or analog/PWM output; MT6835 uses SPI for high speed.
3.3 V or 5 V depending on the board.
set the zero position in code or the chip's settings.
keep the magnet centred; offset causes errors.
What you need
Shop this list14 of 14 found in our store · ₹5,620
Generic AS5600 Magnetic Encoder Sensor Module – 12-bit, I2C/PWM/Analog Output: the part this guide coversAS5600 Magnetic Encoder Sensor Module – 12-bit, I2C/PWM/Analog Output₹144
Seeed Studio Studio Grove AS5600 12-bit Magnetic Rotary Position Sensor – I2C/PWM/Analog Output: another version this guide coversSeeed Studio Grove AS5600 12-bit Magnetic Rotary Position Sensor – I2C/PWM/Analog Output₹749
MT6835 Magnetic Encoder Module PWM/SPI Brushless Motor 21BIT Encoder with 4x2mm Magnet: another version this guide coversMT6835 Magnetic Encoder Module PWM/SPI Brushless Motor 21BIT Encoder with 4x2mm Magnet₹729
MagnTek MT6835 Magnetic Encoder Module PWM/SPI 21BIT Absolute Angle Sensor with Magnet – ABZ/UVW Output: another version this guide coversMagnTek MT6835 Magnetic Encoder Module PWM/SPI 21BIT Absolute Angle Sensor with Magnet – ABZ/UVW Output₹619
MagnTek MT6835 Magnetic Encoder Module – 21BIT Absolute AMR Encoder with SPI/PWM/ABZ/UVW Outputs: another version this guide coversMagnTek MT6835 Magnetic Encoder Module – 21BIT Absolute AMR Encoder with SPI/PWM/ABZ/UVW Outputs₹729
Generic XJX-134 MT6701 Magnetic Rotary Encoder Module – IIC/ABZ/PWM/SSI: another version this guide coversXJX-134 MT6701 Magnetic Rotary Encoder Module – IIC/ABZ/PWM/SSI₹249
Generic XJX-135 MT6816 Magnetic Rotary Encoder Module – I2C/ABZ/PWM/SSI, 256 PPR: another version this guide coversXJX-135 MT6816 Magnetic Rotary Encoder Module – I2C/ABZ/PWM/SSI, 256 PPR₹339
Infineon Technologies Technologies TLI5012BE1000 DSO-8 Magnetic Angle Sensor: another version this guide coversInfineon Technologies TLI5012BE1000 DSO-8 Magnetic Angle Sensor₹219Closest match, check the specs
TE Connectivity KMT39 Magnetic Angle Sensor, AMR, 10~12.5 mV/V Output, ±0.2° Accuracy, 5V Supply, -40°C to +150°C: another version this guide coversTE Connectivity KMT39 Magnetic Angle Sensor, AMR, 10~12.5 mV/V Output, ±0.2° Accuracy, 5V Supply, -40°C to +150°C₹439
OE-28 Hall Effect Two Channel Magnetic Encoder – Plastic Case, Magnet & Cable: another version this guide coversOE-28 Hall Effect Two Channel Magnetic Encoder – Plastic Case, Magnet & Cable₹449
OE-37 Hall Effect Two Channel Magnetic Encoder – Module w/ Mounting Hardware: another version this guide coversOE-37 Hall Effect Two Channel Magnetic Encoder – Module w/ Mounting Hardware₹449
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Solderless breadboard: to build without solderingSolderless Breadboard₹68
Alternatives and when to choose them
- Hall effect sensor ICs: switches and linear Hall.
- Absolute industrial encoders: sealed industrial units.
- Motor encoders: gear motor feedback.
Common mistakes to avoid
- Using an axially magnetised magnet.
- Magnet off centre.
- Magnet too far away.
- Ignoring the AS5600 direction pin.
Frequently asked questions
What magnet do I need for an AS5600?
A diametrically magnetised disc magnet, often 6 mm across.
How far should the magnet be?
About 0.5 to 3 mm above the chip, centred.
What resolution does the AS5600 give?
12 bits, which is 4096 steps per turn, or about 0.09° per step.
Why use the MT6835 instead?
It has 21-bit resolution and fast SPI for precise motor control.
Why are the readings noisy?
The magnet is off centre, too far, or vibrating.
Parts for this guide
- ₹144View
- ₹749View
- ₹729View
MagnTek MT6835 Magnetic Encoder Module PWM/SPI 21BIT Absolute Angle Sensor with Magnet – ABZ/UVW Output₹619View- ₹729View
- ₹249View
- ₹339View
- ₹219View
TE Connectivity KMT39 Magnetic Angle Sensor, AMR, 10~12.5 mV/V Output, ±0.2° Accuracy, 5V Supply, -40°C to +150°C₹439View- ₹449View
- ₹449View
- ₹389View
- ₹49View
- ₹68View
Projects that use it
Put this into practice: 9 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.
