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.
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.