How abarnamurugan-commits/automated-railway-level-crossing-system-arduino works
The primary product is an Arduino railway-crossing controller: simulated arrival/departure buttons drive a six-state safety cycle, which controls the gate and warnings. A separate Python/React demo mirrors that cycle, exposes status and logs, and can run a simulated crossing; the README says it is not live-connected to the circuit. Hardware relationships are documented in the README; software relationships are supported by the sampled source. The Arduino sketch was not sampled, so its internal implementation is represented only at the documented subsystem level.
Main entry points: main.py Demo API · railway_crossing.ino Crossing controller · App.jsx Status and logs view · state_machine.py Crossing state machine
Components 11
Crossing hardware
- Crossing controller
src/railway_crossing.ino - Servo gate
src/railway_crossing.ino - LEDs and buzzer
src/railway_crossing.ino - LCD and serial
src/railway_crossing.ino
Demo backend
- Demo API
backend/app/main.py - Crossing state machine
backend/app/state_machine.py - Log storage
backend/app/db.py - Dashboard connection
backend/app/main.py
Web dashboard
- Status and logs view
frontend/src/App.jsx
Other components
- Train buttons
- Dashboard user
Connections 14
- Train buttons → Crossing controller: signal arrival/departure
README.md - Crossing controller → Servo gate: positions gate
README.md - Crossing controller → LEDs and buzzer: controls warnings
README.md - Crossing controller → LCD and serial: reports status
README.md - Dashboard user → Status and logs view: uses
frontend/src/App.jsx - Status and logs view → Demo API: requests status/logs
frontend/src/App.jsx - Status and logs view → Demo API: starts demo
frontend/src/App.jsx - Demo API → Crossing state machine: handles crossing events
backend/app/main.py - Demo API → Log storage: initializes and fetches logs
backend/app/main.py - Crossing state machine → Demo API: calls log callback
backend/app/state_machine.py - Demo API → Log storage: writes crossing events
backend/app/main.py - Demo API → Dashboard connection: broadcasts updates
backend/app/main.py - Dashboard connection → Status and logs view: streams status
frontend/src/App.jsx - Demo API → Crossing state machine: reads snapshot
backend/app/main.py