Ampere is a self-driving 10×10 cm robot designed for robot-sumo competitions, analogous to the sport of sumo.
The robot utilizies the following pieces of electronic hardware:
- Arduino Nano (1×): main control unit using an ATmega328 microcontroller
- HC-SR04 ultrasonic sensor (1×): utilized for detecting the opponent and initiating an attack
- QTR-1A reflectance sensor (2×): utilized for keeping the robot inside the field using the floor color
- L298N motor driver (1×): utilized for controlling the movement of the 6V DC motors
- JSumo 6V DC motor (2×): connect to the motor driver and handle mobility
- 9V battery (2×): provide power for the robot
The functionality of the robot is divided into 3 layers of abstraction (ordered from lowest to highest):
-
Libraries dealing with digital/analog input/output to the electronic hardware
- HC-SR04 ultrasonic sensor library; developed by gamegine
- QTR-1A reflectance sensor library; developed by me
- L298N motor driver library; developed by me
-
System classes providing a liaison between the microcontroller and hardware libraries through signals:
- Navigation system: utilizes the sensors to handle edge/opponent detection and produces boolean signals
- Motion control system: utilizes the motor driver to handle various movement types
-
Microcontroller Arduino file controlling the behaviour
Writing the entire program in the microcontroller.ino is also feasible. However, dividing the program into multiple abstraction layers allows for better readability and debugging.