This soccer robotic challenge can effortlessly transfer ahead, reverse, and navigate in a number of instructions, together with forward-left, forward-right, reverse-left, and reverse-right, all managed through an Android cellphone. The pace of its motion is managed by the angle of rotation of the cellphone. The robotic additionally kicks a ball when the cellphone is shaken.
Soccer Robotic Circuit
Proven beneath is the circuit of the soccer robotic. The circuit is constructed round an Arduino UNO board (BOARD1), servo motor (related at CON5), Bluetooth module JY MCU BT, motor driver L293D (IC1) and two DC motors (M1 and M2).
The circuit makes use of two 9V batteries; one for the Arduino board (BOARD1) and the opposite for DC motors. The 5V regulated provide for the remainder of the circuit is offered by the Arduino board itself. LED on BOARD1 signifies the presence of an influence provide.
All new smartphones include an accelerometer sensor. A cellphone with an accelerometer can detect the angle it’s being held. It will probably additionally detect rotation and movement gestures equivalent to swinging, shaking and flicking.
The accelerometer can detect whether or not the cellphone is upright or sideways, and mechanically rotate the graphics on the display accordingly.
One other frequent use is in controlling video games and different functions (equivalent to music gamers) by shifting or shaking the cellphone.
When the cellphone is rotated in numerous instructions, the x, y, and z values of the accelerometer sensor change. The Android app for this challenge sends these x, y, and z values to the robotic through Bluetooth.
Bluetooth Module
The Bluetooth module used on this challenge is JY MCU BT, which may be related to any system through a built-in UART interface. It will probably talk with different Bluetooth-enabled gadgets equivalent to cell phones, handheld computer systems and laptops. The module runs on a 3.6V to 6V provide.
Servo Motor
A servo motor is used for kicking the ball on this challenge. Servos are extraordinarily helpful in robotics. The motors are small however extraordinarily highly effective for his or her measurement. A servo motor primarily includes a DC motor, gear system, place sensor (which is mostly a potentiometer) and management electronics as proven within the picture beneath.
The DC motor is related with a gear mechanism which gives suggestions to a place sensor. The potentiometer permits the management circuitry to observe the present angle of the servo motor. If the shaft is on the right angle, the motor shuts off.
If the circuit finds that the angle is inaccurate, it retains the motor on till the angle is corrected. A traditional servo is used to regulate an angular movement as much as 180 levels. servos are incapable of turning additional as a consequence of a mechanical cease constructed on the primary output gear.
The management wire is used to speak the angle. The angle is decided by the length of a pulse that’s utilized to the management wire. That is known as pulse-coded modulation. The servo expects to see a pulse each 20 milliseconds. The size of the heart beat will decide how far the motor turns.
For instance, a 1.5-millisecond pulse might flip the motor to a 90-degree place (typically known as the impartial place).
If the heart beat is shorter than 1.5 milliseconds, the motor would flip much less.
If the heart beat is longer than 1.5 milliseconds, the shaft would flip nearer to 180 levels as proven above.
Servo motor arm is related to a metallic or wood piece in order that the servo arm acts as a leg to kick the ball.
Arduino UNO Board
Arduino is an open-source electronics prototyping platform based mostly on versatile, easy-to-use {hardware} and software program. It’s supposed for artists, designers, hobbyists and anybody all in favour of creating interactive objects or environments.
Arduino UNO is a board based mostly on the ATmega328 microcontroller. It consists of 14 digital enter/output pins, six analogue inputs, a USB connection for programming the on-board microcontroller, an influence jack, an in-circuit serial programming (ICSP) header and a reset button.
The board is operated with a 16MHz crystal oscillator and accommodates the whole lot wanted to assist the microcontroller.
It is vitally straightforward to make use of because the consumer merely wants to attach it to a pc with a USB cable, or energy it with an AC-to-DC adapter or battery, to get it began. The microcontroller on the board is programmed utilizing Arduino programming language and Arduino growth setting.
Pins 8 and 9 of BOARD1 are related to pins Tx and Rx of the Bluetooth module, respectively. Pin 10 is related to the PULSE pin of the servo motor to regulate the angle of motion. Pins 2 via 7 of BOARD1 are output pins which might be related to IC1 for controlling the motors.
Pins 2, 3 and 4 of BOARD1 are related to IN3, EN2 and IN4 of IC1 to regulate motor M1, and pins 5, 6 and seven are related to IN1, EN1 and IN2 of IC1 to regulate motor M2. EN1 and EN2 are used to regulate the speeds of the motors.
The app sends the sensed knowledge from an accelerometer of the cellphone to the robotic through Bluetooth. Knowledge transmitted by the cellphone is obtained by the Bluetooth module on the robotic. The obtained knowledge is fed to pin 8 of BOARD1. The microcontroller on BOARD1 processes the obtained knowledge and drives the motors accordingly.
The robotic additionally sends again the standing. Within the app, you’ll be able to see a label named ‘Robot’s standing’ beneath which you’ll see the path during which the robotic is shifting and likewise the kick standing.
Arduino Code for Soccer Robotic
The code for the soccer robotic is written in Arduino programming language. The Arduino UNO is programmed utilizing Arduino IDE software program.
Atmega328 on Arduino UNO comes with a boot loader that lets you add new code to it with out the usage of an exterior {hardware} programmer. It communicates utilizing the STK500 protocol.
You too can bypass the boot loader and program the microcontroller via the ICSP header, however utilizing boot loader programming is fast and straightforward.
Choose the proper board from the ‘Tools→Board’ menu in Arduino IDE and burn this system (sketch) via a regular USB port within the laptop.
Change the kick and preliminary place (in levels) of the soccer robotic’s leg within the supply program equivalent to your mechanical association of the leg within the robotic as proven beneath:
Int kick = 50
Int impartial = 170
The process for putting in the Android app on the cellphone is as follows:
- Obtain the app SoccerRobot.apk and replica it to your Android smartphone or pill.
- Run the file and it’ll ask you ‘complete action using,’ click on on ‘package installer’ after which click on ‘install.’
Please notice that it’s a must to additionally change the baud charge of the Bluetooth module on the robotic to 57600 utilizing the AT command if it isn’t set like that already.
Obtain Supply Code: click on right here
PCB Design
A single-side PCB for the soccer robotic and its element structure is proven beneath. Assemble the circuit on the advisable PCB to save lots of time and minimise meeting errors. Use IC base for motor driver IC1.
Obtain the PCB and Element Format PDFs:Â click on right here
Testing Robo Soccer Undertaking
Observe the steps beneath to get the robotic working for the primary time:
- Swap the ability provide to the robotic by connecting the batteries.
- Pair the Bluetooth module with an Android cellphone. Whereas pairing, it’ll ask you for the password; sort ‘1234’ which is the default password of Bluetooth module.
- Run the already put in app on the cellphone.
- Faucet ‘SELECT’ (guaranteeing Bluetooth is enabled), then select the Bluetooth module from the checklist of scanned gadgets and press ‘CONNECT.’ It is going to take 5-10 seconds to attach. After connecting, it’ll notify you that Bluetooth is related. Now it’s time to play soccer via your cellphone.
- You may management the robotic by rotating the cellphone; ‘Forward,’ ‘Backward,’ ‘Left,’ ‘Right’ and ‘Stop.’
- Kick the ball by shaking the cellphone.
To check the circuit for correct functioning, confirm the proper 5V provide for the circuit at TP1 with respect to TP0. Additionally, examine the 9V provide for the motors at TP2. Transmitted knowledge by Bluetooth may be noticed at TP3. The controlling pulses for the servo motor may be seen at TP4.
This text is part of the Prime 15+ Microcontroller Tasks. If you wish to examine extra initiatives based mostly on microcontrollers, can undergo this text.
The article was first revealed in January 2015 and up to date not too long ago in 2024.