This little line follower toy has two Infrared sensors and two motors.
If the sensor sees bright, it powers the motor.
The sensor on the left controls the left motor.
The sensor on the right controls the right motor.
If both are dark it stops.
It came with a felt tip pen to draw a line on a bit of paper.
If you aim it at a black line at an angle, it turns and then wobbles down the line.
sensor_left | sensor_right | motor_left | motor_right | direction |
dark | dark | off | off | stops |
dark | bright | off | on | turns to left |
bright | dark | on | off | turns to right |
bright | bright | on | on | forward |
This worked. You could draw a line with a hammer head and it would follow it and stop at the hammer head.
- - - - - |
Small segments of lines would cause it to turn, if traversed. You could try points and switch outs which would get selected depending on the direction. It stopped if both sensors saw dark.
I found them on eBay. Magic Pen Inductive Car Follow Any Drawn Black Line Track Toy Engineering Toys
https://www.ebay.co.uk/itm/194937164186?hash=item2d6329119a:g:5aIAAOSwGIViPamx