Railroad Level Crossing With Gates
a) Two servo motors controlling the gates( see http://arduino.cc/en/reference/servo )
b) Ultrasonic sensor ( HC-SR04) that detects presence of ‘train’ on track http://www.gearbest.com/development-boards/pp_58067.html?currency=USD&gclid=CLDosPiEvcQCFdgQgQod03YAQA
c) Piezo or miniature speaker to sound warning signals
If train detected with sensor, warning sounds go off, then gates are lowered for a time, then raised, then all-clear audio sounded
Video: https://youtu.be/--P7NaNo_FI
Challenges:
- Measuring distance with the HC-SR04
- If-then conditional
- Operating Servos( see Example code)
- Sounding Noise( see Tone function)
- Delay function
How could level crossings be made safer?