A Low-Cost ESP32-CAM Prototype for Obstacle Monitoring on a Model Railway Track: Combining Camera Confirmation with Time-of-Flight Ranging
Authors
4Department of Electrical and Electronics Engineering, K. Ramakrishnan College of Technology (Autonomous), Samayapuram – 621 112, Tamil Nadu, India (India)
4Department of Electrical and Electronics Engineering, K. Ramakrishnan College of Technology (Autonomous), Samayapuram – 621 112, Tamil Nadu, India (India)
4Department of Electrical and Electronics Engineering, K. Ramakrishnan College of Technology (Autonomous), Samayapuram – 621 112, Tamil Nadu, India (India)
Department of Electrical and Electronics Engineering, K. Ramakrishnan College of Technology (Autonomous), Samayapuram – 621 112, Tamil Nadu, India (India)
Article Information
DOI: 10.51583/IJLTEMAS.2026.151100014
Subject Category: Engineering and Technology
Volume/Issue: 15/11 | Page No: 193-205
Publication Timeline
Submitted: 2026-10-29
Accepted: 2026-11-03
Published: 2026-11-23
Abstract
A railway obstacle is most dangerous when nobody sees it in time, and nobody can watch every stretch of track all day. This paper presents a low-cost obstacle detection and monitoring prototype for a model railway track. A VL53L1X time-of-flight (ToF) sensor measures the distance to whatever is in front of the unit, and an ESP8266 NodeMCU compares each reading against a 15 cm threshold. Once an object reaches that threshold, the controller turns on a buzzer through a 2N2222 transistor driver and sends a trigger signal to an AI-Thinker ESP32-CAM, which takes a picture of the obstacle. Distance and status go to a web dashboard so an operator can keep an eye on the track from a distance. The paper covers the system architecture, the full hardware connections (including the GPIO configuration of the ESP8266, VL53L1X and ESP32-CAM), the firmware decision logic and the website monitoring path. In bench tests the assembled prototype responded as expected in every recorded condition: no alert beyond 15 cm, buzzer and camera trigger at 15 cm and closer, and a return to the clear state when the obstacle was taken away. Since these are single recorded outcomes, accuracy, false-detection rate and response time are treated as design bounds here, and the number of trials needed to report them statistically is specified. The camera is used only for visual confirmation and no image classification is done. The prototype is meant for controlled model-track demonstration and is not a certified safety device.
Keywords
ESP8266, ESP32-CAM, VL53L1X, Time-of-flight sensor, Railway obstacle detection, IoT monitoring, Blynk
This article is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0).
Downloads
References
1. R. Ristić-Durrant, M. A. Franke, and K. Michels, “A review of vision-based on-board obstacle detection and distance estimation in railways,” Sensors, 2021. [Google Scholar] [Crossref]
2. Rampriyaa et al., “A comparative assessment of deep neural network models for detecting obstacles in the real time aerial railway track images,” Applied Artificial Intelligence, 2022. [Google Scholar] [Crossref]
3. Zhang et al., “Railway obstacle intrusion warning mechanism integrating YOLO-based detection and risk assessment,” Journal of Industrial Information Integration, 2024. [Google Scholar] [Crossref]
4. Chang, Wu, and Lin, “Design and implementation of ESP32-based edge computing for object detection,” Sensors, 2025. [Google Scholar] [Crossref]
5. Zhao et al., “A real-time and high-accuracy railway obstacle detection method using lightweight CNN and improved transformer,” Measurement, 2024. [Google Scholar] [Crossref]
6. Espressif Systems, “ESP32 series datasheet” and “ESP32 technical reference manual.” [Online]. Available: https://www.espressif.com/ (accessed Oct. 2026). [Google Scholar] [Crossref]
7. Espressif Systems, “esp32-camera driver documentation and examples.” [Online]. Available: https://github.com/espressif/esp32-camera (accessed Oct. 2026). [Google Scholar] [Crossref]
8. STMicroelectronics, “VL53L1X time-of-flight ranging sensor,” datasheet and product documentation. [Online]. Available: https://www.st.com/ (accessed Oct. 2026). [Google Scholar] [Crossref]
9. TensorFlow, “TensorFlow Lite for Microcontrollers.” [Online]. Available: https://www.tensorflow.org/lite/microcontrollers (accessed Oct. 2026). [Google Scholar] [Crossref]
10. Edge Impulse, “Embedded machine learning documentation.” [Online]. Available: https://docs.edgeimpulse.com/ (accessed Oct. 2026). AI-Thinker, “ESP32-CAM module documentation and schematic” (to be checked against the exact board revision used). [Google Scholar] [Crossref]
11. Blynk, “Blynk documentation: virtual pins, templates and device authentication.” [Online]. Available: https://docs.blynk.io/ (accessed Nov. 2026). [Google Scholar] [Crossref]
12. Adafruit Industries, “Adafruit VL53L1X library for Arduino.” [Online]. Available: https://github.com/adafruit/Adafruit_VL53L1X (accessed Nov. 2026). [Google Scholar] [Crossref]
13. Espressif Systems, “ESP8266EX datasheet.” [Online]. Available: https://www.espressif.com/ (accessed Nov. 2026). [Google Scholar] [Crossref]
This work is licensed under CC BY 4.0