Low-Cost ESP32 Robotic Magnetometer for High-Resolution Indoor Magnetic Field Mapping
DOI:
https://doi.org/10.37255/jme.v20i4pp151-158Keywords:
Earth magnetic field, Indoor mapping, Magnetometer, Esp 32, ElectronicsAbstract
Indoor magnetic fields are strongly distorted by building materials and electrical infrastructure, complicating magnetometer-based applications such as localization and anomaly detection. We developed a low-cost, portable, ESP32-based three-axis magnetometer integrated on a small mobile robot to map indoor magnetic fields on a 10 cm × 10 cm grid. The robot followed predefined paths using infrared sensing, streamed measurements via Wi-Fi to a computer, and logged data to a Google Sheet for analysis. Spatial maps and contours were generated using Surfer to visualize field structure and variability. Field surveys were conducted in the Physics Department at the University of Colombo and compared against an outdoor baseline. Representative indoor corridor components reached X = 137.62 µT, Y = 261.98 µT, Z = 1.23 µT (resultant ≈ 296 µT), whereas outdoor measurements were X = 32.82 µT, Y = 23.09 µT, Z = 20.82 µT (resultant ≈ 45.2 µT). Contour maps reveal substantially greater spatial variation indoors than outdoors, with a resultant magnitude approximately 6.5 times higher at representative locations, indicating pronounced disturbances likely associated with structural metals and active wiring. These results demonstrate that a simple, reproducible robotic platform can produce high-resolution indoor magnetic cartography using commodity hardware, enabling rapid site assessment and supporting applications in magnetic fingerprinting, interference diagnosis, and infrastructure-free navigation.
Downloads
References
1. “Origin of Earth’s Magnetic Field, Its Nature and Behavior, Geophysical Consequences, and Danger to Humanity: A Logical Progression of Discoveries—A Review,” Advances in Image and Video Processing, vol. 10, no. 6, Dec. 2022, doi: 10.14738/aivp.106.13684.
2. “The Earth’s Magnetic Field: An Overview,” Geomagnetism, British Geological Survey. [Online]. Available: http://www.geomag.bgs.ac.uk/
3. M. Regi, D. Di Mauro, and S. Lepidi, “The location of the Earth’s magnetic poles from circum-terrestrial observations,” J. Geophys. Res.: Space Physics, vol. 126, no. 2, Feb. 2021, doi: 10.1029/2020JA028513.
4. S. K. Runcorn, “The Earth’s magnetism,” Philosophical Transactions of the Royal Society of London, vol. 193, no. 3, pp. 152–163, 1955, doi: 10.2307/24944764.
5. “4466_Preview_Contents.”
6. C. Rizos, Proceedings of the 2012 International Conference on Indoor Positioning and Indoor Navigation (IPIN), Sydney, Australia, Nov. 13–15, 2012. Piscataway, NJ, USA: IEEE, 2012.
7. B. Heilig, C. Beggan, and J. Lichtenberger, “Natural sources of geomagnetic field variations,” CERN—European Organization for Nuclear Research, 2018.
8. J. A. Malik, “Impact of heavy metals from building and constructive materials on aquatic environment,” in Springer Tracts in Civil Engineering. Cham, Switzerland: Springer, 2021, pp. 275–292, doi: 10.1007/978-3-030-57418-5_10.
9. Z. Wu, M. Wen, G. Peng, X. Tang, and D. Wang, “Magnetic-assisted initialization for infrastructure-free mobile robot localization,” arXiv:1911.09313, Nov. 2019. [Online]. Available: http://arxiv.org/abs/1911.09313
10. K. Zhu and A. Kiourti, “A review of magnetic field emissions from the human body: Sources, sensors, and uses,” IEEE Open Journal of Antennas and Propagation, 2022, doi: 10.1109/OJAP.2022.3186643.
11. G. Ouyang and K. Abed-Meraim, “A survey of magnetic-field-based indoor localization,” Electronics, vol. 11, no. 6, Mar. 2022, doi: 10.3390/electronics11060864.
12. N. Yu, X. Chen, R. Feng, and Y. Wu, “High-precision pedestrian indoor positioning method based on inertial and magnetic field information,” Sensors, vol. 25, no. 9, May 2025, doi: 10.3390/s25092891.
13. L. Fernandes et al., “An infrastructure-free magnetic-based indoor positioning system with deep learning,” Sensors, vol. 20, no. 22, pp. 1–19, Nov. 2020, doi: 10.3390/s20226664.
14. G. Ouyang, K. Abed-Meraim, and Z. Ouyang, “Magnetic-field-based indoor positioning using temporal convolutional networks,” Sensors, vol. 23, no. 3, Feb. 2023, doi: 10.3390/s23031514.
15. J. Dai, M. Wang, B. Wu, J. Shen, and X. Wang, “A survey of latest Wi-Fi assisted indoor positioning on different principles,” Sensors, Sep. 2023, doi: 10.3390/s23187961.
16. Y. Cai, Y. Zhao, X. Ding, and J. Fennelly, “Magnetometer basics for mobile phone applications,” Electronic Products.
17. Golden Software, “Surfer®: Powerful contouring, gridding, and surface mapping system—Full user’s guide.” [Online]. Available: www.GoldenSoftware.com
18. randomnerdtutorials, “Getting started with the ESP32 development board.” [Online]. Available: https://randomnerdtutorials.com/getting-started-with-esp32/
19. Honeywell, “3-axis digital compass IC HMC5883L.” [Online]. Available: www.honeywell.com
20. Wikipedia, “Mecanum wheel.”.
