https://circuitdiagrams.in/automatic-railway-gate-control-system/
How to Build an Automatic Railway Gate Control Using Arduino