AN296246
MCO-0001126
P0160

APPLICATION INFORMATIONSPEED SENSOR PROTOCOLS
By Syed Bilal Ali
Allegro MicroSystems

INTRODUCTION
Allegro speed sensors offer many different output protocols, each one tailored for specific application requirements and for theinformation that needs to be transmitted.
This application note provides a detailed description of commonly used output protocols implemented in speed sensors. It also
lists the benefits and drawbacks of each and provides information on the safety mechanisms these protocols offer to achievecompliance with the latest automotive safety standards. Table 1 provides a summary of the most commonly used speed sensor
output protocols.
Table 1: Summary of the most used output protocols in Allegro speed sensors
ProtocolApplications

Speed

Direction

Maximum
Speed

Speed/
Switching

Applications requiring accurate
speed but no direction information

Yes

No

12 kHzVariable Pulse
Width

Applications requiring bothaccurate speed and direction
information. Typically employed inTransmission, wheel speed andcrank applications.

Yes

Dual Output
Speed andDirection (AB)Applications requiring highresolution to determine position
along with speed and direction.
Typically employed in E-motor
applications.

Yes

Dual Output
XOR andDirection

Applications which require
direction information as a direct
output from the sensor along withhigh resolution output for speedand position.

Yes

AK Protocol

Applications which require
additional information other than
only speed and direction. This
information can be encoded in thebits of the AK message.

Yes

Yes

Yes/
Determinedby the ECUElectricalInterface

ASIL Safe State

Advantages

Open Drain

Output Clamping

Current

Ultra-Low Current State• Single output• Simple monitoring of openand short conditions by ECUOpen Drain

Output Clamping

Current

Ultra-Low Current State

12 kHz• Single output• Simple monitoring of open
and short conditions by ECU• Can provide information on
direction, vibration etc.

40 kHzOpen Drain

Output Clamping• Allows for high-speed sensing• Provides a level of
independence between
sensor channels

Yes

40 kHzOpen Drain

Output Clamping• Allows for high-speed sensing• Reduces calculation load on
ECU by providing direction

Yes

5 kHz

Current

Designated Current
State• More information transmitted
per pulse (e.g. 8 bits)

AN296246
MCO-0001126
P0160

APPLICATION INFORMATIONSPEED/SWITCHING PROTOCOL
Speed/switching protocol is the simplest protocol used to convey speed or position information of a rotating target. The output
switches in response to a changing magnetic field produced by the rotating target, thereby reflecting its geometry. The changing magnetic field can be the absolute magnetic field detected by a single Hall element or a differential magnetic field between
two Hall elements. A valid output can only exist in two states, OFF (high) or ON (low).
When the magnetic field crosses a certain threshold programmed in the device, the output switches from OFF to ON or vice versa.
To avoid switching on noise and to achieve a better jitter/accuracy performance, this switching operation is achieved throughtwo separate comparators which use the same reference point. One comparator has a positive hysteresis BHYS1 and the otherhas a negative hysteresis BHYS2. Therefore, one comparator switches at the threshold crossing on an increasing magnetic signal(BOP) while the other switches on the threshold crossing of the decreasing magnetic signal (BRP). Figure 1 shows an example ofthis method. Figure 2 shows an oscilloscope capture of the output from a speed only device.

Figure 1: Example of switching scheme for a speed-only sensor

Figure 2: Scope capture of the differential magnetic signal (C2) and the respective speed only output (C1)955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM2

AN296246
MCO-0001126
P0160

APPLICATION INFORMATION

Two versions of this protocol exist, one based on an open-drain output, requiring a pull-up resistor, and the other based on amodulation of the component’s drawn current. Typical interface application circuits for the two options are shown in Figure 3and Figure 4. For further information on speed sensor interfaces, refer to AN296233 “Two and Three wire Sensor Interfaces”,
available on the Allegro website.

Figure 3: Typical application circuit for an open drain speed-only sensor. Bypass and load capacitors added to meet EMC requirements

Figure 4: Typical application circuit for a current-interface sensor

Pros and Cons
Allegro devices with speed-only protocol generally consist of two sensing elements. The sensing elements with speed-only
protocol can have a larger spacing. Assuming that the sensing element spacing and target pitch are well matched, speed-only
sensors may achieve a larger maximum air gap when compared with speed and direction sensors, which generally have three
sensing elements that allow the spacing between elements to be smaller and hence having a reduced maximum operating air gap.
Sensors with speed-only protocol can have a minimum of two cables if they have a current interface and can therefore be usedfor sensing at a remote location to the ECU, e.g., wheel speed and transmission. Monitoring for open and short conditions caneasily be performed by the ECU by monitoring the current drawn. Furthermore, a simple comparator-based input circuit canbe used in the ECU.

955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM3

AN296246
MCO-0001126
P0160

APPLICATION INFORMATION

One disadvantage of speed-only protocol is that additional information including information on direction of rotation, calibration or vibration is not available.

PULSE WIDTH OUTPUT PROTOCOL
Pulse width output protocol is implemented in sensors which need to communicate both speed and direction information ofthe target. When a target spins in front of the sensor, the sensor generates output pulses based on the topology of the target,
typically a fixed number of pulses per tooth-valley period. The speed information is provided by the output pulse rate which
can be calculated from the time between consecutive rising edges (period) of the output signal. The direction information isencoded in the duration of the output pulses (pulse width). Depending on the sensor and the programming, the output pulses
can have different pulse widths. For example:
1.

tw(FWD): Duration of output pulse when the target is spinning in forward (FWD) direction, typically around 45 μs.

2. tw(REV): Duration of output pulse when the target is spinning in reverse (REV) direction, typically around 90 μs or 180 μs
depending on the sensor programming.
3. tw(ND): Duration of a ND (Non-Directional) pulse. These pulses indicate that the direction information is not available tothe device which could be due to device undergoing calibration or detecting vibration, typically around 180 μs or 360 μs
depending on the sensor programming.
The direction is defined by the device variant F(FWD) or R(REV). For variant F, target rotation from VCC to GND is referred to asforward, whereas for variant R, target rotation from VCC to GND is referred to as reverse. A forward rotation is indicated by outputpulse width tw(FWD), whereas a reverse rotation is indicated by an output with pulse width tw(REV). An ‘ND’ pulse is generated
when direction is ambiguous, for example during calibration or vibration, and is indicated by output pulse width tw(ND). Figure 5
shows an example of the output of such a device with active vibration detection during vibration.

Figure 5: Example output of a device using variable pulse width output during a vibration condition

The variable pulse width output protocol is available in different configuration options. These options are described in detail inthe datasheet of the devices. Figure 6 shows an oscilloscope capture of the output from a pulse width device.

955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM4

AN296246
MCO-0001126
P0160

APPLICATION INFORMATION

Figure 6: Scope capture of the right and left differential signals (C2, C3) and the respective pulse width output signal (C1) during a direction change fromforward rotation to reverse rotationPros and Cons
The pulse width protocol can provide more information in addition to only the speed information of a spinning target. This
information is encoded in the width of the output pulses as described in the previous section and can be used to determine thedirection of rotation or indicate calibration or vibration.
This protocol can be implemented with a minimum of two cables if the sensor has a current interface and therefore it can beused with longer cables for transmission and wheel-speed applications.

DUAL OUTPUT SPEED AND DIRECTION PROTOCOLS
Sensors using a dual output speed and direction protocol have two independent digital outputs which represent the target’s
mechanical profile. The two outputs together indicate both speed and direction of the rotating target. Three different types ofoutput signals are typically used: SPEED, XOR SPEED, and DIRECTION.
Allegro devices that offer the dual output speed and direction protocols can be configured to output one of the two combinations: the AB speed protocol or the XOR Speed and Direction protocol.

AB Speed Protocol
In the AB speed protocol, both outputs are programmed to provide the SPEED signal from two differential channels. The output
switches in response to a changing magnetic field produced by a rotating target, thereby reflecting the geometry of the target.
A valid output can only exist in two states, OFF (high) or ON (low).
When the magnetic field crosses a certain threshold programmed in the device, the output switches from OFF to ON or viceversa. Due to the geometric relationship between Hall elements and target features, both channels are phase shifted by ideally
90° to each other [1]. If Ch A leads Ch B, the output indicates rotation in one direction, whereas if Ch B leads Ch A, the output
indicates rotation in the other direction. Figure 7 shows channels A and B during a direction change and the resulting incremental
counting. Figure 8 shows the oscilloscope capture of the AB speed protocol. This output is like that of a quadrature encoder
which can be decoded to get the position and direction of the target.

[1] For further information on the impact of target wheel geometries, refer to the Application Information “Magnetic Encoder Design for Electrical Motor Driv-ing using ATS605LSG”, available on the Allegro website at www.allegromicro.com

955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM

5

AN296246
MCO-0001126
P0160

APPLICATION INFORMATION

Figure 7: Incremental counting using the AB speed protocol

Figure 8: Scope capture of the A and B output signals (C1, C2) from the AB speed protocol during a direction change

If the states of the A and B channel are analyzed, the encoder field (A, B) is Gray encoded since only one of the bits changes forany given state transition. The state transitions can be decoded to get the direction, as shown in Table 2 and Figure 9.
Table 2: Encoding state transition
StateClockwise Transition

Counterclockwise Transition

0,00,1 to 0,01,0 to 0,0

1,00,0 to 1,0

1,1 to 0,01,11,0 to 1,10,1 to 1,10,1

1,1 to 0,10,0 to 0,1955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM6

AN296246
MCO-0001126
P0160APPLICATION INFORMATION

Figure 9: AB protocol encoding state transitions

In addition, if the edges of Ch A and Ch B are examined, there are 4 edges for each period of the target, and it is possible to get
4N resolution from a target with N teeth.

XOR Speed and Direction
XOR speed and direction protocol also consists of two outputs. The first output, XOR Speed provides an XOR’d output of thetwo speed channels of the AB speed protocol (i.e., XOR Speed = A XOR B) which results in double the speed data rate without
making any changes to the controller. The second output is DIRECTION, which is either high or low depending on the directionof rotation of the target. Figure 10 shows a scope capture of the XOR speed and direction protocol. XOR Speed will be updated
before DIRECTION and is updated at every transition of both Channel A and Channel B allowing the use of up-down counters
without the loss of pulses.

Pros and Cons
The main advantage of using dual output speed and direction protocols is that they can achieve a higher resolution and very highmaximum speeds (up to 40 kHz) compared to the pulse width protocols. The AB speed protocol provides an output like thatof an incremental encoder and can therefore be used as a cost-effective solution for E-motor position sensing applications. The
small space/size requirements and lower cost and complexity allows these sensors to be used as a redundancy or replacementfor other high-speed position sensing solutions such as optical encoders and resolvers.
Speed sensors with dual output protocols offer different programming options and can be configured by the user to output anAB signal or XOR Speed and Direction signal.

955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM

7

AN296246
MCO-0001126
P0160

APPLICATION INFORMATION

Figure 10: Scope capture of the XOR speed (C1) and DIRECTION (C2) signals during a direction change. Direction is reported on the next edge immediately after
direction change

AK PROTOCOLThe AK protocol consists of a series of AK messages, typically a fixed number of messages per tooth-valley period of the target
spinning in front of the sensor. Each AK message is called a ‘word’ which consists of a high-current speed pulse (typically 28 mA)
followed by a sequence of mid-current data pulses (typically 14 mA). The data pulses are Manchester encoded which means thebit information is contained in the edge of the signal within a certain time window, tp; for example, a rising edge may represent‘1’ and falling edge represents a ‘0’. These bits can be used to encode additional information including direction information,
validity of direction, air gap indication, etc.. This encoding is described in detail in the datasheets of Allegro devices supporting
AK protocol. Figure 11 shows an example of a single AK message.

955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM

8

AN296246
MCO-0001126
P0160

APPLICATION INFORMATION

Figure 11: Scope capture of a single AK message showing a speed pulse followed by the data pulses and the decoding of the data pulses to bits

Pros and Cons
The main advantage of the AK protocol is the number of bits that can be transmitted on the output by a single AK message. Thesebits can be decoded at the ECU to obtain information about the state of the setup or the device. One tradeoff however is thatsince the AK message is longer in time, the maximum speed at which the target can spin may be limited.

FUNCTIONAL SAFETY SAFE STATES
Sensors developed according to ISO 26262 require a means to communicate that their internal diagnostics have detected afault condition.
For voltage outputs this is implemented by having a transistor that does not drive the output to either open or closed (high /low) but rather drives the output to a fixed voltage level. Voltages outside defined boundaries around these levels should beinterpreted as fault condition by the ECU, as shown in Figure 12. For the specific output voltage level bands, depending on thepull-up resistor used, refer to the individual datasheets and safety manuals.

Figure 12: ECU Fault Condition detection

955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM9

AN296246
MCO-0001126
P0160APPLICATION INFORMATIONFor current interfaces the safe state is implemented by an additional current level below the lowest typical current state. Forexample, at less than 3.9 mA for a 7/14 mA current interface. The width of the ultra-low-current state can be used to encode further information, for example if a less critical failure (warning) or a critical failure (error) has been detected, as shown in Figure 13.
For specific device behaviour, refer to the individual datasheets and safety manuals.

Figure 13: Safe state for 2-wire current interface

CONCLUSION
In this application note, the most commonly used output protocols for Allegro speed sensors are discussed. After analyzing thedifferent protocols and their respective tradeoffs, it can be concluded that each protocol is highly dependent on the application
requirements. Depending on the information that needs to be transmitted, one protocol may be better suited than the others.
For example, for wheel speed and transmission applications, the pulse width protocol fits best because of its ability to transmit
both speed and direction information with a minimum of two wires. Contrarily, for E-motor position sensing applications, theAB speed protocol will be required since it allows incremental decoding with high resolution and at high speeds.
It should also be noted that as the applications and their individual requirements sometimes require a deviation from thesestandard protocols, it is strongly recommended to consult the device-specific datasheet and if applicable the safety manual forfurther information.

955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM10

AN296246MCO-0001126
P0160

APPLICATION INFORMATION

Revision History
NumberDate

Description

Responsibility–August 2, 2021

Initial release

Syed Bilal Ali

Copyright 2021, Allegro MicroSystems.

The information contained in this document does not constitute any representation, warranty, assurance, guaranty, or inducement by Allegro to the customer with respect to the subject matter of this document. The information being provided does
not guarantee that a process based on this information will be reliable, or that Allegro has explored all of the possible failuremodes. It is the customer’s responsibility to do sufficient qualification testing of the final product to insure that it is reliable andmeets all design requirements.
Copies of this document are considered uncontrolled documents.

955 PERIMETER ROAD • MANCHESTER, NH 03103 • USA+1-603-626-2300 • FAX: +1-603-641-5336 • ALLEGROMICRO.COM