Robot That Can Avoid Obstacles and Follow Color
26 Aralık 2019

The project includes the design of a color and distance sensitive 2-wheeled robot that can complete its task autonomously.
Arduino Mega 2560 R3 Development Board was used as the processor in the project. This card is the decision-making mechanism of the system circuit. This card is vital in making decisions and taking action with the help of data read from sensors.
The main aims of the project are:
To complete the task using their own decision-making mechanisms.
Healthy (consistent) reading of data from environmental elements such as sensors.
Making and implementing the right decisions by processing the obtained data.
The robot basically maintains its movement using data obtained from the Ultrasonic Distance Sensor and Color Sensor.
This data is used as follows:
According to the data received from the Ultrasonic Distance Sensor:
The Ultrasonic Distance Sensor inside the robot detects objects and obstacles in front of the robot. If there is no obstacle on the robot's route, it continues on its way. Since it constantly updates its measurements, it completes object or obstacle detection in a short time. This feature of the robot was used to enable it to exit a predetermined maze.
Basically the algorithm is as follows:
The robot begins its journey and repeats the distance measurements. If it comes within 12cm of an obstacle, it stops and sends appropriate signals to the processor, activating the Servo Motor to which the Ultrasonic Distance Sensor is connected. The Servo Motor first rotates 90 degrees to the left and records the Ultrasonic Distance Sensor measurement. Then the Servo Motor rotates 180 degrees to the right and the Ultrasonic Distance Sensor records its measurement. Thus, two pieces of data that can be compared are obtained. The direction in which the distance is recorded as longer is selected and the motors operate through the appropriate signals sent to the processor and the robot continues its movement in the selected direction. These processes continue sequentially until the robot exits the maze.
According to the data received from Color Sensor:
The Color Sensor inside the robot detects the colored plates and their colors on the ground along the robot's route. If there is no predefined color on the robot's route, it continues on its way according to the data it receives from the Ultrasonic Distance Sensor. Since it constantly updates its measurements, it completes color detection in a short time. This feature of the robot was used to enable it to exit a predetermined maze.
Basically the algorithm is as follows:
- If the color of the detected palette is "blue", the "turn right" command is activated. By sending appropriate signals between the processor and the modular, the wheels move in the "right" direction.
- If the color of the detected palette is "green", the "turn left" command is activated. By sending appropriate signals between the processor and the modular, the wheels move in the "left" direction.
- If the color of the detected palette is "red", the "stop" command is activated. The wheels are stopped by sending appropriate signals between the processor and the modular.
All the commands above are displayed on the LCD screen on the robot.
All parts included in the robot are as follows:
Arduino Mega 2560 R3 Development Board
HC-SR04 Ultrasonic Distance Sensor
TCS34725 RGB Color Sensor
L298 DC and Stepper Motor Driver Module
2x16 LCD Screen
1.5V x 4 Batteries
Passive Elements
