# Machine Learning-Based Position Detection Using Hall-Effect Sensor Arrays on Resource-Constrained Microcontroller

**Authors:** Zalán Németh, Chan Hwang See, Keng Goh, Arfan Ghani, Simeon Keates, Raed A. Abd-Alhameed

PMC · DOI: 10.3390/s25206444 · Sensors (Basel, Switzerland) · 2025-10-18

## TL;DR

This paper introduces a low-cost magnetic levitation system using machine learning and Hall-effect sensors to track position without optical devices.

## Contribution

A TinyML-based position detection system for magnetic levitation with sub-millimeter accuracy using resource-constrained microcontrollers.

## Key findings

- The system achieves 0.0263–0.0381 mm mean absolute error in position detection.
- It operates at 850–1000 Hz control frequencies matching optical systems without their cost or complexity.
- The solution runs entirely on-board with no external tracking devices or high-performance computing.

## Abstract

This paper presents an electromagnetic levitation system that stabilizes a magnetic body using an array of electromagnets controlled by a Hall-effect sensor array and TinyML-based position detection. Departing from conventional optical tracking methods, the proposed design combines finite-element-optimized electromagnets with a microcontroller-optimized neural network that processes sensor data to predict the levitated object’s position with 0.0263–0.0381 mm mean absolute error. The system employs both quantized and full-precision implementations of a supervised multi-output regression model trained on spatially sampled data (40 × 40 × 15 mm volume at 5 mm intervals). Comprehensive benchmarking demonstrates stable operation at 850–1000 Hz control frequencies, matching optical systems’ performance while eliminating their cost and complexity. The integrated solution performs real-time position detection and current calculation entirely on-board, requiring no external tracking devices or high-performance computing. By achieving sub 30 μm accuracy with standard microcontrollers and minimal hardware, this work validates machine learning as a viable alternative to optical position detection in magnetic levitation systems, reducing implementation barriers for research and industrial applications. The complete system design, including electromagnetic array characterization, neural network architecture selection, and real-time implementation challenges, is presented alongside performance comparisons with conventional approaches.

## Full-text entities

- **Diseases:** injury to (MESH:D014947)
- **Chemicals:** Coil (-), neodymium (MESH:D009354)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12568014/full.md

## Figures

8 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12568014/full.md

## References

40 references — full list in the complete paper: https://tomesphere.com/paper/PMC12568014/full.md

---
Source: https://tomesphere.com/paper/PMC12568014