Arduino Sumo Robot

71,852

38

35

Introduction: Arduino Sumo Robot

About: Software Engineer

Before we start ..

What is the sumo robot?

It is a self-controlled robots with specific dimensions and features, it is also designed in a Hostile shapes which qualify it to participate in the contests and competitions with other robots.

The name “sumo” came from an old Japanese sport, which is two opponents fighting in a ring, each of them trying to push the other opponent out of it, And this is what should robots also do in the sumo robotics competitions, where two robots placed in the ring and each other trying to push out its opponent.

The idea:

Build a robot with a certain specifications and commensurate with the laws of that competition (Sumo), this robot must be in exact dimensions to fight and survive to not be cross out of ring any way.

So let’s have a look to The Sumo robot competition laws:

I will explain some important roles you should consider while building your own SUMO it also might help you Imagine and innovation your own Idea without going in deep details.

1. Dimensions: Max Width 20 cm, Max Length 20 cm, Height not specified.

2. Shape: the robot shape can be changeable after starting the race, but without the inseparable parts to maintain being one central Object.

3. Weight: does not exceed 3 kg.

4. Robot must be self-controlling.

Step 1: Components

1 Arduino Ano3

2 DC Motor

1 L298N Dual H Bridge for Arduino

1 Ultrasonic sensor

2 IR TCRT5000

1 Battery 9v

AA battery 4 * 1.5 v pieces + Battery house

4 Robot Wheels

jumper wires

Step 2: Uses for Each Component

Now we have the required components, so let’s go in details to know what is used for ..

1- Arduino Ano3

It is a main board that control all the parts and link it together

2- DC Motor

Which help robot to maneuver and move within the ring of COMPETING

4- L298N Dual H Bridge for Arduino

It is a small panel that provides constant voltage to the motors, as well as the support of the Arduino plate with good control of movement and voltage.

5- Ultrasonic sensor

The ultrasonic sensor is used to locate the opponent's robot and is usually placed at the top of the robot.

6- IR TCRT5000

As we have already mentioned, the contest ring designed in a certain size and it have two colors, filling is black and frame is white. The contestant should not go out. Therefore, we use the IR sensor to make sure that the robot will not be out of the ring. This sensor has the ability to distinguish between the colors of the ring).

7- Battery 9v

It support the main board (Arduino) with the important voltage.

8- AA battery 4 * 1.5 v pieces + Battery house

It support the two motors (DC Motor) with the important voltage and it must be separated to give the full force for the wheels.

9- Jumper wires

Step 3: Design

I’ve made two sumo robot designs using Google 3D sketch-up because I like to create paper models of my robots before I cut parts out of acrylic on the laser cutter. To verify that all the parts will fit together properly, it’s important that the paper models are printed at the exact size of drawings.

And I take into consideration to be in specific measuring with competition laws, so try to think in a more creative designs and do your own model.

In order to be more sensitive to the robot weight in submitted or then put the batteries in the front of the robot with the front shield at a 45 degree angle to the form of the robot.

Download the design 1 from here

Download the design 2 from here

You may also Download Paper model template

Open the PDF file with Adobe Acrobat Reader (recommended software)

Step 4: ​Play Strategy

As we mentioned before that the robot must have its own ability to control it self, so it gives us the ability to programmed it in more than one way, it depending on how you want the robot to play on the ring just as any opponent in real want to win the game.

Play strategy (1):

· We will make the robot around itself continuously.

· The robot is always measuring the distance continuously during the rotation.

· If the opponent distance measured is lower than (10cm for example), that means the opponent is in front of robot us directly.

· The robot must stop rotating and then starts the attack (move forward with full force quickly).

· The robot must take the readings from the IR sensors always to be sure that we didn’t cross the ring border.

· If Read of IR presence of white color, it must move the robot directly in the opposite direction of the sensor (for example: If the front sensor, which gave an indication of the white color of the robot moves backward)!

Play strategy (2):

· At the start robot measure the distance in front.

· Robot move back the same measured distance.

· Robot stop rotating and then starts attack suddenly (move forward with full force).

· In case of opponent attach robot must rotate 45 degrees while to survive itself if falling out of the ring.

· The robot must take the readings from the IR sensors always to be sure that we didn’t cross the ring border.

· If Read of IR presence of white color, it must move the robot directly in the opposite direction of the sensor (for example: If the front sensor, which gave an indication of the white color of the robot moves backward)!

Step 5: Programming

please check the circuit and code

* Update 26/03/2019

Download the Ultrasonic library from here first and install it:

https://github.com/ErickSimoes/Ultrasonic/blob/mas...

/*

by ahmed Azouz https://www.instructables.com/id/How-to-Make-Ardu...

Download the lib from here first https://github.com/ErickSimoes/Ultrasonic/blob/ma...

*/ #include Ultrasonic.h

Ultrasonic ultrasonic(4,3);

const int IN1=5; const int IN2=6; const int IN3=9; const int IN4=10; #define IR_sensor_front A0 // front sensor #define IR_sensor_back A1 // rear senson int distance ;

void setup() { Serial.begin(9600); delay (5000); // as per sumo compat roles } void loop() { int IR_front = analogRead(IR_sensor_front); int IR_back = analogRead(IR_sensor_back); distance = ultrasonic.read(); ROTATE(200); // start rotete if (distance < 20){ Stop(); while (distance < 20 ) { FORWARD(255); distance = ultrasonic.read(); IR_front = analogRead(IR_sensor_front); IR_back = analogRead(IR_sensor_back); if ( IR_front > 650 || IR_back > 650 ) { break;} delay(10); } if (IR_front < 650 ) // < 650 means white line { Stop(); delay (50); BACKWARD(255); delay (500); } if (IR_back < 650 ) // { Stop(); delay (50); FORWARD(255); delay (500); } /* ----------- debugging ---------------- Serial.print(ultrasonic.Ranging(CM)); Serial.println("cm"); Serial.println("IR front :"); Serial.println(IR_front); Serial.println("IR back :"); Serial.println(IR_back); */

} //-------------------------------------------- void FORWARD (int Speed){ //When we want to let Motor To move forward, // just void this part on the loop section . analogWrite(IN1,Speed); analogWrite(IN2,0); analogWrite(IN3,0); analogWrite(IN4,Speed); }//-------------------------------------------- void BACKWARD (int Speed){ //When we want to let Motor To move forward, // just void this part on the loop section . analogWrite(IN1,0); analogWrite(IN2,Speed); analogWrite(IN3,Speed); analogWrite(IN4,0); }//-------------------------------------------- void ROTATE (int Speed) { //When we want to let Motor To Rotate , // just void this part on the loop section . analogWrite(IN1,Speed); analogWrite(IN2,0); analogWrite(IN3,Speed); analogWrite(IN4,0); }//-------------------------------------------- void Stop(){ //When we want to Motor To stop , // just void this part on the loop section . analogWrite(IN1,0); analogWrite(IN2,0); analogWrite(IN3,0); analogWrite(IN4,0); }

Epilog Challenge 9

Participated in the
Epilog Challenge 9

Be the First to Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Automation Contest

      Automation Contest
    • Make it Glow Contest

      Make it Glow Contest

    35 Comments

    0
    ShafiqS18
    ShafiqS18

    1 year ago

    sir why i want to verify this coding it tell error compiling

    0
    AppC
    AppC

    1 year ago

    Thanks for your job. Please, could you reupload again the designs 1 and 2?

    0
    roselyndosicat
    roselyndosicat

    Question 1 year ago

    would it be possible to have a step by step on loading the code to arduino uno , I'm getting error message when i try to do it even w/ the updated ultrasonic file, I dont know if im doing it wrong i'm new, this is my 1st arduino project this is the error message i get




    Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"
    arduino_code:14:10: error: #include expects "FILENAME" or <FILENAME>
    #include Ultrasonic
    ^~~~~~~~~~
    Multiple libraries were found for "Ultrasonic.h"
    Used: C:\Users\RSi7\Documents\Arduino\libraries\Ultrasonic
    Not used: C:\Users\RSi7\Documents\Arduino\libraries\Ultrasonic_hc_sr04
    Not used: C:\Program
    exit status 1
    #include expects "FILENAME" or <FILENAME>
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    0
    emilianocollazo02
    emilianocollazo02

    1 year ago

    Que tipo de acrílico es? O no hay agua tipo en específico?

    0
    faizfitri545
    faizfitri545

    1 year ago

    hi, i want to ask about the 3d car template. i have a bit problem in designing the 3d car. can you help me?

    0
    ahmedazouz
    ahmedazouz

    Reply 1 year ago

    of course, you can send me an Inbox
    sorry for late reply

    0
    LimuelD1
    LimuelD1

    1 year ago

    How to adjust ultrasonic sensor

    0
    ahmedazouz
    ahmedazouz

    Reply 1 year ago

    I didn't get your question, would you explain it ?

    0
    arkandz
    arkandz

    Question 1 year ago on Step 2

    Hi, the competition I’m about to participate allows only 12.6V max battery voltage for the robot. What should I do?

    0
    ALRESIME
    ALRESIME

    1 year ago

    Thank you

    0
    mehdjoub
    mehdjoub

    1 year ago

    amazing job! i want to design the robot for four wheels in other designing software (Creo 4.0), how you can help me to have the measures and dimensions for the parts and wheels. thank you !

    0
    junnaramadeth
    junnaramadeth

    1 year ago

    Do you have pdf design of the robot with 2 wheels?

    0
    ahmedazouz
    ahmedazouz

    Reply 1 year ago

    It's now avaiable

    0
    ahmedazouz
    ahmedazouz

    Reply 1 year ago

    Sure, the design will be available very soon

    1
    Lê1998
    Lê1998

    Question 2 years ago

    First I thank you for your contribution, but I have questions about the first line #include "Ultrasonic.h"
    Ultrasonic ultrasonic (4,3); When I load the program always error this line. thank you very much!

    1
    Lê1998
    Lê1998

    Reply 2 years ago

    I'm sorry ! But the Ultrasonic-HC-SR04 library does not work for the arduino Uno, how do I fix it?

    0
    ahmedazouz
    ahmedazouz

    Reply 1 year ago

    check out the updated code

    0
    Anfernee1
    Anfernee1

    2 years ago on Step 5

    Sir do you have a schematic diagram?