fbpx

TABLE TOP ROBOT

Table Top Robot which moves around on the table and it never falls down. When robot Detect edge of the table, the robot takes a decision to avoid free fall, Table Top Robot uses an infrared sensor to detect the table edge. 

Block Diagram

WORKING OF TABLE TOP ROBOT

Table Top Robot uses four sensors to sense the table edges so these sensors are placed at each corner of the Robot; Front Left, Front  Right, Back Left, Back Right sensors. When the edge is detected by a robot then the output of the sensor will be HIGH and when it doesn’t detect the edge then the output is LOW. The robot moves forward when all the sensor output is LOW. When any one of the sensor output is HIGH then the robot takes necessary action.The robot has four sensors so it as sixteen different possible combinations. Among sixteen combinations, three combination 1010,0101,1111 never occurs because when the table is narrow than robot only it is possible.

TABLE TOP ROBOT LOGIC TABLE

Required Components

  1. Bread Board.
  2. Connecting wires.
  3. Castor wheel.
  4. Robot Wheel.
  5. Robot Chasis.
  6. Motor Driver l293d.
  7. DC Geared or BO motor
  8. Arduino
  9. Battery
  10. LM7805
  11. Switch
  12. Capacitors 470uf & 100uf
  13. IR sensor module

Between Arduino and L293D

Between Motor and L293D

Between Arduino &  IR Sensors

Circuit Diagram

Software Requirements

1.Arduino ID

Flow Chart

Program

#define RIGHT_MOTOR_ONE 8
#define RIGHT_MOTOR_TWO 9
#define LEFT_MOTOR_ONE 6
#define LEFT_MOTOR_TWO 7

#define F1 2
#define F2 3
#define B1 4
#define B2 5
char Received_Data;

void setup() {
/* IR SENSOR pin configuration */
pinMode(F1, OUTPUT);
pinMode(F2, OUTPUT);
pinMode(B1, OUTPUT);
pinMode(B2, OUTPUT);
/* Motor pin configuration */
pinMode(RIGHT_MOTOR_ONE, OUTPUT);
pinMode(RIGHT_MOTOR_TWO, OUTPUT);
pinMode(LEFT_MOTOR_ONE, OUTPUT);
pinMode(LEFT_MOTOR_TWO, OUTPUT);
}

void loop()
{
/* IF ALL SENSOR IS LOW ROBOT ON THE TABLE */
if (digitalRead(F1) == LOW && digitalRead(F2) == LOW && digitalRead(B1) == LOW && digitalRead(B2) == LOW)
{
MOVE_ROBOT_FORWARD();
}
else if (digitalRead(F1) == LOW && digitalRead(F2) == LOW && digitalRead(B1) == HIGH && digitalRead(B2) == LOW)
{
MOVE_ROBOT_LEFT();
}
else if (digitalRead(F1) == LOW && digitalRead(F2) == LOW && digitalRead(B1) == LOW && digitalRead(B2) == HIGH)
{
MOVE_ROBOT_RIGHT();
}
else if (digitalRead(F1) == LOW && digitalRead(F2) == HIGH && digitalRead(B1) == LOW && digitalRead(B2) == LOW)
{
MOVE_ROBOT_RIGHT();
}
else if (digitalRead(F1) == HIGH && digitalRead(F2) == LOW && digitalRead(B1) == LOW && digitalRead(B2) == LOW)
{
MOVE_ROBOT_RIGHT();
}
else if (digitalRead(F1) == HIGH && digitalRead(F2) == LOW && digitalRead(B1) == LOW && digitalRead(B2) == HIGH)
{
MOVE_ROBOT_RIGHT();
MOVE_ROBOT_FORWARD();
}
else if (digitalRead(F1) == LOW && digitalRead(F2) == LOW && digitalRead(B1) == HIGH && digitalRead(B2) == HIGH)
{
MOVE_ROBOT_FORWARD();
MOVE_ROBOT_LEFT();
}
else if (digitalRead(F1) == HIGH && digitalRead(F2) == HIGH && digitalRead(B1) == LOW && digitalRead(B2) == LOW)
{
MOVE_ROBOT_REVERSE();
}
else if (digitalRead(F1) == LOW && digitalRead(F2) == HIGH && digitalRead(B1) == HIGH && digitalRead(B2) == LOW)
{
MOVE_ROBOT_LEFT();
MOVE_ROBOT_FORWARD();
}
else if (digitalRead(F1) == LOW && digitalRead(F2) == HIGH && digitalRead(B1) == HIGH && digitalRead(B2) == HIGH)
{
MOVE_ROBOT_LEFT();
MOVE_ROBOT_FORWARD(); 
}
else if (digitalRead(F1) == HIGH && digitalRead(F2) == LOW && digitalRead(B1) == HIGH && digitalRead(B2) == HIGH)
{
MOVE_ROBOT_RIGHT(); 
MOVE_ROBOT_FORWARD();
}
else if (digitalRead(F1) == HIGH && digitalRead(F2) == HIGH && digitalRead(B1) == LOW && digitalRead(B2) == HIGH)
{
MOVE_ROBOT_REVERSE();
MOVE_ROBOT_LEFT(); 
}
else if (digitalRead(F1) == HIGH && digitalRead(F2) == HIGH && digitalRead(B1) == HIGH && digitalRead(B2) == LOW)
{
MOVE_ROBOT_REVERSE();
MOVE_ROBOT_RIGHT(); 
}
else if (digitalRead(F1) == HIGH && digitalRead(F2) == HIGH && digitalRead(B1) == HIGH && digitalRead(B2) == HIGH)
{
STOP_ROBOT();
}
}

/* MOVE ROBOT FORWARD */
void MOVE_ROBOT_FORWARD()
{
digitalWrite(RIGHT_MOTOR_ONE, HIGH);
digitalWrite(RIGHT_MOTOR_TWO, LOW);
digitalWrite(LEFT_MOTOR_ONE, HIGH);
digitalWrite(LEFT_MOTOR_TWO, LOW);
}

/* MOVE ROBOT REVERSE */
void MOVE_ROBOT_REVERSE()
{
digitalWrite(RIGHT_MOTOR_ONE, LOW);
digitalWrite(RIGHT_MOTOR_TWO, HIGH);
digitalWrite(LEFT_MOTOR_ONE, LOW);
digitalWrite(LEFT_MOTOR_TWO, HIGH);
}

/* MOVE ROBOT LEFT */
void MOVE_ROBOT_LEFT()
{
digitalWrite(RIGHT_MOTOR_ONE, HIGH);
digitalWrite(RIGHT_MOTOR_TWO, LOW);
digitalWrite(LEFT_MOTOR_ONE, LOW);
digitalWrite(LEFT_MOTOR_TWO, HIGH);
}

/* MOVE ROBOT RIGHT */
void MOVE_ROBOT_RIGHT()
{
digitalWrite(RIGHT_MOTOR_ONE, LOW);
digitalWrite(RIGHT_MOTOR_TWO, HIGH);
digitalWrite(LEFT_MOTOR_ONE, HIGH);
digitalWrite(LEFT_MOTOR_TWO, LOW);
}

/* STOP ROBOT */
void STOP_ROBOT()
{
digitalWrite(RIGHT_MOTOR_ONE, LOW);
digitalWrite(RIGHT_MOTOR_TWO, LOW);
digitalWrite(LEFT_MOTOR_ONE, LOW);
digitalWrite(LEFT_MOTOR_TWO, LOW);
}


 

Leave a Reply

Your email address will not be published. Required fields are marked *