This soccer robot can move forward, reverse, forward-left, forward-right, reverse-left and reverse-right with the help of an Android phone. The speed of its movement is controlled by the angle of rotation of the phone. The robot also kicks a ball when the phone is shaken. Fig. 1 shows the author’s prototype of the robot and Fig. 2 shows the app running on an Android phone to control the robot.
Circuit and working
Fig. 3 shows the circuit of the soccer robot. The circuit is built around Arduino UNO board (BOARD1), servo motor (connected at CON5), Bluetooth module JY MCU BT, motor driver L293D (IC1) and two DC motors (M1 and M2).
The circuit uses two 9V batteries; one for the Arduino board (BOARD1) and the other for DC motors. The 5V regulated supply for rest of the circuit is provided by Arduino board itself. LED on BOARD1 indicates the presence of power supply.
All new smartphones contain an accelerometer sensor. A phone with an accelerometer can detect the angle it is being held at. It can also detect rotation and motion gestures such as swinging, shaking and flicking. The accelerometer can detect whether the phone is upright or sideways, and automatically rotate the graphics on the screen accordingly. Its another common use is in controlling games and other applications (such as music player) by moving or shaking the phone. When the phone is rotated in different directions, x,y,z values of accelerometer sensor change. The android app for this project sends these x,y,z values to the robot via Bluetooth.
Bluetooth module. The Bluetooth module used in this project is JY MCU BT, which can be connected to any device via built-in UART interface. It can communicate with other Bluetooth-enabled devices such as mobile phones, handheld computers and laptops. The module runs on a 3.6V to 6V supply. Fig. 4 shows a picture of this Bluetooth module.
Servo motor. A servo motor is used for kicking the ball in this project. Servos are extremely useful in robotics. The motors are small but extremely powerful for their size. A servo motor mainly comprises a DC motor, gear system, position sensor (which is generally a potentiometer) and control electronics as shown in Fig. 5.
The DC motor is connected with a gear mechanism which provides feedback to a position sensor. The potentiometer allows the control circuitry to monitor the current angle of the servo motor. If the shaft is at correct angle, the motor shuts off. If the circuit finds that the angle is incorrect, it keeps the motor on until the angle is corrected. A normal servo is used to control an angular motion up to 180 degrees. servos are incapable of turning further due to a mechanical stop built on the main output gear.
The control wire is used to communicate the angle. The angle is determined by the duration of a pulse that is applied to the control wire. This is called pulse-coded modulation. The servo expects to see a pulse every 20 milliseconds. The length of the pulse will determine how far the motor turns. For example, a 1.5-millisecond pulse could turn the motor to 90-degree position (often called the neutral position). If the pulse is shorter than 1.5 milliseconds, the motor would turn lesser. If the pulse is longer than 1.5 milliseconds, the shaft would turn closer to 180 degrees as shown in Fig. 6.
Servo motor arm is connected to a metal or wooden piece, so that the servo arm acts as a leg to kick the ball.
Arduino UNO board. Arduino is an open source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is intended for artists, designers, hobbyists and anyone interested in creating interactive objects or environments.
Arduino UNO is a board based on ATmega328 microcontroller. It consists of 14 digital input/output pins, six analogue inputs, a USB connection for programming the on-board microcontroller, power jack, an in-circuit serial programming (ICSP) header and a reset button. It is operated with a 16MHz crystal oscillator and contains everything needed to support the microcontroller. It is very easy to use as the user simply needs to connect it to a computer with a USB cable, or power it with an AC-to-DC adapter or battery, to get it started. The microcontroller on the board is programmed using Arduino programming language and Arduino development environment.
Download the PCB and component layout PDFs: click here
Download source code: click here
Pins 8 and 9 of BOARD1 are connected to pins Tx and Rx of the Bluetooth module, respectively. Pin 10 is connected to PULSE pin of servo motor to control the angle of movement. Pins 2 through 7 of BOARD1 are output pins that are connected to IC1 for controlling the motors. Pins 2, 3 and 4 of BOARD1 are connected to IN3, EN2 and IN4 of IC1 to control motor M1, and pins 5, 6 and 7 are connected to IN1, EN1 and IN2 of IC1 to control motor M2. EN1 and EN2 are used to control speeds of the motors.