A magnetic angle sensor is a contactless electronic device used to measure the rotational position of a shaft or object. It works by detecting the orientation of a magnetic field—usually from a small permanent magnet attached to the rotating part—and converting that physical position into a digital or analog signal.
How It Works
Technical Comparison of Several Typical Magnetic Angle Sensors
| Feature | AS5047P | AS5600 | MT6701 | MT6816 | MT6835 | TLE5012B |
|---|---|---|---|---|---|---|
| Max Resolution | 14-bit (SPI) | 12-bit (I²C) | 14-bit (I²C/SSI) | 14-bit (SPI) | 21-bit (SPI) | 15-bit (SSC/SPI) |
| Interfaces | SPI, ABI, UVW, PWM | I²C, PWM, Analog | I²C, SSI, ABZ, UVW, PWM | SPI, ABZ, UVW, PWM | SPI, ABZ, UVW, PWM | SSC (SPI), IIF, HSM, PWM |
| Max Speed (RPM) | 28,000 | Low speed (potentiometer) | 55,000 | 25,000 | 120,000 | ~10,000+ |
| Latency | < 1 µs (DAEC) | High (I2C) | < 5 µs | < 2 µs Ultra-low | Low | |
| Accuracy (Typ) | ±0.34° at speed | ±0.5° (static) | ±1.0° | High precision | Micro-level | ±1.0° |
| Best For | High-speed BLDC | Contactless Knobs | General Purpose | Standard Robotics | High-end Servo | Automotive/Industrial |
Key Product Highlights
The MagnTek MT6816 is a high-speed, 14-bit magnetic angle sensor IC based on advanced Anisotropic Magnetoresistive (AMR) technology. It is specifically designed to provide absolute 0°–360° angle sensing for high-performance applications like BLDC motor control and robotics.
Core Technical Specifications
According to official technical documents from MagnTek and Novosense, the sensor features the following primary specifications:
MT-6816 Pinout
| Pin | Pin Name | Type | |
|---|---|---|---|
| 1 | CSN | Input | Chip Select (Active Low) for SPI communication |
| 2 | SCK | Input | Serial Clock input for SPI |
| 3 | SDO | Output | Serial Data Output (MISO) for SPI |
| 4 | SDI / SDA | I/O | Serial Data Input (MOSI) for 4-wire SPI, or Data I/O for 3-wire SPI |
| 5 | TEST / PWM | Output | PWM absolute angle output; also used as a factory test pin |
| 6 | OUT / Z / W | Output | Z-index for ABZ mode, or W phase for UVW mode |
| 7 | VSS | Power | Ground (0V) |
| 8 | VDD | Power | Supply Voltage (3.0V to 5.5V) |
Pin Functionality by Mode
The output pins (Pins 5 and 6) and the SPI pins change behavior based on your interface choice:
Connection Notes
Arduino example
To read the 14-bit absolute angle from the MagnTek MT6816 using an Arduino, you use the SPI interface. The sensor requires SPI Mode 3 (CPOL=1, CPHA=1) and a clock speed up to 16MHz.
Arduino Wiring
Connect the MT6816 to your Arduino (e.g., Uno/Nano) as follows:
Example Sketch
This code initializes the SPI bus and reads the absolute angle from registers 0x03 and 0x04
#include <SPI.h> const int CS_PIN = 10; const byte READ_REG_03 = 0x83; // Read command for Register 0x03 void setup() { Serial.begin(115200); pinMode(CS_PIN, OUTPUT); digitalWrite(CS_PIN, HIGH); SPI.begin(); } void loop() { uint16_t angle = readMT6816(); // Convert 14-bit raw value (0-16383) to degrees (0-360) float degrees = (angle * 360.0) / 16384.0; Serial.print("Raw: "); Serial.print(angle); Serial.print(" | Angle: "); Serial.println(degrees); delay(100); } uint16_t readMT6816() { // MT6816 requires SPI Mode 3, MSB first, max 16MHz SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE3)); digitalWrite(CS_PIN, LOW); // Step 1: Send read command for the first register SPI.transfer(READ_REG_03); // Step 2: Read two bytes uint8_t highByte = SPI.transfer(0x00); uint8_t lowByte = SPI.transfer(0x00); digitalWrite(CS_PIN, HIGH); SPI.endTransaction(); // Combine bytes: The 14-bit angle is in highByte and bits [7:2] of lowByte uint16_t rawData = (highByte << 8) | lowByte; uint16_t angle = (rawData & 0x3FFF); // Mask to 14 bits return angle; }
Key Coding Details
The MagnTek MT6835 is a fourth-generation magnetic angle encoder IC that significantly improves upon the MT6816, offering higher resolution and specialized calibration features. Based on Anisotropic Magnetoresistive (AMR) technology, it is designed for ultra-high-precision applications such as absolute-value servo motor control and high-speed robotics.
Technical Specifications
According to data from MagnTek and Novosense, the MT6835 features the following core parameters:
Output Interfaces
The MT6835 provides several independent output modes, making it a versatile replacement for optical encoders:
MT6835 Pinout
| Pin | Pin Name | Type | Function Description |
|---|---|---|---|
| 1 | U / CAL | Output/Input | U phase for UVW mode; also used as an Auto-Calibration trigger |
| 2 | V | Output | V phase for UVW commutation mode |
| 3 | W | Output | W phase for UVW commutation mode |
| 4 | VSS | Power | Ground (0V) |
| 5 | PWM | Output | 12-bit Pulse Width Modulation absolute angle output |
| 6 | A | Output | A channel for incremental ABZ quadrature mode |
| 7 | B | Output | B channel for incremental ABZ quadrature mode |
| 8 | Z | Output | Z (Index) pulse for incremental ABZ mode |
| 9 | MISO | Output | Master In Slave Out for SPI communication (4-wire) |
| 10 | MOSI | Input | Master Out Slave In for SPI communication (4-wire) |
| 11 | SCK | Input | Serial Clock for SPI (up to 16MHz) |
| 12 | CSN | Input | Chip Select (Active Low) for SPI |
| 13 | VDD | Power | Supply Voltage (3.0V to 5.5V) |
| 14 | VOUT | Power | Internal LDO output (typically connected to a decoupling capacitor) |
| 15 | NC | — | No Internal Connection (Leave floating) |
| 16 | NC | — | No Internal Connection (Leave floating) |
Key Hardware Considerations
MT-6835 Arduino example code
To read the 21-bit absolute angle from the MT6835, you must use the SPI interface. Because 21 bits exceed a standard 16-bit integer, you will need to store the data in a uint32_t.
Wiring (MT-6835 to Arduino)
Example code
The MT6835 stores its 21-bit angle across three registers starting at 0x03.
#include <SPI.h> const int CS_PIN = 10; const byte READ_CMD = 0x83; // Read bit (0x80) + Register address (0x03) void setup() { Serial.begin(115200); pinMode(CS_PIN, OUTPUT); digitalWrite(CS_PIN, HIGH); SPI.begin(); } void loop() { uint32_t rawAngle = readMT6835(); // Convert 21-bit (0 to 2,097,151) to degrees float degrees = (rawAngle * 360.0) / 2097152.0; Serial.print("21-bit Raw: "); Serial.print(rawAngle); Serial.print(" | Angle: "); Serial.println(degrees, 4); // 4 decimal places for precision delay(50); } uint32_t readMT6835() { // MT6835 SPI: Mode 3, MSB first, up to 16MHz SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE3)); digitalWrite(CS_PIN, LOW); SPI.transfer(READ_CMD); uint32_t b1 = SPI.transfer(0x00); // Bits 20-13 uint32_t b2 = SPI.transfer(0x00); // Bits 12-5 uint32_t b3 = SPI.transfer(0x00); // Bits 4-0 + Status bits digitalWrite(CS_PIN, HIGH); SPI.endTransaction(); // Combine the bytes: // The 21-bit angle is packed into the 24 bits of data returned. // Format: [Byte1: 8 bits][Byte2: 8 bits][Byte3: 5 bits + 3 status bits] uint32_t combined = (b1 << 16) | (b2 << 8) | b3; uint32_t angle = combined >> 3; // Shift right by 3 to remove status bits return angle; }
Critical Implementation Details
This page has been accessed for: Today: 1, Until now: 92