Arduino Gate Arm (Ramp)


There is a railroad crossing near my house and my 2yr old likes to watch the gate arm go up and down to let the train/traffic cross. As much as I’d love to stay with him on that crossing all day long 🙂 I decided it would be much easier to build a smaller version of the gate arm at home for him to play with.

1 x Arduino Pro Mini
3 x RGB LEDs
2 x 100 Ohm resistors
1 x Servo motor
1 x Sharp IR sensor

The operation is pretty simple, when there is no obstacle (car) in front of the gate, the arm is in horizontal position. When obstacle is detected in front of the gate, it signals by flashing green lights that it is going to vertical position in order to let the traffic go through. It stays up as long as there are obstacles detected in front of the gate. Once there are no obstacles in front of the ramp it signals with flashing red lights that it is going to close and then goes into the horizontal position.

You can check out the code at my GitHub repo:

If you liked this blog post I’d appreciate if you followed me on Twitter

Related Post

Remember to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someone

3 thoughts on “Arduino Gate Arm (Ramp)

  1. Hi, which ino is the correct one to load into my arduino? I am relatively new to arduino and understand that the code is to be uploaded, but which one? Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *