Hi! This is a line follower robot that requires no programming, instead, the behaviour of the robot is determined by an electronic circuit. This build is fairly simple and if you have all the materials it will most likely take less than 2 hours to build and test it.
The circuit for this robot consists of 3 parts. The first is the CNY70 sensors, and the circuit for them is in the first image. Where it says A0, the voltage changes analogically to the amount of light reflected on the surface. To distinguish between black and white surface, we will need a comparator which outputs a HIGH or LOW voltage depending on the voltage threshold determined with the trimpot. The second image shows the circuit for the comparator, you can later adjust the trimpot to set the correct sensitivity for your surface. In the last image, there is the circuit to drive two motors from the output of the comparator and using 2 transistors to manage the current.
VERY IMPORTANT: You should connect the left sensor with the right motor and the right sensor with the left motor, you can see an explanation of why this will make the robot work in the pictures.
Tip: You can solder a LED on the front just as a supporting point so that the sensors don't scrape with the floor.