Glossary

Hall effect sensor

Hall effect sensor – definition

A Hall effect sensor is a solid-state device that measures a magnetic field by detecting the Hall voltage generated across a current-carrying semiconductor. In mobile robotics, Hall effect sensors are commonly used as non-contact position, speed, and rotation sensors in DC motors, wheel encoders, gearbox assemblies, and magnetic limit switches.

For an unmanned ground vehicle (UGV), Hall sensor data is usually part of the wheel-odometry chain. The sensor detects magnetic fields from poles or a rotating magnet ring. A motor controller or encoder interface converts the resulting electrical transitions into pulse counts. ROS 2 software can then use those counts to estimate wheel position, wheel velocity, and robot motion.

The Hall effect is named after physicist Edwin H. Hall, who described the phenomenon in 1879. Modern Hall ICs integrate the sensing element, signal conditioning, temperature compensation, and digital or analogue output circuitry in one package.

How Hall effect sensors work in mobile robots

A Hall element produces a voltage when electrical current flows through it in the presence of a perpendicular magnetic field. The measured Hall voltage depends on magnetic flux density, bias current, material properties, and sensor geometry. In robotics, the raw voltage is often processed internally by the sensor IC.

Three Hall sensor output types are relevant to UGV integration:

  • Digital Hall switch – provides an ON/OFF output when the magnetic field exceeds a defined threshold. It is used for pulse generation, end-stop detection, and simple wheel rotation sensing.
  • Latching Hall switch – changes state when exposed to opposite magnetic poles. It is frequently used with rotating multipole magnets to generate repeatable encoder pulses.
  • Linear or ratiometric Hall sensor – produces an analogue output proportional to magnetic field strength within its specified measurement range. It can be used for angular position measurement with an external magnet.

Wheel encoders often use two Hall channels, conventionally called A and B. Their phase relationship provides quadrature information. By comparing the order of A and B transitions, firmware can determine rotation direction. Counting transitions gives incremental position, while pulse timing gives rotational speed.

For a wheel with radius r, encoder resolution N counts per wheel revolution, and count increment Δc, the estimated travel distance is:

Δs = (2 π r / N) × Δc

The value of N must represent the effective resolution at the wheel, including gearbox ratio and the selected decoding method. A controller that counts rising edges only does not produce the same count total as one that counts all quadrature edges.

Hall sensors, encoders, and ROS 2 odometry

ROS 2 does not define a dedicated standard message for raw Hall transitions. The interface depends on where decoding occurs. A motor controller may expose counts through serial communication, CAN, GPIO interrupts, or a vendor-specific ROS 2 driver. The robot-level output is usually published as wheel state or odometry.

The following ROS interfaces are commonly used after Hall signals have been processed:

ROS 2 interface Typical content Relevant reference
sensor_msgs/msg/JointState Wheel joint position in radians and velocity in radians per second. ROS 2 sensor_msgs documentation
nav_msgs/msg/Odometry Estimated pose and twist, including covariance fields. ROS 2 nav_msgs documentation
tf2 Transform between odometry and robot base frames. REP 105 – Coordinate Frames for Mobile Platforms

ROS coordinate and unit conventions should follow REP 103. It specifies SI units, including metres for distance, radians for angular position, and radians per second for angular velocity. A driver should convert motor-controller counts to these units before publishing standard robot-state messages.

# Inspect wheel encoder or motor-state data
ros2 topic list
ros2 topic echo /joint_states
ros2 topic hz /joint_states

# Inspect robot odometry generated from wheel motion
ros2 topic echo /odom

The odom estimate is locally continuous but can drift because wheel encoders do not observe lateral slip, wheel lift, terrain deformation, or absolute global position. A localisation stack can fuse wheel odometry with IMU, GNSS/RTK, LiDAR SLAM, or visual odometry.

Key integration parameters

Hall sensors should be selected and configured together with the motor, encoder disc or magnet ring, motor controller, and expected environment. The sensor alone does not determine odometry quality.

  • Supply voltage and output type – verify whether the sensor uses open-drain, push-pull, analogue, or differential output. Open-drain outputs require an appropriate pull-up resistor.
  • Magnetic operating thresholds – digital sensors specify operate and release thresholds. Their difference is hysteresis, which prevents output chatter near the switching point.
  • Air gap and mechanical alignment – use the magnetic spacing and alignment limits specified by the sensor and encoder manufacturer.
  • Maximum switching frequency – the sensor and controller must process pulses at the highest expected wheel or motor speed.
  • Encoder resolution – document pulses per revolution, gearbox ratio, quadrature decoding mode, and whether counts refer to the motor shaft or wheel shaft.
  • Timestamping – consistent timestamps are required when fusing odometry with IMU or perception data.

Use on Leo Rover and Raph Rover

On Leo Rover, Hall-based wheel sensing can provide the incremental motion input needed by a differential-drive odometry node. Leo Rover can run ROS 2 on its integrated Raspberry Pi compute unit, but it is not an autonomous navigation system by default. Navigation requires integration of odometry, transforms, sensor drivers, localisation, and a navigation stack.

Before using wheel data on Leo Rover, confirm the encoder interface, count convention, wheel dimensions, and controller firmware against the platform documentation. These details affect the conversion from counts to wheel rotation and the resulting /odom accuracy.

Raph Rover can use the same sensing principle in applications with higher payload requirements. On a larger UGV, encoder mounting, cable routing, electromagnetic interference, wheel slip, and suspension dynamics can have a stronger influence on odometry. Hall sensor counts remain incremental measurements and should not be treated as an absolute positioning source.

Limitations and validation

Hall sensors are robust because they do not require mechanical contact between the sensing IC and magnet. However, they measure magnetic fields rather than ground-truth vehicle motion. Odometry errors can accumulate on loose soil, grass, gravel, ramps, or when wheels skid during turning.

A practical validation procedure should compare encoder-derived distance with a measured reference path and inspect the ROS 2 output for discontinuities. The test should include forward motion, reverse motion, in-place rotation, and motion under expected payload conditions.

Source references: REP 103 – Standard Units of Measure and Coordinate Conventions; REP 105 – Coordinate Frames for Mobile Platforms; ROS 2 sensor_msgs documentation; ROS 2 nav_msgs documentation; IEEE Std 2700-2022, IEEE Standard for Sensor Performance Parameter Definitions.

See also