
How it works and the block diagram




At the first stage when they do not see any walls or holes all motors are on and the robot moves forward. At this time the sensors are getting no signal and therefore the control and power circuit also do not receive any command but at the second stage when the wall or hole sensors get activated by seeing a hole or a wall they send signals to the control and power circuitry. At this time one of the motors turns off and the polarity of the other motor changes and this causes the robot to turn 360 degrees around itself and in reverse movement until it does not see the wall or the hole anymore.
As soon as the sensors do not see the hole or wall, it keeps going forward again like the first stage but in another direction. The sensors and control circuitry use a 12 volt battery and the motor system uses a separate 6 volt battery. This is because it is easier to change only power system batteries every time and the control system do not need a lot of power and therefore their power supply lasts longer.