Introduction: The Soccer Robot

If you love to make robots and see them rolling around your house, then you'll love this one too! This robot can play soccer by dribbling and kicking a ball, though not as good as Messi or Ronaldo. It is controlled using a smartphone with wireless bluetooth connection which enables you to make many of them and have a robot soccer match!

This project uses the Mediatek Linkit ONE as it's control centre. It is connected to a bluetooth module which receives data from a smartphone and then sends it to the chip which then processes it and does a task accordingly. For movements, the robot uses two plastic geared motors (300 RPM) while for kicking the ball, it uses a micro servo motor connected to a metal shaft. As for the power, it uses a 6v battery pack which consists of 4 1.5v AA batteries to power the geared motors + a 3.7v lithium battery to power linkit one, BT module and servo motor. The entire project can be completed within 2-3 hrs with some basic soldering skills and a little knowledge about using linkit one.

Although the robot looks complex externally, but making it is a very simple task thus it can be one of those 'Simple Bots'. I have personally tested the robot and the result turned out to be great! I am so sorry for not publishing a video. The major reason was that my exams are going to start so I published this instructable in a hurry. This will also be my last instructable before christmas.

Note: I have used an external bluetooth module (HC-05) for bluetooth communication although linkit one already has bluetooth as I couldn't get the latter to work with 'Bluetooth RC Controller App'. If any one of you has a solution to this problem, please mention it in the comment section below.

If you liked the concept and documention, please vote for me and don't forget to follow for more cool projects! You can even like my facebook page- Frozen Solenoid for amazing projects, videos and facts related to science and technology.

Step 1: Parts and Tools

The following parts and tools are required to make this project. The total cost including linkit one was around $150 or 9000INR however the value is not very accurate. If you can make a cheap base for the robot, the cost can be reduced to $100. The parts can be obtained from any electronics online store.


Parts:

  • 1x Mediatek linkit one
  • 1x GoPiGo robot base kit (this is optional, you can even make your own base) (Amazon or Dexter Industries)
  • 2x Geared motors (are included in the GoPiGo kit)
  • 1x Caster wheel (is included in the GoPiGo kit)
  • 1x Micro servo motor
  • 1x 3.7v Lithium battery
  • 1x L293d motor driver IC
  • 1x HC-05 bluetooth module
  • 1x Battery pack to drive the motors
  • 1x 16 pin IC socket
  • Male-male jumper wires
  • Male-female jumper wires
  • Perfboard

Tools:

  • Soldering iron
  • Soldering wire
  • Hot glue gun w/glue sticks
  • Screwdriver
  • Pliers
  • Wire cutter/stripper

Step 2: Assemble Your Robot Base

The very first step is to assemble your robot base. Recently, I got a GoPiGo kit as a nice gift from instructables. The kit included a GoPiGo robot base with geared motors and caster wheel. It can also be ordered separately from the official Dexter Industries website. The kit consists of acrylic parts which look amazing on assembling the base. The process is quite simple and you just need a screwdriver and little bit of patience to make it.

However, using only the GoPiGo as your robot platform is not mandatory. You can even make your own base using wood, acrylic, plastic or aluminium. That simply depends on your imagination. Make sure that you order two standard gear motors along with a caster wheel if you are making your own base. Solder wires on to your motors before attaching them to the base.

For assembling the GoPiGo, you can follow the detailed step by step instructions given on the official Dexter Industries website or you can follow the images given above.

Step 3: Connect the BT Module

Most of you would have this doubt that why did I use an external bluetooth module if linkit one already has bluetooth? Well, I am very sorry for that but after a lot of experimenting, I couldn't get the linkit one in-built bluetooth work with Bluetooth RC Car App. You have to do some modifications as far as I know to get it to work as it is not compatible with most of the apps. However, if someone knows the solution to this problem, please mention it the comment section below so that I can make this robot better.

Connect your bluetooth module as per the following:

  • Vcc of module ----- 5v of linkit one (or 3.3v depending on your module)
  • Gnd ---- Gnd
  • Tx ---- D0 (Rx)
  • Rx ---- D1 (Tx)

Step 4: Solder the Motor Driver Circuit

Since the output current of linkit one's digital pin is too low to drive a motor, you have to have an external motor driver to make your robot move. Now you can either directly order a motor driver shield to reduce your work but increase your bills or you can make your own motor driver, as I did.

The circuit that I made uses L293d. The role of this IC is to receive signals from linkit one and drive the motors accordingly. It shall be noted that you need to use another battery pack apart from the linkit one battery to power the motors as the lithium battery is too weak to do this task.

Follow the schematic given above to solder the circuit. I have added some male, female headers and screw terminals to easily make all the connections without the need of soldering everything permanently. Use an IC socket to L293d to prevent overheating of the IC.

Step 5: Connect the Motor Driver to Linkit One

After soldering the entire circuit, connect it to linkit one using some male to male jumper wires. You can follow the schematic above or the text below. After connecting, zip the wires together so that it doesn't look messy.

  • Pins 1, 9, 16 of L293d ---- 5v of Linkit one
  • Pins 4, 5, 12, 13 ---- Gnd
  • Pin 2 ---- D4
  • Pin 7 ---- D5
  • Pin 10 ---- D6
  • Pin 15 ---- D7

Step 6: Connect the Motors to the Driver Circuit

And now, what you have to do is to connect both the motors to the driver circuit. If you have used 4 motors instead of two, connect the left ones in parallel and the same with right ones to make two pairs of motors. It will be easier for you to connect and switch connections if you use female jumper wires soldered.

You can follow the schematic above for connecting the motors. Simply plug them to the male headers you soldered earlier. I suggest not to solder them directly to the circuit as you may need to switch the polarity for the robot to move properly. As for now, you can connect them in either way.

After connecting them, glue everything in place in any way you want.

Step 7: Connect and the Glue the Servo

A soccer robot will be incomplete if it does not have the feature of kicking the ball. So, to add this feature I used a micro servo motor as it can be easily controlled at different angles and is accurate. It would be a bit tricky to make the kicker with a normal gear motor so a better option can be servo.

First connect it to linkit one with some jumper wires as per the following:

  • Vcc of servo (orange) ---- 5v of Linkit one
  • Gnd (brown) ---- Gnd
  • Signal (yellow) ---- D3

After that, glue the servo in such a way that the shaft does not touch the base of the robot when rotating it. You can use a suitable attachment as per your requirement. Please note that servo can be driven by only PWM pins which are D3 and D9 on Linkit one.

Step 8: Connect the Kicker

Now you directly can't kick a ball with the shaft of a servo which is too thin and small. Thus, you need to connect some sort of a metal of wood part to the servo so that it can kick the ball cleanly.

I used a metal part from one of the kits I had but you can use almost anything you want like scrap iron pieces. You can also place two dribblers that will keep the ball in place when the robot is moving

Step 9: Upload the Code

Upload the code given in the ino file below to your linkit one. If you are uploading the code for the first time to your board, you can follow my Linkit ONE Getting Started Guide to help you set up your board and to get started with it.

Before uploading, make sure that switches 1, 2 and 3 should be in UART, USB and SPI positions respectively. You have to remove the Rx and Tx wires from the bluetooth wire before uploading as well else it would show an error.

/*
The Soccer Robot Source Code Made by- Saiyam Agrawal */ #include Servo.h // import the servo library Servo myServo; int incoming = 0;

void setup() { myServo.attach(3); // initialize servo pin myServo.write(100); // set the servo to 100 degrees pinMode(13, OUTPUT); // set all the pins as output pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); Serial1.begin(9600); // connect to BT module } void loop() { if(Serial1.available() > 0) // check if data is available { incoming = Serial1.read(); // read the data digitalWrite(13, HIGH); }

switch(incoming) {

case 'F': // move forward digitalWrite(4, HIGH); digitalWrite(5, LOW); digitalWrite(6, LOW); digitalWrite(7, HIGH); break;

case 'B': // move backwards digitalWrite(4, LOW); digitalWrite(5, HIGH); digitalWrite(6, HIGH); digitalWrite(7, LOW); break;

case 'R': // move right digitalWrite(4, HIGH); digitalWrite(5, LOW); digitalWrite(6, HIGH); digitalWrite(7, LOW); break;

case 'L': // move left

digitalWrite(4, LOW); digitalWrite(5, HIGH); digitalWrite(6, LOW); digitalWrite(7, HIGH); break;

case 'S': // stop

digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); digitalWrite(7, LOW); break;

case 'X': // kick myServo.write(180); delay(750); myServo.write(100); delay(1000); break; } }

Step 10: Add Power to the Robot

The last step for the building process is to connect power to your robot. For powering the Linkit one, servo and bluetooth module, you can simply use the 3.7v lithium battery provided with the board but for the motors, that battery is too weak. So, you will need a separate battery pack to power the motors. I used 4 AA batteries to produce 6v which can be the best and the cheapest option however there are several other types you can use like lead acid, lithium ion/polymer etc.

For the lithium battery, simply connect it to the socket present on linkit one. For the battery pack, connect the positive terminal to L293d's pin 8 and negative terminal to Linkit one's gnd. Glue both the batteries in place.

Step 11: Install the App

For controlling the robot with a smartphone, you will need to install the app named "Bluetooth RC Car Controller" which is available for free on Google Play Store. Other apps are not recommended as the code that I designed is compatible with this app only.

After installing the app, switch on your robot and pair the bluetooth module with your smartphone and connect it through this application. You will now be able to control the robot by pressing the arrow buttons. For kicking, press the triangle shaped button at the top and immediately press it again after a short time interval. If your smartphone asks for a pairing key, most of the modules have '1234'.

Step 12: You're Done!

And, you're done making your own soccer robot! Now what you have to do is, make two or more such robots, set up a field, get a ball (I had to use a small plastic ball. Obviously, the big real one won't do it) and just enjoy playing with it. You can even make a bigger one so that you can even play with a real ball!

This instructable comes to an end with this. Hope you liked it. Any suggestions, modifications, errors are welcome in the comment section below. A feedback would be really appreciated. Don't forget to follow for more great projects!

If you really liked this instructable and think that this deserves a win, you can vote for me in all the contests (look for the orange icon above).

For more amazing projects, facts and videos related to science and technology, please like my newly created facebook page- Frozen Solenoid.

Robotics Contest

Second Prize in the
Robotics Contest

Tech Contest

Participated in the
Tech Contest