Post · 3 min read· pp. 304–311

Position Sensors

On this page

This library supports these types of off-the-shelf position sensors:

[

Encoders](052_2026-01-01_encoder.md)

[

Magnetic sensors](054_2026-01-01_magnetic-sensor.md)

[

Hall sensors](053_2026-01-01_hall-sensors.md)

Sensor Types at a Glance

Sensor TypePrincipleInterface(s)Popular ExamplesKey Strength
EncoderCounts A, B, index pulsesABI (direct pins)OMRON 1000P, AMT103, AS5047UHigh resolution
Magnetic SensorMeasures magnetic fieldSPI, I2C, Analog, PWM, ABI, UVWAS5048A, AS5047U, AS5600Absolute position
Hall SensorDetects magnet polesUVW (3 digital inputs)49E Hall Sensor, 105 Hall SensorLow cost
Generic SensorCustom implementationYour choiceAny custom sensorMaximum flexibility
Sensorless (flux observer)Estimates the angle from the phase currentsNone, requires current sensing-No sensor hardware

All sensor classes are implemented in a generic way to support as many sensor variants as possible.

No position sensor?

If you have current sensing, the sensorless flux observer from the SimpleFOCDrivers library can estimate the rotor angle from the phase currents, and is used like any other sensor. It works well at medium and high speeds (fans, wheels, spindles), but not at standstill or very low speeds, so it is not suited for position control. Without current sensing, you can still run the motor in open-loop mode.

Supporting additional sensors

If you are interested to see what does it take to enable your code to run with different type of sensor or with the communication interface that has not been implemented in the Arduino SimpleFOClibrary yet, check out the short example.

Learn how to implement custom sensors Dig deeper into sensor implementation

NEW 📢

We've also created a simplified interface for implementing new sensors in a context of the GenericSensor class. With it you can add your custom sensor to the SimpleFOClibrary by implementing only one function. Check the new sensor class

diagram SimpleFOC Community

Finally, if you have implemented a new type of sensor to the library or you are searching for help to implement some specific sensor type don’t hesitate to post in community forum

It is always helpful to hear the stories/problems/suggestions of people implementing the code and you might find a lot of answered questions there already!


Copyright © 2026. Distributed by an MIT license.