

The AS5048A Magnetic Encoder Sensor Module is a high-precision magnetic encoder designed to provide 14-bit angular position data with a full 360° detection range. Manufactured by AMS, this encoder is ideal for applications requiring accurate rotational position sensing. It supports both SPI and I2C communication interfaces, making it versatile and easy to integrate into a wide range of systems.








Below are the key technical details of the AS5048A Magnetic Encoder Sensor Module:
| Parameter | Value |
|---|---|
| Manufacturer | AMS |
| Part ID | Magnetic Encoder |
| Resolution | 14-bit (16,384 steps per rotation) |
| Detection Range | 360° (full rotation) |
| Communication Interfaces | SPI, I2C |
| Supply Voltage (VDD) | 3.3V to 5.0V |
| Current Consumption | 12 mA (typical) |
| Operating Temperature | -40°C to +125°C |
| Maximum Speed | 30,000 RPM |
| Output Data Rate | Up to 1 MHz (SPI) |
The AS5048A module typically has the following pinout:
| Pin Name | Pin Number | Description |
|---|---|---|
| VDD | 1 | Power supply input (3.3V to 5.0V) |
| GND | 2 | Ground |
| SCL/CLK | 3 | I2C clock line / SPI clock input |
| SDA/MISO | 4 | I2C data line / SPI data output (MISO) |
| MOSI | 5 | SPI data input (Master Out Slave In) |
| CS | 6 | Chip Select for SPI communication |
| PWM | 7 | Optional PWM output for angle data |
| NC | 8 | Not connected (reserved for future use) |
The AS5048A can be used in a variety of applications requiring precise angular position sensing. Below are the steps and considerations for using the module:
Below is an example Arduino sketch to read angle data from the AS5048A using SPI:
#include <SPI.h>
// Define SPI pins for AS5048A
const int CS_PIN = 10; // Chip Select pin
void setup() {
Serial.begin(9600); // Initialize serial communication
SPI.begin(); // Initialize SPI
pinMode(CS_PIN, OUTPUT);
digitalWrite(CS_PIN, HIGH); // Set CS pin to HIGH (inactive)
}
uint16_t readAngle() {
uint16_t angle = 0;
// Start SPI communication
digitalWrite(CS_PIN, LOW); // Activate CS
SPI.transfer(0xFF); // Send command to read angle (MSB)
angle = SPI.transfer(0xFF); // Read MSB of angle
angle = (angle << 8) | SPI.transfer(0xFF); // Read LSB of angle
digitalWrite(CS_PIN, HIGH); // Deactivate CS
return angle & 0x3FFF; // Mask to 14 bits
}
void loop() {
uint16_t angle = readAngle(); // Read angle from AS5048A
float degrees = (angle * 360.0) / 16384.0; // Convert to degrees
Serial.print("Angle: ");
Serial.print(degrees);
Serial.println("°");
delay(100); // Wait 100ms before next reading
}
Can the AS5048A be used with 3.3V microcontrollers?
What is the maximum distance between the magnet and the sensor?
Can I use the AS5048A in high-speed applications?
Does the AS5048A support daisy-chaining for SPI?
By following this documentation, you can effectively integrate the AS5048A Magnetic Encoder Sensor Module into your projects for precise angular position sensing.