

The Adafruit AS5600 Magnetic Angle Sensor (Part ID: 6357) is a high-resolution sensor designed to measure precise angular positions using a magnetic field. This sensor leverages I2C communication, making it simple to integrate with microcontrollers such as Arduino and Raspberry Pi. Its compact design and high accuracy make it ideal for applications in robotics, automation, motor control, and position sensing.








The following table outlines the key technical details of the Adafruit AS5600 Magnetic Angle Sensor:
| Parameter | Value |
|---|---|
| Supply Voltage | 3.3V to 5.5V |
| Operating Current | 6.5 mA (typical) |
| Communication Protocol | I2C |
| I2C Address (Default) | 0x36 |
| Resolution | 12-bit (4096 positions per 360°) |
| Measurement Range | 0° to 360° |
| Output Modes | I2C or PWM |
| Operating Temperature | -40°C to +125°C |
| Dimensions | 20mm x 20mm x 3mm |
The AS5600 sensor has the following pinout:
| Pin | Name | Description |
|---|---|---|
| 1 | VIN | Power supply input (3.3V to 5.5V) |
| 2 | GND | Ground |
| 3 | SDA | I2C data line |
| 4 | SCL | I2C clock line |
| 5 | OUT | PWM output (optional, for analog angle output) |
| 6 | DIR | Direction input (used for clockwise/counterclockwise) |
To use the AS5600 with an Arduino UNO, follow these steps:
The following code demonstrates how to read the angular position from the AS5600 sensor using I2C communication:
#include <Wire.h>
#define AS5600_I2C_ADDRESS 0x36 // Default I2C address for AS5600
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Start serial communication for debugging
Serial.println("AS5600 Magnetic Angle Sensor Test");
}
void loop() {
uint16_t angle = readAngle(); // Read the angle from the sensor
Serial.print("Angle: ");
Serial.print(angle * 0.0879); // Convert to degrees (12-bit resolution)
Serial.println("°");
delay(500); // Wait for 500ms before the next reading
}
// Function to read the angle from the AS5600 sensor
uint16_t readAngle() {
Wire.beginTransmission(AS5600_I2C_ADDRESS);
Wire.write(0x0E); // Address of the angle register (MSB)
Wire.endTransmission();
Wire.requestFrom(AS5600_I2C_ADDRESS, 2); // Request 2 bytes (MSB + LSB)
if (Wire.available() == 2) {
uint8_t msb = Wire.read(); // Most significant byte
uint8_t lsb = Wire.read(); // Least significant byte
return (msb << 8) | lsb; // Combine MSB and LSB into a 16-bit value
}
return 0; // Return 0 if no data is available
}
No data is being read from the sensor.
Incorrect angle readings.
The sensor is not detected on the I2C bus.
Q: Can the AS5600 measure angles beyond 360°?
A: No, the AS5600 measures angles within a 0° to 360° range. However, you can track multiple rotations in software by monitoring changes in the angle readings.
Q: Can I use the AS5600 with a 3.3V microcontroller?
A: Yes, the AS5600 is compatible with both 3.3V and 5V systems.
Q: What type of magnet should I use with the AS5600?
A: Use a diametrically magnetized cylindrical magnet with a diameter of 6mm to 8mm for best results.
Q: Does the AS5600 support SPI communication?
A: No, the AS5600 only supports I2C and PWM output modes.
By following this documentation, you can effectively integrate the Adafruit AS5600 Magnetic Angle Sensor into your projects for precise angular position measurements.