


Different sections of the circuit and the circuit descriptions
We have used two sensors for this robot. They are both infra red sensors which they transmit and receive infra red light. They both work with 12 volt batteries. These sensors have 3 wires which 2 of them are for the supply and one is the output signal.
One of these sensors is for sensing the walls in front and the other one for detecting holes.
When the wall sensor sees a wall, it commands to control system by its third wire and the other sensor for holes work the opposite way. It always sees its front route and is always detecting the ground in front of robot. As soon as a hole appears in front of robot, its transmitted infra red light do not reflect back to the sensor and the sensor detects a hole.
The operation of wall sensor S1 and the hole sensor S2 are the opposite of each other.
The wall sensor acts whenever there is a wall in front and the hole sensor acts whenever there is no solid ground in front of its movement.
As you can see in the electrical schematic, each sensor is being driven by a BC327 transistor. Each transistor activates a relay named K3 and K4 .As you can notice we are using a normally closed contact of K4 in parallel with a normally open contact of K3 .
That is because K4 is always active since its hole sensor is always detecting the solid road in front of it and therefore that contact goes open in normal operation when sees no hole and both contacts of K3 and K4 are therefore open when the robot sees no walls or no holes in front.
At this stage which we called it stage one, all three relays of K1A, K2A and K3 are off and as you can notice on the motor power circuit with the main switch SW in on position, both motors go on and at the same direction.
As soon as any of the two sensors detects a wall or a hole, one or both of K3 and K4 sensors get closed and causes the three relays of K1A, K1B and K2 get activated and at this point M2 motor goes off and M1 motor switches polarity for reverse movement and causes the robot to rotate backward. This situation we call it stage two. When it stars to rotate backward, the robot may not rotate enough to change direction so we have used a capacitor C1 to make a virtual delay for the rotation timing. This timing is enough to make the robot turns backward enough to change a good change in direction.
With this circuit, you may start the robot to move on a table with some edges on some sides. It goes and goes, never falls off a table and never hits any edges. It’s amazing and it works perfectly.