Design Resources

Design & Integration Files

• Schematic
• Bill of Materials
• Gerber Files
• PADS Files
• Assembly Drawing Download Design Files 633.57 K

Evaluation Hardware

Part Numbers with "Z" indicate RoHS Compliance. Boards checked are needed to evaluate this circuit

  • EVAL-CFTL-6V-PWRZ ($17.00) Universal Power Supply
  • EVAL-CN0368-SDPZ ($65.00) Magnetoresistive Angle and Linear Position Measurements Board
  • EVAL-SDP-CB1Z ($99.00) Eval Control Board
Check Inventory & Purchase

Features & Benefits

  • MR Angular and Linear Position Measurement
  • Single Supply
  • Small Footprint

Circuit Function & Benefits

The compact two-chip circuit shown in Figure 1 provides a contactless anisotropic magnetoresistive (AMR) measurement solution ideal for either angle or linear position measurements. The two-chip system is capable of providing better than 0.2° angular accuracy over 180°, and linear accuracy of 2 mil (0.002 inch) over a 0.5 inch range, depending on the size of the magnet used.

The circuit is ideal for applications where high speed, accurate, noncontact angle and length measurements are critical, such as machine tool speed control, crane angle control, brushless dc motors, and other industrial or automotive applications.

Figure 1. Magnetoresistive Angle and Linear Detection System (Simplified Schematic: Decoupling and All Connections Not Shown)

Circuit Description

The ADA4571 is an anisotropic magnetoresistive (AMR) sensor with integrated signal conditioning amplifiers and ADC drivers, as well as a temperature sensor for temperature compensation. The ADA4571 produces two analog outputs that indicate the angular position of the surrounding magnetic field.

The ADA4571 contains an AMR sensor and a fixed gain (G = 40 nominally) instrumentation amplifier. The ADA4571 delivers clean and amplified cosine and sine output signals related to the angle of a rotating magnetic field. The output voltage range is ratiometric to the supply voltage.

The sensor contains two permalloy Wheatstone bridges, at a relative angle of 45° to one another. A rotating magnetic field in the x-y sensor plane delivers two sinusoidal output signals with the double frequency of the angle (α) between sensor and magnetic field direction. Within a homogeneous field in the x-y plane, the output signals are independent of the physical placement in the z direction (air gap).

The output voltage swing on the sine and cosine outputs is from 7% VDD to 93% VDD. There are two diagnostic bands (0% to 7% of VDD and 93% to 100% of VDD), thereby providing broken bond wire detection for all internal connections.

The ADA4571 is available in an 8-lead SOIC package.

The output impedance of the VSIN and VCOS outputs is 50 Ω, and with the external 10 nF capacitors forms a 318 kHz noise filter.

The AD7866 is a dual channel, simultaneous sampling, 12-bit, 1 MSPS SAR ADC. The polarity of the RANGE pin determines the analog input range and output coding. If this pin is tied to a logic high when the chip select goes low, the analog input range of the next conversion is 0 V to 2 × VREF (0 V to 5 V), leaving approximately 350 mV of headroom for the 0.35 V to 4.65 V signal from the ADA4571 AMR sensor.

Connecting the REFSEL pin low configures the ADC to use the internal 2.5 V reference voltage. This voltage is available on the VREF pin but requires a buffer before it can be used elsewhere in the system. The DCAPA pin and DCAPB pin are decoupled with 470 nF capacitors to ensure proper operation of the ADC.

The AD7866 samples both channels of the sensor simultaneously. The digital words are normally available on DOUTA and DOUTB. Each data stream consists of 1 leading 0 followed by 3 status bits and then 12 bits of conversion data. However, by holding the CS pin low for an additional 16 clock cycles, both digital words are available from one channel, DOUTA. An SPI interface therefore allows access to both channels on one data line.

The inputs to each of the two ADCs in the AD7866 are provided with a two-channel multiplexer. A Logic 0 on the A0 input pin allows conversions on the A1 and A2 inputs, and a Logic 1 on the A0 input pin allows conversion of the B1 and B2 inputs. The temperature sensor output from the ADA4571 is connected to the B1 input of the AD7866 and allows software temperature calibration of the system.

Magnetoresistive (MR) Theory 

Magnetoresistivity is the ability of a material to change the value of its resistance when subjected to an external magnetic field. The most commonly used MR sensors are based on AMR technology.

Figure 2. Anisotropic Magnetoresistive Example

Figure 2 shows an example of the AMR effect. A current (I) flowing through a conductor is subject to an external magnetic field (HY). The resistance of the conductor changes as a function of the angle (Ø) between the magnetization vector (M) and the current flow vector (I). The magnetization vector is the net sum of the internal magnetic field (HX) and the applied external magnetic field (HY).

The maximum resistance occurs when the magnetization vector (M) is parallel to the current vector (I). The minimum resistance occurs when the magnetization vector (M) is perpendicular to the current vector (I).

Effective utilization of the AMR effect requires the conductor itself to be a material insensitive to mechanical stress but sensitive to magneto-restriction. For these reasons, permalloy (80% nickel, 20% iron) is the most commonly used alloy in AMR sensor manufacturing.

Permalloy Properties

There are two properties of permalloy strips that provide design challenges when creating angular measurement systems.

First, permalloy has a narrow linear operating region (see Figure 3). Only when the angle (Ø) between the magnetization vector (M) and current flow vector (I) becomes larger does the response become linear. Unfortunately, shortly after the response becomes linear, the permalloy saturates.

Figure 3. Permalloy Resistance vs. Magnetic Field

Secondly, permalloy is insensitive to polarity. The resistance of a permalloy strip decreases whether the angle (Ø) between the magnetization vector (M) and the current flow vector (I) is positive or negative.  

Barber Poles

A common method used to improve both the linearity and polar insensitivity of the permalloy strip is to add aluminum stripes angled at 45° to the strip axis called barber poles, as shown in Figure 4. Any current flowing between barber poles takes the shortest path, the perpendicular path, and the angle between the current flow vector (I) and magnetization vector (M) shifts by 45°.

Figure 4. Barber Pole Effect in a Permalloy Strip

Figure 5 shows the result of adding barber poles to a permalloy strip. The current flow vector shifts by 45°, but the magnetization vector remains unchanged. Note the linear behavior now present in the middle of the graph.

Figure 5. Barber Pole Permalloy Resistance vs. Magnetic Field

Magnetic Field Strength

A minimum magnetic field strength of 25 kA/m is needed to ensure that the ADA4571 datasheet specifications are met. This stimulating magnetic field must intersect the center of the sensing element within the ADA4571 package.

When selecting a magnet, consider the air gap between the sensor and the magnet, as shown in Figure 6. If the magnet is not in close proximity to the sensor (the distance, d, is very large), a stronger or larger magnet may be necessary to ensure that the minimum magnetic field strength requirements are met.

Figure 6. Magnet Orientation and Air Gap for Rotating Shaft Angle Measurement

Sensor Basics

The standard AMR sensor consists of two Wheatstone bridges, with one bridge at a relative angle of 45° with respect to the other, as shown in Figure 7.

Figure 7. ADA4571 Dual Wheatstone Bridge Configuration

A rotating magnetic field produces the sin(2Ø) and cos(2Ø) outputs seen in Figure 8. Both signals are periodic over a 180° range, making the detection of full 360° measurements impossible without additional components or a reference point.

Figure 8. Magnetoresistive Sensor Output Voltages

Channel Sensitivity

The ADA4571 sensor has a nominal sensitivity of 52 mV/° for each channel, which means that each degree of change between the magnetization vector and the sensor orientation produces an output voltage change of 52 mV. The sensitivity is not constant with respect to the angle. The areas of decreased sensitivity are the portions of each output where the slope of the line approaches zero.

Referring to Figure 8, the cosine output (green) loses sensitivity as the magnetization vector angle nears 0°, 90°, 180°, or 270°. Similarly, the sine output (red) loses sensitivity around 45°, 135°, 225°, and 315°. Fortunately, when one channel has reduced sensitivity, the other channel is in a region of high sensitivity.

System Bandwidth, Magnetic Field Rotation

The angular velocity of the magnetic field is an important component in understanding the bandwidth of the circuit. The ADC converts one sample every microsecond. To achieve a resolution of 1°, the magnetic field can only move 1° in 1 ms (2.778 kHz); otherwise, the ADC cannot sample fast enough to keep up with the magnetic field. This limitation sets the maximum useable angular velocity of the magnetic field at 2.778 kHz for a 1 MSPS ADC.

Rotational Measurement Test Results 

A diametrically oriented N42 magnet (diameter = 0.5 inch, thickness = 0.125 inch) is attached to the end of a metal rod. A precision dc motor allows fine angular control of the rod. The sensor is mounted precisely with respect to the face of the magnet. The air gap is set at 2 mm. Results are largely independent of the air gap as long as the magnetic stimulus fully saturates the sensor.

The motor turning creates a rotating magnetic field intersecting the sensor, which creates a repeatable sine and cosine output voltage suitable for angle calculations and data collection.

Figure 9 is a functional diagram of the setup. Figure 10 is a photo of the setup used for collecting data in an end of shaft configuration. The setup consists of a brushless dc motor, physical mount, magnet, and PCB with corresponding ADA4571 sensor.

Figure 10. Photo of Bench Test Setup with Brushless DC Motor

Figure 11 compares the mechanical angle of the motor and the calculated magnetic field angle of the sensor through several rotations of the magnet. This calculation utilizes the arctangent function of the ratio of the two outputs. The errors approach ±1° with no calibration.

Figure 11. Angular Error Versus Mechanical Angle Before Offset Correction

Figure 12 shows the error with only an offset correction. No additional adjustments to correct for sine and cosine amplitude mismatch, nonlinearity, or orthogonality is required. The offsets are determined using the peak-to-peak or mean value of each channel as it passes through the entire mechanical revolution. The offset is subtracted from the respective channels to give a linear sensor response. The maximum error approaches ±0.2°, while the majority of the range has an error of less than ±0.1°.

Figure 12. Angular Error vs. Mechanical Angle After Correcting Only for Offset

Linear Position Test Results

Very few changes are required to create an incremental linear position measurement system. Replace the magnet with a multipole bar magnet consisting of a series of alternating north and south poles, as shown in Figure 13.

Figure 13. Linear Position Measurement Magnet, PCB, and Sensor

As the sensor moves parallel to the magnet, it detects the magnetic field, which rotates 180° for every pole length travelled. The pole length of the magnet (P) and the angular accuracy of the sensor (ΔØ = 0.05°) determine the theoretical accuracy (Δx).

Δx = P × ΔØ/180°

This method provides an absolute measurement system for only one pole length. If the magnet has more than one pole, counting the number of poles passed provides a more accurate reading.The ideal distance between the sensor and magnet is one-half the pole length of the magnet.

The EVAL-CN0368-SDPZ PCB is tested by mounting a magnet to the arm of a digital caliper. The EVAL-CN0368-SDPZ PCB sits in position with the face of the ADA4571 AMR sensor (U5) perpendicular to the face of the magnet. As the magnet moves, the caliper displays the distance travelled accurate to 0.0005 inch. Simultaneously, the magnetic field lines intersect the sensor and provide a useable output voltage. Figure 14 is a diagram of the setup, and Figure 15 is a photo of the setup.

Figure 14. Data Collection Test Setup for Linear Measurement

Figure 15. Photo of Bench Test Setup

The setup utilizes a magnet that is 2 inches in length and is positioned 1 inch away from the sensor. The recommended sensor-to-magnet air gap for linear motion sensing is equal to one-half of the pole length of the magnet. Data is collected by moving the magnet along the x-axis and comparing the evaluation software reading to the digital display reading on the caliper. Figure 16 shows the output position error recorded over a 1.0 inch range. The error is ±2 mil over the entire range.

Figure 16. Magnetic Field Position Error: 1.0 Inch Range

Restricting the measurement range to 0.4 inch produces better measurement results. Note that 0.4 inch coincides with the linear portion of the trigonometric waves shown in Figure 8 and confines measurement to a 30° range. Applying a new gain correction factor for this modified range produces a ±1 mil error, as shown in Figure 17.

Figure 17. Magnetic Field Position Error: 0.4 Inch Range

The sensor is positioned so that it sits in the middle of the body of the magnet, as shown in Figure 18. A common error source, vertical misalignment, occurs when the sensor is moved up or down with respect to the position of the magnet.

Figure 18. Photo of Bench Test Setup: Vertical Misalignment

Figure 19 shows the errors introduced by misaligning the sensor and magnet vertically. This test consists of moving the PCB up or down by 0.25 inch and 0.5 inch before collecting data. For a measurement range of 1.0 inch, moving the target 0.25 inch up or down adds several mils of error to the calculation. Moving the sensor 0.5 inch up or down makes the measurement worse, adding tens of mils of error to the original reading.

Figure 19. Magnetic Field Position Error: Vertical Misalignment

By modifying the gain correction factor, these large errors can be improved but not removed completely. Increasing the distance from the magnet negatively influences the magnetic field strength and orientation of the magnetic field lines, making some of the data unrecoverable. A second common error source is rotational misalignment, shown in Figure 20. While the sensor and magnet are positioned ideally with respect to the vertical axis, the sensor is not parallel to the face of the magnet.

Figure 20. Photo of Bench Test Setup: Rotational Misalignment

Figure 21 shows the readings associated with rotationa misalignment. The green line shows the errors recorded for a parallel configuration, while the red and blue lines show the additional errors introduced by rotating the sensor left or right with respect to the face of the magnet. 

Figure 21. Magnetic Field Position Error: Rotational Misalignment

A final common error source is sensor-to-magnet distance, shown in Figure 22. The ideal distance between the sensor and magnet is half of the magnet length. Increasing or decreasing this distance introduces errors into the data set. Figure 22 shows the bench test setup where the magnet and sensor are too close together.

Figure 22. Photo of Bench Test Setup: In-Plane Distance Variation

The distance between the magnet and sensor is set to 0.1 inch, 0.5 inch, and 1 inch, and then data sets are collected. Figure 23 shows the errors associated with the different configurations.

Figure 23. Magnetic Field Position Error: In plane Distance Variation

By modifying the gain correction factor, these large errors can be improved but not removed completely. Increasing or decreasing the distance from the magnet negatively influences the magnetic field strength and orientation of the magnetic field lines, making some of the data unrecoverable.

Figure 24 is a screenshot of the LabVIEW® evaluation software used for all readings and calculations regarding angular position applications. Figure 25 shows a screenshot of the Linear Measurement tab.

Figure 24. Screenshot of CN0368 Evaluation Software, Rotary Measurement Tab

Figure 25. Screenshot of CN0368 Evaluation Software, Linear Measurement Tab

During calibration, the maximum and minimum voltage (VMAX and VMIN) output of each Wheatstone bridge is determined. Knowing these values allows a more precise mapping of voltage to digital code. The user has two methods of determining the VMAX and VMIN values using the Select Calibration Method drop-down box.

The first method involves rotating the magnetic stimulus through 360° while the software identifies VMAX and VMIN. The software then calculates the offset voltage for each channel and uses those values to determine the magnetic field angle.

The second method involves rotating the magnetic stimulus through 360° while the software identifies VMAX, VMIN, and VTEMP. The process is then repeated at a different temperature. The software uses these variables to calculate the offset voltage and the temperature dependence for each channel and, subsequently, the magnetic field angle.

PCB Layout Considerations

In any circuit where accuracy is needed, it is important to consider the power supply and ground return layout on the board. The PCB should isolate the digital and analog sections as much as possible. The PCB for the CN-0368 system uses a 4-layer stackup with large area ground plane layers and power plane polygons. See the MT-031 Tutorial for more discussion on layout and grounding, and see the MT-101 Tutorial for information on decoupling techniques.

Decouple the power supply to all ICs with 1 μF and 0.1 μF capacitors to properly suppress noise and to reduce ripple. Place the capacitors as close to the device as possible. Ceramic
capacitors are recommended for all high frequency decoupling.

Power supply lines should have as large a trace width as possible to provide low impedance paths and reduce glitch effects on the supply line. Shield clocks and other fast switching digital signals from other parts of the board by digital ground. Figure 26 is a photo of the PCB.

A complete design support package for the CN-0368 is available at www.analog.com/CN0368-DesignSupport.

Figure 26. Photo of EVAL-CN0368-SDPZ Board

Common Variations

If sample rates of greater than 1 MSPS are required, consider the following simultaneous sampling ADCs: the AD7352 (12 bits at 3 MSPS), the AD7356 (12 bits at 5 MSPS), and the AD7357 (14-bits at 4.25 MSPS).

If greater than 12-bit or14-bit resolution is required, the AD7655 (16 bits at 1 MSPS) can be used.

Circuit Evaluation & Test

This circuit uses the EVAL-SDP-CB1Z system demonstration platform (SDP) board and the EVAL-CN0368-SDPZ circuit board. The two boards have 120-pin mating connectors, allowing quick setup and evaluation of the performance of the circuit.

The EVAL-CN0368-SDPZ contains the circuit to be evaluated, as described in the CN-0368. The EVAL-SDP-CB1Z board is used with the CN0368 evaluation software to capture data from the EVAL-CN0368-SDPZ circuit board. 

Equipment Needed 

The following equipment is needed:

  • PC with a USB port and Windows® XP (32-bit), Windows
  • Vista (32-bit), or Windows 7 (32-bit)
  • EVAL-CN0368-SDPZ circuit board
  • EVAL-SDP-CB1Z SDP board
  • 6 V power supply or wall wart
  • CN0368 evaluation software
  • Neodymium magnet with a minimum magnetic field strength of 25 kA/m at the package of the sensor

Getting Started

Load the evaluation software by inserting the CN0368 evaluation software CD into the PC. From My Computer, locate the drive that contains the evaluation software CD and open the Readme file. Follow the instructions contained in the Readme file to install and use the evaluation software.

Functional Block Diagram

Figure 27 shows the functional block diagram of the test setup.

Figure 27. Test Setup Block Diagram


Connect the 120-pin connector on the EVAL-CN0368-SDPZ to the connector on the EVAL-SDP-CB1Z. Use nylon hardware to firmly secure the two boards, using the holes provided at the ends of the 120-pin connectors.

With power to the supply off, connect a 6 V dc barrel jack to Connector J4. Connect the USB cable supplied with the EVAL-SDP-CB1Z to the USB port on the PC. Do not connect the USB cable to the mini-USB connector on the SDP board at this time.

Place the neodymium magnet directly on top of the IC or in some fixture designed to spin the magnet, and which minimizes the distance between the IC and the magnet.

It is important to keep other sources of magnetic fields away from the IC because any stray magnetic field can cause errors in the output voltage of the sensor.


Apply power to the dc barrel jack, Connector J4. Launch the CN0368 evaluation software and connect the USB cable from the PC to the mini-USB connector on the EVAL-SDP-CB1Z.

When USB communications are established, the EVAL-SDP-CB1Z can be used to send, receive, and capture serial data from the EVAL-CN0368-SDPZ.

Information regarding the EVAL-SDP-CB1Z is available in the SDP User Guide.

Information and details regarding test setup and calibration and how to use the evaluation software for data capture are available in the CN-0368 Software User Guide.

Sample Products




Available Product
Models to Sample

AD7866 Dual 1MSPS, 12-Bit, 2-Channel SAR ADC with Serial Interface



ADA4571 Integrated AMR Angle Sensor and Signal Conditioner



Buy functionality exists in desktop site
Evaluation Boards Pricing displayed is based on 1-piece.
Pricing displayed is based on 1-piece. The USA list pricing shown is for budgetary use only, shown in United States dollars (FOB USA per unit), and is subject to change. International prices may vary due to local duties, taxes, fees and exchange rates.