About This Project

Learn how to create an Edge Detector/Obstacle Avoiding Robot.

Project Info

  • Programming Platform: Arduino IDE
  • Difficulty: Intermediate
  • Estimated Time: 2 Hrs
  • Category: Robotics
  • Tags: BO Motor, Ultrasonic Sensor, Arduino, Motor driver, 2 Wheel drive DIY KIT

Introduction

It is an autonomous robot that will be able to avoid every obstacle in its path. The purpose of the edge detector and obstacle avoiding robot is to move on a platform without falling at the edges.

Components Required

IMAGE COMPONENT QUANTITY

bo-motor

BO Motor

2

wheels

Wheels

2

Ultrasonic-Sensor

Ultrasonic Sensor

1

l293d-motor-driver

Motor Driver (L293D)

1

jumper-wire

Jumper Wires

As Per Requirement

3-wheel-drive

2 Wheel Drive

1

battery

Battery

4

arduino

Arduino

1

Building Guide

Step 1: Assembly

  • For assembling the 2 Wheel drive bot start by unwrapping the package.

line-follower-robot
aurdino

  • Here, you will find 2 wheels, 2 BO motors, 1 chassis, Battery Box, connectors, Caster wheel, and nut & bolts.
  • Capitalise BO and put comma after now. Remove connecting before wire.

arduino-motor-connection
replace-aurdino-with-motor

  • Repeat the same process for the rest of the motors.

connect-two-motor-with-each-other

  • Now connect the BO motor to the base plate or the chassis with the help of connectors and tighten them using the screw and bolts.

bo-motor
connect-bo-motor-with-plate

  • Now repeat the same steps for the other BO motors.

connect-castor-wheel

  • Now connect the castor wheel.

connect-battery-box-to-the-chassis

  • Connect the battery box to the chassis.

connect-switch

  • Connect the switch to turn on and off the bot.

connect-switch-to-turn-of-bot

  • Make the connection of the switch by using the red wire.

red-wire

  • Connect the motor driver L293D with the motor wires.

dc-jack-arduino

  • Use the DC jack to power the Arduino and connect it with the battery pins

dc-jack

  • Now assemble the wheels.

now-assemble-the-wheels

  • interface Arduino with Ultrasonic sensor.

Step 2: Logic and Flowchart

  • First, we will check if there is an object in the close vicinity in the front of the robot. If that is the case, then we will move 1 step back and take a left turn.

Step 3: Circuitry of the Robot

  • Powering the components
  • Powering the ultrasonic sensors
  • VCC to 5V
  • GND / to GND
  • Trigger to 8
  • Echo to 9
  • Powering the motor driver
  • 12V to Vin pin
  • GND to GND
  • Left Motor to 3,4
  • Right Motor to 5,6

Step 4: Code

  • Setting the pins.

obstacle-detector-setup

  • Detecting the distance from the ultrasonic sensor

  • Applying the logic when the distance is less than 10cm then the bot should move a step back and make a left turn.

distance

  • If the distance is greater than 10cm then move forward.

obstacle-moving-distance

The following code will help you to make the Edge Detector/Obstacle Avoiding Robot:

Code

DESCRIPTION

DOWNLOAD CODE

Edge Detector/Obstacle Avoiding Robot Code 


Download Code

With this, we have come to the end of the project. We have learned about Obstacle Avoiding Robot and it’s working. Hope you enjoyed reading it!