Line Follower Obstacle Avoiding Car

Hi, I’m working on a project that can line follower and obstacle passing arduino car.
I managed to build a line-follower robot but my problem is gates. The gates are moving periodically up and down.
I’m thinking of measuring their distance and car must stop before 2 cm and delay 2 secs. Then if the distance is >2cm, car will be pass the obstacle at max. speed.
How can I do this?
After passing the gates, it must stopped and again run at slow speed until find a new gate.
Thank you for those who answered.

Hello @HalilSenn!

You could probably use an ultrasonic range finder like this one:

There is an included library on the products page which should return the distance.

I hope this helps!

1 Like

Thank you!
Can you look at this topic please? Line Follower, Gate Passing