SLYA077 september   2023 TMAG6180-Q1


  1.   1
    1. 1.1 Introduction
  2.   3

Identifying sensor needs

A single e-bike (or pedelc) is a complex system which must provide a seamless transition for riders with little to no experience riding a motorized bicycle. Another primary goal for these vehicles is to allow a rider to exert themselves physically to improve fitness, while also limiting the maximum effort required to climb hills or travel at higher speeds.

Figure 1 shows many of the functions within an e-bike that require position sensors.

GUID-20230629-SS0I-RKSL-SHJG-WHCZKJDSGHJP-low.svg Figure 1 E-Bike Position Sensors

Motor Position and Commutation

The ability to determine motor position improves the ability of the motor driver to efficiently deliver power to the motor for optimum torque. In a battery powered application, the efficient use of power is critical to the overall system design.

GUID-20230713-SS0I-FFSX-NZMX-6WDW5FHC1VPJ-low.svg Figure 2 E-Bike Motor

Traditional motor commutation is implemented with 3 Hall-effect latches spaced 120° about the rotor. A magnet mounted to the rotor shaft provides alternating magnetic fields which are then used to synchronize and control the spinning rotor.

This concept can be expanded even further using devices such asTMAG6180-Q1 and TMAG6181-Q1 which can produce differential sine and cosine outputs across all angular positions of the motor while supporting a sensing bandwidth of 100 kHz. The added ability to calculate the absolute angle of the rotor as the rotor spins provides greater resolution for more accurate control of the motor.

Wheel Speed

A basic, yet critical function for all bicycle types is to sense wheel speed. Typically, a magnet is mounted on a spoke of the front wheel, with a Hall-effect switch located on the front fork. Revolutions are counted as the wheel spins to calculate the travel speed of the bicycle. This data can be used to set maximum travel speeds, maintain constant cruising speeds, and provide immediate feedback to the rider to promote user safety.

GUID-20230713-SS0I-BDK7-XKT0-VNRWXSR3ZPDN-low.svg Figure 3 Wheel Speed Detection

This design is typically implemented with a low power switch such as TMAG5231 or DRV5032, but this design calculates speed the same regardless of the direction of rotation of the wheel since the switch produces the same response for either forward or backward rotation.

If instead direction information is required, this can be determined by replacing the switch with a 2D latch, such as TMAG5111-Q1, and adding a second magnet oriented for opposite polarity. A 2D latch provides more flexibility for alignment and magnet polarization with XY, YZ, and ZX variants.


Similar to the wheel speed detection, cadence monitors track the pedal speed of the crank shaft. This function is particularly crucial on an e-bike with pedal assist because the function provides information to the controller that the rider is actively riding the bicycle, and can be used by a trip computer to calculate the level of exertion of the rider. Many e-bikes require that the cadence monitor is active prior to engaging the motor.

GUID-20230713-SS0I-BNHH-HTNS-VJWPLGLNBJWS-low.svgFigure 4 Cadence Monitor Configuration

Traditional cadence monitors are implemented with a single Hall-effect latch monitoring magnets spaced about the chain ring. Higher magnet counts require less effort from the rider prior to triggering the sensor and engaging the motor. Using a 2D Hall-effect latch with alternating magnetic poles can produce a quadrature signal with four states per pole pair.

GUID-A3D167D5-F375-4C58-A0AD-054285D055EA-low.gif Figure 5 2D Hall-Effect Latch Response

More advanced systems can achieve even higher resolution by connecting a magnet on a geared ratio. For example, a diametric magnet rotating at a 20:1 ratio to the pedals can provide 80 pulses per revolution when monitored using TMAG5111-Q1. As a result, determining the direction of rotation for the pedals is possible.


Torque sensing is desirable to provide an even more natural response and feel for the rider than is provided using cadence alone. Monitoring the torque applied to the crank shaft in the bottom bracket or at the rear chain sprocket allows the e-bike to receive instantaneous feedback from the rider. Control algorithms can set a variable motor drive with respect to the human energy output. This effectively amplifies the strength of the rider and creates a smooth riding response.

Bottom bracket designs are commonly implemented using a strain gauge mounted on the axle of the pedal crank. As the torsion is applied to the crank, deflections in the metal occur which can be used to observe changes in the resistance of a mounted strain gauge.

Rear sprocket designs use a bracket designed with the ability to flex when under stress. With the rear sprocket mounted correctly, this can cause some deflection of the magnet which is mounted in close proximity to a Hall-effect sensor such as DRV5055-Q1. The deflection causes a change in magnetic field which is then observed as a voltage change at the sensor output.

GUID-20230713-SS0I-QKRG-ZXJ3-7MW7FG6CK7R9-low.svg Figure 6 Rear Sprocket Chain Torque Sensing

The deflection of the strain gauge varies with the amount of force being applied by the rider. Combined together, wheel speed, cadence and torque provide a complete picture to the microcontroller what level of exertion is being provided by the rider, and how much assistance is required from the motor to provide the smoothest riding experience.


In cases where the rider wants to use the motor to provide all of the required power, a throttle input is required to set the travel speed of the bike. This can be implemented using a thumb lever mounted to the handlebar.

GUID-20230713-SS0I-XZLS-M9LV-GXP1GFVQGCS0-low.svg Figure 7 Thumb Press Throttle

This function is most easily monitored using a diametric magnet rotating on axis, with an angle sensor placed adjacent.TMAG5170-Q1 or TMAG5173-Q1 both offer integrated CORDIC to track angular direction of the magnetic field. The position of the thumb lever can then be used by the microcontroller to set travel speed.

Brake Assist

Traditional hand brakes are implemented using a cable system which directly engages the disc or caliper brakes. This cable is prone to stretch, corrosion, and damage which requires periodic maintenance to keep brakes in working order. This can be replaced by an electrical system which does not rely on long spans of tension cables.

Similar to the throttle, the brake lever located on the handlebar can be implemented using 3D Hall-effect sensors (TMAG5170-Q1 or TMAG5173-Q1) to measure angular position of a rotating magnet.

Other methods place a cylinder or bar magnet on a spring loaded plunger which allows for linear displacement which can be tracked using a traditional one dimensional Hall-effect sensor such as DRV5055-Q1.

GUID-20230713-SS0I-RQCW-JTMC-KBBP67PJFG6N-low.svg Figure 8 Brake Assist Configurations

Additionally, an e-bike regenerative braking is an option, and this option requires implementing an electronic braking system to control when to use the motor to decelerate or to apply the mechanical brakes for more rapid deceleration.

Electronic Shifting

Modern electronic deralliuers and wheel hub cassettes offer the ability to accurately change gears without mechanical cabling which is prone to stretch and wear. With improved position accuracy, the gear hub and chain can benefit from improved longevity.

Advanced shifting systems place the gear assembly within the rear wheel hub or within the motor body for more compact designs which are protected from external impact. This helps prevent inadvertent misalignment and reduce the need for tension cabling as well.

Compact angle sensing designs including magnetic (TMAG6180-Q1) and inductive sensing (LDC3114-Q1) can be implemented in these applications.

Grip and Seat Detection

As a safety precaution, determine whether the rider is properly seated and holding the handlebar grips before engaging the motor. This helps prevent a scenario where a rider is walking alongside the bike and accidentally engages the throttle. If pressure is not properly detected on these points of contact, then the motor does not engage.

LDC3114-Q1 is an inductive sensor which can be used to track the small changes in displacement that occur in grip with a baseline tracking algorithm which helps prevent false trigger events due to environmental changes to the system. Sensor coils are placed beneath the rubberized grip or within the seat cushioning. When pressure is applied to the handlebar or seat, the coil is deflected towards the metal frame of the bike which is detected by LDC3114-Q1.


Similar to the grip detection, the bike kickstand can be used as a safety measure to determine the operating state of the e-bike. In the event that the kickstand is lowered, the kickstand can create a hazard to the rider, and the motor must not be enabled.

The kickstand is implemented in the same manner as brake assist, with the kickstand function monitored using a rotating magnet or the linear displacement of a target magnet on a plunger.


The e-bike has been evolving ever since the first person decided to place a battery-powered motor on a bicycle. With innovations in sensor technologies, e-bike designers can add new features and improvements to make the vehicle more efficient and user friendly.

Consider the following position sensing devices:

Recommended Devices

Sensing Application Problem Suggested Sensor How Sensor Improves Function
Motor position control Without motor position, motor drive is inefficient and wastes energy. TMAG6180-Q1 AMR sensor with differential Sine and Cosine outputs provide absolute reference for rotor position for highest accuracy motor position details.
TMAG5115 High speed Hall-effect latch with low jitter aids motor commutation timing for improved efficiency.
Throttle position When operating on battery power only, reliable position feedback is required to control motor drive. TMAG5170-Q1 3D linear Hall-effect sensors with integrated CORDIC provide absolute angle data over a convenient SPI or I2C interface.
Wheel speed To appropriately set governance on motor speed, monitoring wheel revolution speed is required. TMAG5231 Low power Hall-effect switches detect each wheel revolution by detecting a magnet mounted on the wheel spoke.
Cadence Knowing if a rider is pedaling and at what rate is preferred. TMAG5110-Q1 A 2D Hall-effect latch can be mounted near a rotating multi-pole magnet, or a magnet rotating at a higher rate than the main axle. This provides real-time data regarding rider behavior and effort.
Torque Cadence monitors provide information about how fast the rider is pedaling, but not the force applied to the pedal by the user. DRV5055-Q1 The effort exerted by the rider can be detected and amplified to provide a natural user experience customized to the rider preference.
Brake assist Mechanical cabling used in traditional brake systems stretch and wear over time. TMAG5170-Q1 Similar to throttle control, 3D Hall-effect sensors provide absolute angle to determine degree of applied brake for cable free implementation of braking system.
Seat and grip detection To promote rider safety, confirm that the rider is seated and actively controlling the vehicle. LDC3114-Q1 Inductive sensing allows for low profile pressure detection in the handlebar grips and seat cushion. A minimum amount of pressure can be set to enable motor drive functionality.
Kickstand Making sure that the kickstand is deployed before engaging motor for rider safety is recommended. LDC0851 Inductive or Hall-effect sensors can be used to detect whether the kickstand is fully stowed before enabling motor drive.
Electronic shifting Shifting gears on an e-bike allows the motor to achieve higher torque when starting or to reach higher speeds. TMAG6180-Q1 Absolute angle information of the spinning gears within the wheel hub cassette can be used to properly time actuation of gear assemblies using motorized control.