Christmas is just around the corner and many of us are still wondering what to get as a gift for our kids, siblings, and cousins. Train sets have been one of the most popular and enjoyable gifts for a long long time. This year, how about adding a DIY twist to it so that they can also learn a thing or two while building and playing with their train set?
Presenting to you the DIY automatic railway crossing – an easy to build yet engaging project that gives an idea of how railway crossings work whenever a train passes by. Your kids, siblings, and cousins are sure going to have an amazing time with it!
Want to make one? We’ll show you how!
Now, we know that at the crossing, barriers are mounted to stop the vehicles while the train passes by.
Now, add the barriers to your railway crossing.
We will be using two servos.
We have fixed as well covered the servos using red tape.
Make sure you keep the servo head out of the tape.
Now that the barrier mechanism is complete, we need to make the barriers.
Logic and Flowchart
The logic is very simple: if the ultrasonic sensor detects the train (distance sensed by the sensor is less than a threshold value, say 10cm), the barriers (servo horns) will close. They will automatically open after a few seconds, i.e. the servo horns will automatically return to their start position.
The following Arduino Code should be uploaded to evive.
With this, your DIY automatic railway crossing is now up and standing to warn cars whenever a train passes by! Enjoy!