Robotics projects

DIY Train collision avoidance system using Havi Elements

Last Updated on 03/12/22 0

Trains could have been the safest way to travel because they run on the rails, a defined path.

But that very path has caused some of the major accidents in the history of transportation. There are multiple types of train accidents and one of the major is a train’s collision with the other.

Yes, it has happened several times in history that two trains come from opposite directions at the same time on the same track and collide with each other. That has caused deadliest accidents claiming several thousand lives.

Eventually train running institutions across the world have designed several train accident prevention systems. One of the most recognised is the “Train Accident Collision System” or TACS, designed by Indian railways.

TACS uses radio frequency and GPS together to prevent train collisions.

The technology is very advanced and promising.

But we can create our own working model of the train accident collision system using Havi’s robotics kits too!

Yes, we can use IR sensors to prevent train collisions. Let’s see how.

What will you need?


  • Power Elements – 2
  • Motor Elements – 2
  • IR element pair with 3 pin cable – 2
  • Flip Elements – 2


  • Wheels – 4
  • Geared motors – 2
  • Double sided tape
  • Craft material
  • Powerbank with USB cable – 2

The making

Step:1 Craft your trains.

Prepare trains using card board or construction papers as per your choice and design thoughts. You can refer to the internet to get the craft paper train ideas.

Step 2 Use of geared motors and havi elements

You need to power your trains using geared motors supplied with Havi Elements. Hence should use at least one motor and two wheels for the train. Rest can be card board wheels.

Step 3 Test your trains

Use Power – Motor circuit and plug the geared motor into the motor element. Turn on the power element and make the train run on a surface.

Step 4

Now, you can update the element circuit in both the trains to the following:

Train collision detection circuit
This circuit will stop the motor when there is an object in front of it.

Place the IR LED at the front side of your train engine, so that the LEDs face the front.

Train collision detection
Turn the power on and test your train. If you keep your hand in-front of IR Element the train would stop. As you take the hand away, the motor will turn and the train will Start moving.

Tune the IR element using potentiometer to detect the object at maximum possible distance. Know how IR sensor works.

Set potentiometer range
You can now keep the trains in front of each other so that their IR LEDs point each other. Turn the power on for both the trains and the trains would start moving.

As they approach each other, the IR signals the train A will stop the train B and vice versa. Check the video here.

This can be a playful toy at home and a wonderful project for science projects.

Do it and share your work with everyone.

Also read
How to make an obstacle avoiding robot
How to make a line following robot
Newton’s disc-a DIY color disc experiment

Liked this article? Share with your friends

Your Cart
Your cart is empty
Calculate Shipping
Apply Coupon