Home » Blog » Obstacle Avoiding Robot Car

Obstacle Avoiding Robot Car

Introduction

For the project designed throughout the semester, I chose obstacle avoiding robot car with the ELEGOO UNO R3 board as a substitute for Arduino Uno. ELEGOO board is practically the same as Arduino therefore it can be programmed with Arduino IDE without any additional problems. The car uses a servo-mounted ultrasonic sensor to detect objects in front of and on either side of the car and an L293D DC motor driver shield to drive four geared motors, one on each wheel.

Design

The robot base was 3D printed and consists of 2 parts. I put the motors along with some wires in the space between both parts. The board with the controller was fixed directly to the base. Two 9V batteries were not enough to supply the motors so for the next project I will use LiPo batteries.

 

Electronic components

In the project the following electronic components were used:

  • ELEGOO UNO R3 Board
  • L293D Motor Driver Shield
  • SG90 Servo
  • Ultrasonic Sensor HC-SR04
  • Arduino Smart Car Wheels with Motors
  • Two 9V Batteries connected in parallel
  • Basic electronic components

Code

The robot uses the state machine to define current behaviour. It keeps scanning the distance in front of the robot, in case the distance is lower than the preset threshold robot stops and starts scanning the left and right sides of the environment. Regarding the sensor output, Robot chooses a particular direction and starts moving towards it.