Khaled Md SaifullahTaisir Jibian RahiAvijit Datta
Published © MIT

Soccer Bot

This is a Robot that can play football.

AdvancedFull instructions provided12 hours10,222
Soccer Bot

Things used in this project

Hardware components

Arduino Mega 2560
Arduino Mega 2560
×1
Dual H-Bridge motor drivers L298
SparkFun Dual H-Bridge motor drivers L298
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Breadboard (generic)
Breadboard (generic)
×1
Geared DC Motor, 12 V
Geared DC Motor, 12 V
×4
Li-Ion Battery 1000mAh
Li-Ion Battery 1000mAh
×1
Jumper wires (generic)
Jumper wires (generic)
×50

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Mastech MS8217 Autorange Digital Multimeter
Digilent Mastech MS8217 Autorange Digital Multimeter
Extraction Tool, 6 Piece Screw Extractor & Screwdriver Set
Extraction Tool, 6 Piece Screw Extractor & Screwdriver Set
Drill / Driver, Cordless
Drill / Driver, Cordless
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Story

Read more

Schematics

Soccer-Bot-Circuit

Code

Soccer-Bot-Code

Arduino
int motorRightA = 8;    //Right Motor-clockwise
int motorRightB = 9;   //Right Motor-anticlockwise
int motorLeftA = 11;    //Left Motor-clockwise
int motorLeftB = 10;    //Left Motor-clockwise
char bt = 0;       //Bluetooth Control
void setup()
{
  pinMode(motorRightA, OUTPUT);
  pinMode(motorRightB, OUTPUT);
  pinMode(motorRightB, OUTPUT);
  pinMode(motorLeftB, OUTPUT);
  Serial.begin(9600);
}
void loop(){
  control();
}

// All the Controls of the Soccer Bot
void control() {
  if (Serial.available() > 0)
  {
    bt = Serial.read();
    if (bt == 'F')       //move forwards
    {
      digitalWrite(motorRightA, HIGH);
      digitalWrite(motorLeftA,  HIGH);
      digitalWrite(motorRightB,LOW);
      digitalWrite(motorLeftB,LOW);
    }
    
    else if (bt == 'S')     //stop!
    {
      digitalWrite(motorRightA, LOW);
      digitalWrite(motorRightB, LOW);
      digitalWrite(motorLeftA, LOW);
      digitalWrite(motorLeftB, LOW);
    }
    else if (bt == 'R')    //right
    {
      digitalWrite(motorRightA, LOW);
      digitalWrite(motorRightB, LOW);
      digitalWrite(motorLeftA, HIGH);
      digitalWrite(motorLeftB, LOW);
    }
    else if (bt == 'L')     //left
    {
      digitalWrite(motorRightA, HIGH);
      digitalWrite(motorRightB, LOW);
      digitalWrite(motorLeftA, LOW);
      digitalWrite(motorLeftB, LOW);
    }
    else if (bt == 'I')    //forward right
    {
      digitalWrite(motorRightA, HIGH);
      digitalWrite(motorRightB, LOW);
      digitalWrite(motorLeftA, LOW);
      digitalWrite(motorLeftB, HIGH);
    }
    else if (bt == 'G')    //forward left
    {
      digitalWrite(motorRightA, LOW);
      digitalWrite(motorRightB, HIGH);
      digitalWrite(motorLeftA, HIGH);
      digitalWrite(motorLeftB, LOW);
    }
    else if (bt == 'B')       //move backwards
    {
      digitalWrite(motorRightB, HIGH);
      digitalWrite(motorLeftB, HIGH);
      digitalWrite(motorRightA,LOW);
      digitalWrite(motorLeftA,LOW);
      
    }
  }
}

Credits

Khaled Md Saifullah

Khaled Md Saifullah

18 projects • 44 followers
🦸Tech Enthusiast 👨🏾‍💻Programmer 📳IoT Specialist
Taisir Jibian Rahi

Taisir Jibian Rahi

7 projects • 7 followers
Never regret in life.
Avijit Datta

Avijit Datta

3 projects • 5 followers

Comments