

The AS5600 Magnetic Encoder (Manufacturer Part ID: 101020692) by Seeedstudio is a high-resolution rotary encoder designed to provide precise angular position feedback. With a 12-bit resolution, it can measure angles with exceptional accuracy, making it ideal for applications requiring precise motion control. This encoder uses magnetic field sensing technology, eliminating the need for physical contact, which enhances durability and reliability.








The AS5600 Magnetic Encoder is a versatile component with the following key specifications:
| Parameter | Value |
|---|---|
| Resolution | 12-bit (4096 positions per revolution) |
| Supply Voltage | 3.3V to 5.5V |
| Current Consumption | 6.5 mA (typical) |
| Interface | I²C and PWM |
| Operating Temperature | -40°C to +125°C |
| Maximum Rotational Speed | 30,000 RPM |
| Magnetic Field Strength | 20 mT to 80 mT |
| Package | SOIC-8 |
The AS5600 has 8 pins, as described in the table below:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VDD | Power supply input (3.3V to 5.5V) |
| 2 | GND | Ground |
| 3 | OUT | PWM output for angle measurement |
| 4 | DIR | Direction selection input (high/low) |
| 5 | SDA | I²C data line |
| 6 | SCL | I²C clock line |
| 7 | PROG | Programming pin (used for configuration) |
| 8 | NC | Not connected |
Below is an example of how to interface the AS5600 with an Arduino UNO using the I²C interface:
#include <Wire.h> // Include the Wire library for I²C communication
#define AS5600_ADDRESS 0x36 // I²C address of the AS5600 encoder
#define RAW_ANGLE_REGISTER 0x0C // Register to read the raw angle
void setup() {
Wire.begin(); // Initialize I²C communication
Serial.begin(9600); // Start serial communication for debugging
Serial.println("AS5600 Magnetic Encoder Test");
}
void loop() {
uint16_t rawAngle = readRawAngle(); // Read the raw angle value
float angle = (rawAngle * 360.0) / 4096.0; // Convert to degrees
Serial.print("Angle: ");
Serial.print(angle);
Serial.println(" degrees");
delay(500); // Wait for 500 ms before the next reading
}
uint16_t readRawAngle() {
Wire.beginTransmission(AS5600_ADDRESS); // Start communication with AS5600
Wire.write(RAW_ANGLE_REGISTER); // Request the raw angle register
Wire.endTransmission();
Wire.requestFrom(AS5600_ADDRESS, 2); // Request 2 bytes of data
if (Wire.available() == 2) {
uint8_t highByte = Wire.read(); // Read the high byte
uint8_t lowByte = Wire.read(); // Read the low byte
return (highByte << 8) | lowByte; // Combine the two bytes
}
return 0; // Return 0 if no data is available
}
No Output or Incorrect Readings:
I²C Communication Fails:
PWM Output Not Detected:
Inconsistent Angle Measurements:
Q1: Can I use the AS5600 with a 3.3V microcontroller?
A1: Yes, the AS5600 supports a supply voltage range of 3.3V to 5.5V, making it compatible with 3.3V microcontrollers.
Q2: What type of magnet should I use?
A2: Use a diametrically magnetized magnet with a magnetic field strength between 20 mT and 80 mT.
Q3: How do I change the I²C address of the AS5600?
A3: The I²C address of the AS5600 is fixed at 0x36 and cannot be changed.
Q4: Can the AS5600 measure more than one full rotation?
A4: No, the AS5600 is designed to measure angles within a single 360° rotation. For multi-turn applications, additional logic is required.