Skip to content

The battleBot project contains the complete source code, documentation, and setup instructions for an ESP32-based multifunctional robot. Designed for students, hobbyists, and robotics enthusiasts, BattleBot demonstrates how to combine Wi-Fi networking, sensor fusion, and autonomous navigation within a single embedded platform.

Notifications You must be signed in to change notification settings

RuikeYuan/BattleBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 BattleBot

TODO:

./MEGABOT/MEGABOT.ino

  • ADD YOUR GAME FUNCTIONS IN THE APPROPRIATE EMPTY INITIALIZED FUNCTION

    • eg. add your maze function into the empty maze function in MEGABOT.ino

      //Line: 335
      void maze() {
      //ADD YOUR CODE HERE
      }

BattleBot is an autonomous and remotely controlled ESP32-based robot designed for competitive robotics tasks such as line tracking, maze solving, racing, and capture-the-flag (CTF) modes.
It integrates sensors, Wi-Fi networking, and OLED display feedback to execute intelligent navigation and combat behaviors.


🚀 Features

  • Wi-Fi Control & Communication

    • Operates as both a Wi-Fi Access Point and Station.
    • Receives control commands via HTTP GET requests.
    • Can scan nearby Wi-Fi networks for CTF gameplay logic.
  • Motion Control

    • Forward, Backward, Turn Left, Turn Right, Stop.
    • PWM motor control via ESP32 GPIO pins.
  • Line Tracking

    • Dual light sensors for detecting black/white surface contrast.
    • Adaptive calibration to determine optimal thresholds.
    • Smooth turning and speed control for stable tracking.
  • Maze Navigation

    • Uses VL53L0X (laser distance) and ultrasonic sensors.
    • Autonomous decision-making for left/right turns and wall following.
  • Race Mode

    • Dual ultrasonic sensors and front ToF sensor for high-speed obstacle avoidance.
  • Capture the Flag (CTF)

    • Wi-Fi signal strength (RSSI) scanning to “find” other bots.
    • Autonomous chase and escape strategies using signal proximity.
  • OLED Display Feedback

    • Displays live sensor readings and calibration values.

🧪 Operating Modes

🔵 Manual Mode

Control the robot using HTTP commands or a web-based control panel.


⚫ Line Tracking

Uses two line sensors to follow a black line on a white surface.
Displays calibration data on the OLED for sensor thresholds.


🟢 Maze Mode

Uses VL53L0X and ultrasonic sensors to autonomously navigate through a maze by detecting obstacles and choosing optimal paths.


🔴 Race Mode

Combines ultrasonic and ToF sensors for high-speed racing and collision avoidance.


🟡 Capture-the-Flag (CTF)

Uses Wi-Fi scanning (esp_wifi_scan_start) to locate other bots by SSID or RSSI signal strength.
The bot “chases” or “runs away” depending on signal proximity.


⚙️ Hardware Requirements

Component Description
ESP32 Dev Board Main microcontroller
Adafruit VL53L0X Time-of-Flight distance sensor
HC-SR04 Ultrasonic Sensors (x2) For distance sensing during races/mazes
L298N / Motor Driver Dual DC motor driver
DC Motors (x2) Left and right motor drive
Line Tracking Sensors (x3) For line-following mode
SSD1306 OLED Display 128x32 display for telemetry
Battery Pack (7.4V–12V) Power source

🧩 Software Setup

1. Dependencies

Install the following Arduino libraries:

  • WiFi.h (ESP32 core)
  • Adafruit_SSD1306
  • Adafruit_VL53L0X
  • analogWrite.h (for ESP32 PWM)
  • esp_wifi.h
  • Wire.h

You can install them via the Arduino IDE Library Manager or PlatformIO.

2. Wi-Fi Configuration

Default network settings:

const char* ssid     = "BattleBot";
const char* password = "43638253";
const char* ssidCTF  = "Robot_B";

About

The battleBot project contains the complete source code, documentation, and setup instructions for an ESP32-based multifunctional robot. Designed for students, hobbyists, and robotics enthusiasts, BattleBot demonstrates how to combine Wi-Fi networking, sensor fusion, and autonomous navigation within a single embedded platform.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages