Skip to content

A robot that competes in a sumo-style arena, trying to push the opponent out while staying within the ring. This involved designing a smart strategy, fast reactions, and strong control, showing teamwork, creativity, and analytical thinking.

Notifications You must be signed in to change notification settings

Ahmed-Maher77/Sumo-Robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

robot_sumo_flip

Sumo Robot Competition - 🥈 2nd Place

Autonomous sumo robot that detects opponents, attacks aggressively, and avoids the white edge of the dohyo using dual line sensors. Built with Arduino and the Adafruit Motor Shield, featuring a simple but effective search → acquire → attack strategy.

  • Tools: C++ (Arduino), Microcontroller (Arduino Uno), Robotics, sensor integration, mechanical design, 3D printing, control systems
  • Repo: https://github.com/Ahmed-Maher77/Sumo-Robot

Features

  • Edge protection: Dual analog reflectance sensors detect the white boundary and trigger evasive maneuvers.
  • Target acquisition: Ultrasonic sensor (HC-SR04) scans for opponents; charges when in range.
  • Search strategy: Spins to scan; switches to full-speed attack when target is detected.
  • Configurable: Thresholds and speeds are tunable in code.

Hardware

  • Microcontroller: Arduino Uno (or compatible)
  • Motor Driver: Adafruit Motor Shield V1 (AFMotor library)
  • Motors: 2 × DC gear motors with wheels
  • Sensors:
    • HC-SR04 ultrasonic distance sensor (front)
    • 2 × analog line/reflectance sensors (downward facing, near front left/right)
  • Power: 7.4–11.1V battery (LiPo recommended) for motors; 5V regulated for logic
  • Chassis: 3D-printed or aluminum plate with low center of gravity and front wedge

Wiring Overview

  • Motors
    • Left motor → Motor Shield M1
    • Right motor → Motor Shield M2
  • Ultrasonic (HC-SR04)
    • VCC → 5V, GND → GND
    • TRIG → D9
    • ECHO → D10
  • Line Sensors (analog reflectance)
    • Left sensor signal → A0
    • Right sensor signal → A1
    • VCC → 5V, GND → GND

Software

  • Arduino IDE 2.x (or 1.8.x)
  • Libraries:
    • AFMotor (Adafruit Motor Shield V1) — install via Library Manager

Firmware

The core logic lives in sumo.ino and implements:

  • Edge-first safety: if the white line is detected, immediately reverse and pivot away
  • Search mode: spin in place to scan for opponents
  • Attack mode: when an opponent is within the configured distance, drive forward at max power

Key pin assignments and tunables (see sumo.ino):

// Motors
AF_DCMotor leftMotor(1);
AF_DCMotor rightMotor(2);

// Ultrasonic
const int trigPin = 9;
const int echoPin = 10;

// Line sensors
const int leftLinePin = A0;
const int rightLinePin = A1;

// Thresholds / speeds
int edgeThreshold = 500;         // Adjust per your sensors & ring
const int kDetectDistanceCm = 55;

Build & Upload

  1. Connect the Arduino via USB.
  2. Open sumo.ino in Arduino IDE.
  3. Tools → Board: select Arduino Uno (or your board).
  4. Tools → Port: select the correct COM port.
  5. Sketch → Include Library → Manage Libraries… → Install AFMotor.
  6. Upload.

Calibration (Important)

Perform these quick steps on the real ring:

  1. Place the robot so both line sensors are fully on black. Read raw values using a simple analog print sketch or temporarily Serial.println(analogRead(A0));/A1 (ensure Serial.begin).
  2. Move to white edge and read again. Set edgeThreshold midway between black and white readings.
  3. If your sensors read inverted (white gives low), set lineIsWhiteHigh = false in sumo.ino.
  4. Test edge avoidance: roll toward the white; robot should reverse and pivot away instantly.

Strategy Notes

  • Start in the center pointing forward. The robot spins to scan if nothing is in range.
  • On detection within kDetectDistanceCm, it accelerates straight to push.
  • Edge events always override and force an evasive maneuver first.

Tuning Tips

  • Increase kAttackSpeed for stronger pushes; reduce if traction is lost.
  • Adjust kDetectDistanceCm for your arena size and sensor placement.
  • Balance the robot and add a front wedge to get under opponents.

Safety

  • Use a switch to power on/off safely.
  • Lift the robot when testing edge behavior to prevent accidental drops.
  • Never short LiPo batteries; use proper chargers.

Project Structure

E:\Sumo-Robot\
  README.md
  sumo.ino

Credits

  • Built by Ahmed Maher — achieved 🥈 2nd place in competition.
  • Uses Adafruit Motor Shield V1 (AFMotor).

License

This project is provided as-is for educational and competitive use. Consider adding a full license (e.g., MIT) if you plan to share or fork.

About

A robot that competes in a sumo-style arena, trying to push the opponent out while staying within the ring. This involved designing a smart strategy, fast reactions, and strong control, showing teamwork, creativity, and analytical thinking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages