I want to build a line follower machine for a competition and as I know the track will include an obstacle like a brick on the line that the machine will have to avoid coming back on the line.I will attach a basic image just for a better understanding.

enter image description here

Does anybody has an idea like what kind of sensor should I use for the best performance in terms of time? And just an idea how should I implement it.

My first idea that popped in my head it's an ultrasonic sensor but I'm afraid that it's too slow since my machine will have a high speed.And like checking all the time the response of the ultrasonic sensor it's not a good idea even though someone suggested me with an interrupt rutine could work.

Any idea is welcomed and thanks in advance.


You could use a Time-of-flight sensor. STMicroelectronics makes some nice ones.

They work on the same principle as the ultrasonic sensor you mentioned, but with light instead of sound.

As far as i know they are quite reliable, precise, fast and have a relatively long range (up to some meters)

Adafruit has a breakout board with all the required additional components on-board: https://www.adafruit.com/product/3317

Note that i don't have never used one, but i've seen them in action here and there.

| improve this answer | |
  • \$\begingroup\$ +1 Figuring out how to navigate round it is another matter :D \$\endgroup\$ – Trevor_G Mar 28 '18 at 15:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.