Smart TMR Angle Sensor
ASR002 Smart SPI TMR Angle Sensor
Features
Rotational speeds to 375,000 RPM
3.3 volt or 5 volt compatible four-wire SPI interface
Robust airgap and misalignment tolerances
Factory calibrated
Ultraminiature 2.5 x 2.5 x 0.8 mm TDFN6 package
•
•
•
•
•
Key Specifications
• 0.1° resolution
• ±0.2° repeatability
• Robust 6 to 20 mT (60 to 200 Oe) field operating range
• Fast 12.5 kSps sample rate
• Flexible 2.2 to 3.6 V supply range
• Low 4 mA typical supply current
• Full −40 °C to 125 °C operating range
Applications
• Rotary encoders
• Robotics
• Motor control
• Automotive applications
• Internet of Things (IoT) end nodes
Block Diagram
TMR
Angle
Sensor
ADC
Digital
Signal
Processing
Description
ASR002 TMR Smart Angle Sensors provide a precise digital
angle measurement over a wide range of speeds.
SPI Interface
The sensor combines precise, low-power Tunneling
Magnetoresistance (TMR) sensing elements with
sophisticated digital signal processing.
Transfer Function
The sensor is factory calibrated, with coefficients stored in
internal memory.
A four-wire SPI interface provides angle data and allows
setting device parameters.
Angle
360°
The ASR002 is designed for harsh industrial or automotive
environments with ESD protection, and full −40 °C to
125 °C operating temperature range.
1
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
Boundary Ratings
Parameter
Supply voltage
Input and output voltages
(MISO, MOSI, SS, SCLK)
Input current
Storage temperature
ESD (Human Body Model)
Applied magnetic field
Min.
−12
−0.5
−100
−55
Max.
4.2
VCC+2.5 up
to 5.8
+100
150
2000
Unlimited
Units
Volts
Volts
mA
°C
Volts
Tesla
2
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
Operating Specifications (Tmin to Tmax; 2.2 < V < 3.6 V unless otherwise stated)
DD
Parameter
Operating temperature
Supply voltage
Supply current
Power-on Reset supply voltage
Brown-out power supply voltage
Start-up time
Magnetics
Symbol
Tmin; Tmax
VDD
IDD
VPOR
VBOR
TSTA
Applied magnetic field strength
H
Accuracy and Repeatability
Angular resolution
Angular hysteresis
δ
⎎
Min.
−40
2.2
0.75
6
60
Typ.
4
1.4
1
15
12
120
Max.
125
3.6
6
1.36
20
200
Angular
Degrees
12.5
DR
tR
tF
tCL
tCH
tSE
tSDD
tSDZ
tSDH
tSDS
tSH
tSEZ
mT
Oe
±2
±3
±6
ε
VBUS
VIL
VIH
IOL
CI/O
Max. at VDD = 3.6V
0.1
±0.2
Angular accuracy, variable bias2
Speed
Sample rate
SPI Bus Characteristics
Bus voltage
Low level input threshold voltage
High level input threshold voltage
Low level output current
I/O capacitance
SPI Setup and Hold Timing
Data transfer rate
SCLK Rise time
SCLK fall time
SCLK low time
SCLK fall time
SS to SCLK setup
SCLK to MISO valid
SS to MISO tri-state
SCLK to MOSI hold time
MOSI to SCLK setup
SCLK to SS hold time
SS to MISO valid
RAM Timing
Address setup time
Data read time
Nonvolatile Memory Characteristics
Address setup time
Data read time
Data write time
Endurance
Package Thermal Characteristics
Junction-to-ambient thermal resistance
Package power dissipation
Test Condition
0.1
Repeatability
Angular accuracy, fixed bias1
Units
°C
V
mA
V
V
ms
2.2
0.8
kSps
5.5
10
V
V
V
mA
pF
2
Mbits/s
Full duplex
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
See figure 7
See figure 4
2.2
3
200
200
80
170
170
80
80
80
170
tADDR
tREAD
3
10
µs
µs
tADDR
tREAD
tNVM
3
10
20
10000
µs
µs
ms
Cycles
320
500
°C/W
mW
θJA
Fixed temperature
and bias1
0 to 85°C
−40 to 125°C
−40 to 125°C
VOL = 0.4V
See figure 5
3
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
Specification Notes:
1. “Fixed Bias” means a fixed airgap within between the bias magnet and sensor so the magnitude of the magnetic field at the
sensor is constant within the specified field range of the parts. The highest accuracy is obtained using fields closest to the
17.5 mT (175 Oe) factory calibration field.
2. “Variable Bias” means the magnitude of the magnetic field at the sensor can vary across the entire specification range.
4
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
ASR002 Overview
The ASR002 is a non-contact angle sensor designed for high speed applications where size is limited. The heart of the ASR002 is
a tunneling magnetoresistive (TMR) sensor. In a typical configuration, an external magnet provides a magnetic field of 6 to 20 mT
(60 to 200 Oe) in the plane of the sensor, as illustrated below for a bar magnet and a diametrically-magnetized disk magnet.
Factory-programmed signal conditioning is combined with a temperature sensor and digital linearization to produce high speed,
accuracy, and precision in a tiny 2.5 x 2.5 mm TDFN package.
Figure 1. Sensor operation.
ASR002 Operation
A detailed block diagram is shown below:
Digital Core
Nonvolatile Memory
SPI
Controller
Calibration
12-bit ADC
TMR
Angle
Sensor
Digital Filter
Calibration
Coefficients
SPI
Interface
Figure 2. Detailed block diagram.
TMR Angle Sensor Element
ASR002 sensors use unique TMR sensor elements that are inherently high speed and low noise. The digital core calculates the
angle from sensor element Sine and Cosine vectors, and the raw sensor data are available from separate memory locations.
ADC
The sensor output is digitized with a 12-bit ADC. The extra bits ensure precision and computational accuracy.
Digital Filter
A first-order Infinite Impulse Response (IIR) digital filter with a programmable cutoff frequency can be used for ultralow noise if
high-frequency operation is required. The factory default is the filter turned off.
5
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
Rotation Direction
The ASR002 can provide increasing angle values for either clockwise or counterclockwise field rotations. Counterclockwise is
defined as a rotating field vector through pins 1-3-4-6, and clockwise through pins 1-6-4-3. The rotation direction can be
programmed using the θDIR parameter.
Figure 3. Zero-angle reference (θ0) and rotation direction (θDIR).The rotational center of the sensor is the package center.
Zero-Angle Reference Point
A programmable parameter θ0 sets the zero-degree reference or angular offset. This is the angle of “discontinuity,” that is, where
the angle output changes from 360° to 0°. The default θ0 value is zero for magnetic fields pointing from pin 1 to pin 6.
Direction and Hysteresis
The Direction output indicates direction of rotation. A hysteresis setting can be changed to prevent small changes from causing the
Direction output to “chatter,” especially at low speed.
Digital Filter
The digital filter is an Infinite impulse response (IIR) weighted running average filter, which can reduce mechanical and electrical
noise depending on the required speed.
The filtered output is calculated as follows:
q
q /m
[(m-1)/m]
q
Where θ = is the measured angle; θn = the filtered angle; θn-1 is the previous value of the filtered angle; and m is a constant that
determines the cutoff frequency as follows:
fCUTOFF = fSAMPLE/(2π m)
Where fCUTOFF is the filter cutoff frequency and fSAMPLE is the sensor ADC sampling rate (approximately 12500/s). So for example, if
m = 10, the cutoff frequency is approximately 200 Hz.
m = 1 disables filter so the output is simply updated with each sample.
A Simple SPI Interface
The SPI interface is an industry standard four-wire, full-duplex 2 megabit per second connection with the sensor as the slave to an
external master such as a microcontroller. SPI data (MOSI and MISO) and the Clock (SCLK) are 2.2 volt to five-volt compliant.
The digital angle is the default two byte response.
The ASR002 uses an industry-standard “Mode 0” interface (data is sampled at the leading rising edge of the clock; CPOL=0 and
CPHA=0). In accordance with industry standards, slave select (SS) is active-low, and bit order and byte order are from MSB to LSB.
Details are shown in the following timing diagrams:
6
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
SCLK
MOSI
Address
MISO
SS
tADDR
tREAD
Figure 4a. Sending the address for a read.
SCLK
MOSI
D2 (LSB)
D1 (MSB)
MISO
SS
tADDR
tREAD
Figure 4b. Reading data.
SCLK
"1" indicates write
Address
MOSI
MISO
SS
tREAD
tADDR
Figure 5a. Sending the address for a write.
SCLK
MOSI
D2 (LSB)
D1 (MSB)
MISO
SS
tADDR
t NVM
Figure 5b. Writing data.
MOSI
Address
Address
Address
tREAD
tREAD
MSB
MISO
LSB
MSB
LSB
Figure 6. Continuous read.
7
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
SPI setup and hold timing constraints are shown in Figure 7:
SS
tF
tCL
tSE
SCLK
tCH
tR
tSH
tSDH
tSDS
MOSI
tSEZ
tSDZ
tSDD
MISO
Figure 7. SPI setup and hold timing.
A schematic of a typical interface to a 3.3-volt or five-volt microcontroller is show in Figure 10.
Straightforward Reading and Writing
The sensor is reset on a falling edge of SS. All reads and writes are initiated by the master pulling SS “LOW” and sending an
eight-bit address to the ASR002 plus a second byte. The least significant bit of the second address byte indicates whether the
address request is for a read or a write (“0” is a read; “1” is a write). The slave responds with two bytes of data.
As shown in figures 4 and 5, and the specification table, a 3 µs delay (tADDR) is needed between address bytes; 10 µs (tREAD) should
be allowed before data can be read, and 20 ms (tNVM) should be allowed for writing parameters to the nonvolatile memory.
Reading the angle
To read the angle, the master simply writes two zero bytes for the “0” angle address, then reads the two-byte angle, which is
expressed in tenths of degrees. These two-byte reads can be repeated to continuously read the angle as shown in the Figure 6
timing diagram and the code on p. 14.
Reading and writing parameters
Reading and writing parameters are simple four-byte sequences. The master writes two bytes for the parameter address, then reads
or writes two bytes for the parameter value. Illustrative code to zero the sensor by writing the offset parameter is shown on p. 15.
The number of bits in different parameters varies. Unused bits are sent as zeros by the sensor. Similarly, unused bits should be
written as zeros to the sensor to avoid an out-of-range parameter that could be ignored.
Because of the slower speed of the sensor’s nonvolatile memory, allow 15 ms for parameter writes.
8
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
Memory Map
The ASR002 memory provides access to angle data and user-programmable parameters. The memory is accessed via SPI as
described in the SPI interface section.
Parameter
Symbol
Angle
Raw Sin Vector
θ
Sinθ
Raw Cos Vector
Cosθ
Direction
Default
Read/
Write
Range
Data
0 – 3600
N/A
R
Address
Description
0x00
0x01
In tenths of a degree
Raw outputs centered at approx.
2048 with peak-peak amplitudes of
approx. 1000.
0 = decreasing angle
1 = increasing angle
Approx.
1500 – 2500
0x02
0–1
0x03
Dir
User-Programmable Parameters
Rotation Direction
Angular Offset
θDIR
0
0–1
0x40 [bit 0]
θ0
0
0 – 3600
0x41
[bits 13:0]
R/W
Digital Filter Constant
Direction Hysteresis
m
1
1 – 255
0x42
δDIR
25
0 – 255
(0 – 25.5°)
0x43
0 increasing CCW;
1 increasing CW
(see Fig. 3)
Point at which angle is zero
(see Fig. 3)
fCUTOFF= fSAMPLE/(2π m);
fSAMPLE = approx. 12.5 kSps
m = 1 disables filter
Hysteresis of the “Dir” output;
in tenths of a degree
Read-Only Memory
YY
Lot code
WW
0x80
N/A
R
N/A
(ASCII)
XX
0x81
0x82
ASCII date code in the form
YYWWXX, where:
YY = year;
WW = work week;
XX = internal code.
Table 1. ASR002 Memory Locations.
9
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
Power-Up and Initialization
Absolute position
Unlike some encoder types, ASR002 sensors detect absolute position and maintain position information when the power is
removed. The sensor powers up indicating the correct position.
Nonvolatile parameters
All parameters are nonvolatile so they can be set once (via SPI), and remain for the life of the product if desired.
Minimizing Noise
Several steps minimize noise:
• A 10 µF bypass capacitor is recommended as close as possible to the VDD and GND pins. A 0.080 x 0.050 inch or smaller
capacitor is recommended to minimize magnetic interference with the sensor.
• Use a circuit board ground plane.
• Grounding the sensor’s center pad allows the leadframe to act as a shield.
10
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
Magnet Selection
The sensor’s wide operating field range of 6 to 20 mT (60 to 200 Oe) allows inexpensive magnets and operation over a wide range
of magnet spacing. The figures below show the magnetic field for various magnet geometries and distances for inexpensive
C5/Y25 grade ferrite magnets:
240
t = 1 mm
t=2
t=4
t=8
180
Magnetic Field (Oe)
Magnetic Field (Oe)
240
Ferrite (C5/Y25)
120
d=8
60
M
0
0
d = 4 mm
d=8
d = 12
d = 16
180
Ferrite (C5/Y25)
120
60
t
d
M
3
6
9
sensor-magnet separation (mm)
0
0
12
t=4
6
12
sensor-magnet separation (mm)
18
Figure 8. Magnetic fields for various geometries of C5/Y25 ferrite magnets plotted for the distance between the magnet and sensor.
Eight-millimeter diameter magnets of various thicknesses are shown at left, and four-millimeter thick magnets of various diameters are
shown at right.
Field varies less with distance for larger magnets, so maximizing magnet size within the mechanical constraints of the system
maximizes accuracy.
Higher-grade magnets can be used for high-temperature applications or large magnet-sensor separations. The graph below shows
field strengths with various materials:
Magnetic Field (Oe)
240
AlNiCo-8
AlNiCo-5
SmCo (28)
NdFeB (Nd45)
Ferrite (C1/Y10)
Ferrite (C5/Y25)
180
120
d=8
60
M
0
0
t=4
6
12
sensor-magnet separation (mm)
18
Figure 9. Magnetic fields from an 8 millimeter diameter, 4 millimeter thick magnet for increasing magnet-sensor
separation. NdFeB materials produce the largest magnetic fields and separations. SmCo and AlNiCo materials offer
the highest operating temperatures. Ferrite magnets are the most cost-effective.
Our free Web app can be used to determine optimum separations for various magnet sizes and materials:
https://www.nve.com/spec/calculators.php.
NVE’s Online Store stocks popular magnets.
11
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
Application Circuits
Typical Microcontrollers Interface
A typical microcontroller interface is shown below:
2.2 - 3.6 V
ASR002-10E
3.3 - 5 V
VDD
VDD
Microcontroller
10 µF
SS
SS
SCLK
SCLK
MISO
MISO
MOSI
MOSI
GND
GND
Figure 10. Typical microcontroller interface.
The ASR002 is configured as a Slave and the microcontroller should be configured as the Master. The ASR002 SPI interface is
compatible with 3.3 or five-volt microcontrollers.
12
NVE Corporation
11409 Valley View Road, Eden Prairie, MN 55344
(952) 829-9217
www.nve.com
YouTube.com/NveCorporation
sensor-apps@nve.com
Smart TMR Angle Sensor
Typical Read and Write Communications Pseudocode
//SPI clock set elsewhere (2 MHz max.)
//SPSR = SPI Status Register; SPIF = SPI Status Register Interrupt flag
//SS set low (active) elsewhere
{
case COMM_GET_MEM:
//Routine to READ memory
SPDR=buffer[1];
//Sends the address to read from
while(! (SPSR & (1