Home » Arduino » ANTBOT

Login with your Social Account


This robot is a curious explorer, which can maneuver on plane surfaces without falling down edges. Furthermore, it senses obstacles in its way and avoids them. These features and the design with the two arms naming the robot only to start with, there are a lot more this electric ant is capable of; 3 IR-Sensors allow a robust line tracking at higher speeds while the kick mechanism enables you to play football with it in the manual control mode!

YouTube Preview Image

The construction is quite straight forward as well as the Arduino programming, only the construction of the kick mechanism might be a bit challenging. Nonetheless this project is recommendable for beginners. So here is a brief overview.

Electronic Hardware:

  • 1 Arduino Nano v3
  • 1 Arduino Nano I/O Shield
  • 3 IR Sensor TCRT5000
  • 1 Ultrasound Sensor HC-SR04
  • 1 Buzzer
  • 1 Bluetooth Module HC-05
  • 2 Continuous Rotation Servos FS90R
  • 1 Servo Motor SG90
  • 1 Pack of 20 Female-to-Female Jumper Wires
  • 1 Power Bank

Other Materials

  • Laser Cut (see below)
  • 2 FS90R Wheels
  • 1 Castor Wheel
  • Metal Wire
  • Strong Glue
  • Miscellaneous parts for the kick mechanism

Scheme of the Laser Cut Design

Fritzing Scheme


Since we used an Arduino Nano and realized rather simple robotic tasks we used the Arduino Software to write and debug the code. In order to keep the code clean and adaptable we previously discussed which functions are necessary as well as how they should be implemented. Most tasks rely on simple sensor data analysis speaking of value thresholds for the states “detecting” and “not detecting”. To skip communication and starting troubles code snippets of previous tasks were very helpful as we all only had a little experience writing in C. After all we used simple drive commands and sensor reading functions to have a general basis for the three main tasks.

For the edge detection and obstacle avoidance we use threshold analysis for both outer IR sensors and the ultrasound sensor. To avoid getting stuck we use random turns and turning times when avoiding edges and obstacles.

The line following also works on a threshold analysis detecting the black line with a very high value. In this case we use the outer sensors to detect the robot leaving the line. As soon as we detect that we turn towards the line until the middle sensor detects it again. That way we avoid swiping heavily and still stay on the line accurately enough regarding the velocity.

The remote control is realized via a Bluetooth module that is paired with a mobile phone. Via simple state commands through the app we access a switch case loop in which different actions are run depending on the command. Furthermore we looped the function and implemented a stop button so that the user only needs to push a button once. Especially during the planning the group work was essential to combine all ideas into one code structure.

App Design for the Manual Control

Working as a Group

As we did the project for a university course we used digital tools to obtain an efficient work flow. Communicating via a messenger in a group of three was helpful to divide the currently faced work equally and to solve upcoming problems quickly. A shared folder allowed working on the same files. Therefore, only few meetings were held.

  • One to finalize the project proposal
  • One after the arrival of the parts
  • One to resolute constructing issues
  • One to connect and test the electronics
  • One to finalize and test the robot

Although everyone worked on every task during the project each person had a clear responsibility for a specific topic while getting the robot to work:

  • Assembly: Peter
  • AppInventor: Maurizio
  • Arduino Code: Fabian
%d bloggers like this: