Smart Tracks, Safe Trains
CYSF · 2026
Overview
This project uses ESP32 to control multiple trains and switches to avoid collision in real time. This project shows how we can use technology and logic to improve train safety in real-world scenario.
Analysis
Data showed that accurate collision prevention depends on proper sensor threshold calibration and timing delays in the program. Higher speeds required longer stopping distances. The addition of a third sensor improved system reliability by confirming track clearance before allowing the second train to proceed. The ESP32 processed sensor input quickly enough to prevent collisions when within Bluetooth range.
Conclusion
We concluded that we could control and automate two LEGO trains and two switches using an ESP32 microcontroller and three photo sensors. This logic can be safely used in a shared track system. The hypothesis was supported. The system successfully prevented collisions when sensors and timing logic were properly calibrated.
Citations
1. https://chatgpt.com/ ← used chat GPT to troubleshoot errors in the code.
2. https://www.youtube.com/watch?v=h-5FmGfYzRs&t=152s ← Switch design
3. https://www.arduino.cc/en/software
Acknowledgement
I acknowledge the help I received from my mom (Deepthi Kannanayakal) with troubleshooting my programs. I also acknowledge Julie Girard (Mme. Girard) for giving me time to work on the project.
Awards (1)
- SILVER
Competition history
- CYSF 2026
Resources
Related projects
CYSF · 2025
Smart LEGO Train Control: Automating Two Trains with ESP32 and Sensors
ISEF · 2020
Implementing an Alert System for Trains at Level Crossings
ISEF · 2024
A RFID based Traffic Control System (MPRCS) Suited for Ambulance
ISEF · 2023
Preventing Trespasser Fatalities in NJ Transit Rail Lines Using a YOLO Single-Stage Convolutional Neural Network
ISEF · 2022
Smart Heights
ISEF · 2025
Preventing Traffic Accidents Involving Right-Turn-On-Red at Intersections With Edge AI
ISEF · 2025
Transcend Traffic: Integrating Vision-Based Analysis, SPSA-NN Optimization, Distracted Driver Detection, and V2X Communication
ISEF · 2020
ARAMBH: An Adaptive, Data-Driven, ML-Based Signal Control System
Closest projects by meaning, across every fair and year in the corpus.
Source: Calgary Youth Science Fair