Overview

The AS5600 is a 12-bit programmable contactless magnetic rotary position sensor manufactured by ams OSRAM. Placed directly above or below a small diametrically magnetized disc magnet attached to a rotating shaft, it measures the absolute angular position over a full 360360^\circ rotation with a resolution of 0.0870.087^\circ (4,096 positions per revolution).

Unlike mechanical potentiometers or optical encoders that suffer from physical wiper wear or dust contamination, the AS5600 operates completely contactless without mechanical friction. It provides three simultaneous output modes: an I2CI^2C interface (0x36), a 12-bit PWM output, and a ratiometric analog voltage output (10% to 90% VDD10\%\text{ to }90\%\ V_{DD}). It is widely used in robotic joint encoders, FOC brushless motor closed-loop controllers (SimpleFOC), and custom steering wheels.

Quick reference

Operating voltage (VDD)3.0 V to 3.6 V DC (3.3V mode) or 4.5 V to 5.5 V DC (5.0V mode)
InterfaceI2CI^2C Fast-Mode (up to 1.0 MHz), 12-Bit PWM, or Ratiometric Analog
Fixed I2CI^2C address0x36
Angle resolution12-bit (4,096 steps per revolution / 0.0870.087^\circ per step)
Angular range00^\circ to 360360^\circ (programmable start/end zero angles)
Magnet requirementDiametrically magnetized neodymium cylinder (e.g. 6 mm×2.5 mm6\text{ mm} \times 2.5\text{ mm})
Airgap distance0.5 mm0.5\text{ mm} to 3.0 mm3.0\text{ mm} above IC surface
Operating current6.5 mA6.5\text{ mA} active / 1.5 μA1.5\ \mu\text{A} low-power mode

Pinout (SOIC-8 Package & Breakout Header)

text
             ┌───┴───┐
          VDD ─┤ 1    8├─ VDD5V
          VDD3V3┤ 2   7├─ PGO
          OUT ─┤ 3    6├─ SDA
          GND ─┤ 4    5├─ SCL
             └───────┘
PinNameTypeDescription
1VDDPowerSupply input (+3.3V or +5V)
2VDD3V3PowerInternal 3.3V LDO output (connect to 3.3V rail or 100nF cap in 5V mode)
3OUTAnalog / PWMRatiometric analog voltage output or 12-bit PWM output
4GNDPowerGround reference (0 V)
5SCLDigital InputI2CI^2C Serial Clock
6SDADigital Input / OutputI2CI^2C Serial Data
7PGODigital InputProgramming option pin (pull Low for I2C operation)
8DIRDigital InputDirection select pin (GND = Clockwise increase, VDD = Counter-clockwise)

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply Voltage (5V Mode)VDD5VV_{DD5V}4.55.05.5VVDD3V3VDD3V3 output connected to 100nF cap
Supply Voltage (3.3V Mode)VDD3V3V_{DD3V3}3.03.33.6VVDD5VVDD5V tied to VDD3V3VDD3V3
Angle ResolutionResRes12bits4,096 counts / revolution
Angular AccuracyErrangleErr_{angle}-1.0±0.5\pm 0.5+1.0degAcross 360360^\circ at 25C25^\circ\text{C}
Sampling Ratefsamplef_{sample}55µsOutput refresh delay
Magnet AirgapGapGap0.51.53.0mmCenter alignment tolerance ±0.25 mm\pm 0.25\text{ mm}
PWM FrequencyfPWMf_{PWM}110115120Hz12-bit resolution PWM

I2CI^2C Angle Registers & Math

  • RAW ANGLE Register (0x0C0x0D): Unfiltered 12-bit angle (040950\dots 4095).
  • ANGLE Register (0x0E0x0F): Scaled 12-bit angle with zero-point offset (040950\dots 4095).

Angle (Degrees)=(12-bit Register Value4096)×360.0\text{Angle (Degrees)} = \left( \frac{\text{12-bit Register Value}}{4096} \right) \times 360.0^\circ

Angle (Radians)=(12-bit Register Value4096)×2π\text{Angle (Radians)} = \left( \frac{\text{12-bit Register Value}}{4096} \right) \times 2\pi

Wiring

AS5600 Breakout PinArduino / MCUESP32Notes
VCC5V / 3.3V3.3VPower rail
GNDGNDGNDSystem ground
SCLA5GPIO 22I2CI^2C Clock
SDAA4GPIO 21I2CI^2C Data
DIRGNDGNDConnect to GND for CW angle increase

Example (Arduino AS5600 I2CI^2C Reading)

cpp
#include <Wire.h>

const int AS5600_ADDR = 0x36;
const int RAW_ANGLE_REG = 0x0C;

uint16_t readRawAngle() {
  Wire.beginTransmission(AS5600_ADDR);
  Wire.write(RAW_ANGLE_REG);
  Wire.endTransmission();

  Wire.requestFrom(AS5600_ADDR, 2);
  if (Wire.available() >= 2) {
    uint8_t highByte = Wire.read();
    uint8_t lowByte  = Wire.read();
    return ((uint16_t)highByte << 8) | lowByte;
  }
  return 0;
}

void setup() {
  Serial.begin(115200);
  Wire.begin();
  Serial.println("AS5600 Contactless Magnetic Encoder Online");
}

void loop() {
  uint16_t rawAngle = readRawAngle();
  float degrees = (rawAngle / 4096.0) * 360.0;

  Serial.print("Raw 12-bit Count: "); Serial.print(rawAngle);
  Serial.print(" | Angle: "); Serial.print(degrees, 2); Serial.println("°");

  delay(100);
}

Common mistakes

  • Using axially magnetized magnets: The AS5600 requires a diametrically magnetized disc magnet (north and south poles split across the circular face side-by-side). Using a standard axial magnet (poles top and bottom) will result in static readings.
  • Incorrect power pin wiring (3.3V vs 5V): For 5V operation, supply 5V to VDD5V and place a 100 nF100\text{ nF} capacitor on VDD3V3. For 3.3V operation, short VDD5V directly to VDD3V3.

Notes

  • AS5600 vs AS5048A: AS5600 uses I2CI^2C/Analog/PWM (0.0870.087^\circ accuracy); AS5048A uses high-speed SPI (0.02190.0219^\circ 14-bit accuracy).

Assets & downloads