0% found this document useful (0 votes)
74 views

Arduino Obstacle Avoiding Robot With L293D

This document describes how to build an obstacle avoiding robot using an Arduino, L293D motor driver, ultrasonic sensor, and DC motors. It provides step-by-step instructions for assembling the robot chassis, connecting the electrical components, and programming the Arduino code to make the robot avoid obstacles.

Uploaded by

Mou Ha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Arduino Obstacle Avoiding Robot With L293D

This document describes how to build an obstacle avoiding robot using an Arduino, L293D motor driver, ultrasonic sensor, and DC motors. It provides step-by-step instructions for assembling the robot chassis, connecting the electrical components, and programming the Arduino code to make the robot avoid obstacles.

Uploaded by

Mou Ha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

technology workshop craft home food play outside costumes

Arduino - Obstacle Avoiding Robot (with L293D)


by MertArduino on November 5, 2016

Table of Contents

Arduino - Obstacle Avoiding Robot (with L293D) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Arduino - Obstacle Avoiding Robot (with L293D) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Hardware Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3: Create a chassis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 4: Create Power Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 5: All VCC and GND connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 6: DC Motor Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Step 7: Digital Input Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Step 8: HC-SR04 Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Step 9: Finally; battery, wheels and sensor mounting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Step 10: Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Step 11: If I was helpful . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

http://www.instructables.com/id/Arduino-Obstacle-Avoiding-Robot-with-L293D/
Author:MertArduino Arduino Projects
I've just started a youtube channel, hoping to help people, share some of my knowledge and learn myself. My next Youtube (and Instructables) tutorials will
deal with different methods of controlling electronics (Smartphone-Bluetooth control, remote control and much more) and specifically robots. There will also
be videos about home automation (controlling every day appliances with your smartphone or computer using arduino). so make sure you are a subscriber so
you won't miss them, and I will see you next time. Bye ! Please Subscribe for more and Support

Intro: Arduino - Obstacle Avoiding Robot (with L293D)


This instructable is the written version of my "Arduino - Obstacle Avoiding Robot (with L293D)" YouTube video that I've uploaded recently. I strongly recommend you to
check it out.

My YouTube Channel

Step 1: Tutorial
In this video is explained step by step.

Dual H-Bridge Motor Driver for DC or Steppers - 600mA - L293D

This is a very useful chip. It can actually control one motor independently. We will use in its entirety the chip in this tutorial. Pins on the right hand side of the chip are for
controlling a one motor. Pins on the left hand side of the chip are for controlling second motor.

You can run four solenoids, two DC motors or one bi-polar or uni-polar stepper with up to 600mA per channel using the L293D.

http://www.instructables.com/id/Arduino-Obstacle-Avoiding-Robot-with-L293D/
Step 2: Hardware Required
Arduino Uno R3
Dual H-Bridge L293D Motor Driver
HC-SR04 Ultrasonic Module Distance Sensor
Bracket / Holder for HC-SR04
DC Motors and Wheels
Bovine Wheel
Plate or Chassis
Jumper or Wires
Batteries and Battery Holdes
Glue Gun or Cable Ties
Breadboard

Step 3: Create a chassis


In this step; We are doing chassis installation.

You can use any plate for the chassis. But do not use a metal!

1. Let's first mount the wheels.


2. Then let's mount the battery holder.
3. Finally mount Arduino and breadbord.

http://www.instructables.com/id/Arduino-Obstacle-Avoiding-Robot-with-L293D/
Step 4: Create Power Distribution
I am using a breadboard for distribution to VCC and GND. For to be adjacent to the motor driver.

Step 5: All VCC and GND connections


All VCC-GND connect with wires to the L293D motor drive and the batteries.

Each chip contains two full H-bridges (four half H-bridges). That means you can drive four solenoids, two DC motors bi-directionally, or one stepper motor. Just make
sure they're good for under 600 mA since that's the limit of this chip.

Normally we can connect both of these to the Arduino 5V pin. We used a powerful motor, or a higher voltage motor. So we provided the motor with a separate power
supply using pin 8 connected to the positive power supply and the ground of the second power supply is connected to the ground of the Arduino.

http://www.instructables.com/id/Arduino-Obstacle-Avoiding-Robot-with-L293D/
http://www.instructables.com/id/Arduino-Obstacle-Avoiding-Robot-with-L293D/
Step 6: DC Motor Connections
You can run four solenoids, two DC motors or one bi-polar or uni-polar stepper with up to 600mA per channel using the L293D.

You can use OUT1 and OUT2 for the left motor.
OUT4 and OUT3 can use for the right motor

http://www.instructables.com/id/Arduino-Obstacle-Avoiding-Robot-with-L293D/
Step 7: Digital Input Connections
The L293D has two +V pins (8 and 16). The pin '+Vmotor (8) provides the power for the motors, and +V (16) for the chip's logic.

Digital 2 to OUT1

Digital 3 to OUT2

Digital 4 to OUT4

Digital 5 to OUT3

http://www.instructables.com/id/Arduino-Obstacle-Avoiding-Robot-with-L293D/
Step 8: HC-SR04 Connections
Sensor VCC to Breadboard VCC

Sensor GND to Breadboard GND

Sensor Trig to Arduino Digital12

Sensor Echo to Arduino Digital11

Step 9: Finally; battery, wheels and sensor mounting


We're making the final touches ...

Then connect the robot to the computer for programming.

http://www.instructables.com/id/Arduino-Obstacle-Avoiding-Robot-with-L293D/
Step 10: Code
Download code (via Google Drive)

https://drive.google.com/drive/folders/0B8SAF49tU-Qod1duNVQzNEdFMDA
<p>const int trig = 12;<br>const int echo = 11;
const int leftForward = 2;
const int leftBackward = 3;
const int rightForward = 4;
const int rightBackward = 5;</p><p>int duration = 0;
int distance = 0;</p><p>void setup()
{
pinMode(trig , OUTPUT);
pinMode(echo , INPUT);
pinMode(leftForward , OUTPUT);
pinMode(leftBackward , OUTPUT);
pinMode(rightForward , OUTPUT);
pinMode(rightBackward , OUTPUT);

Serial.begin(9600);</p><p>}</p><p>void loop()
{
digitalWrite(trig , HIGH);
delayMicroseconds(1000);
digitalWrite(trig , LOW);</p><p> duration = pulseIn(echo , HIGH);
distance = (duration/2) / 28.5 ;
Serial.println(distance);
</p><p> if ( distance < 20 )
{
digitalWrite(leftForward , LOW);
digitalWrite(leftBackward , HIGH);
digitalWrite(rightForward , HIGH);
digitalWrite(rightBackward , LOW);
delay(100);
}
else
{
digitalWrite(leftForward , HIGH);
digitalWrite(leftBackward , LOW);
digitalWrite(rightForward , HIGH);
digitalWrite(rightBackward , LOW);
}

}</p>

http://www.instructables.com/id/Arduino-Obstacle-Avoiding-Robot-with-L293D/
Step 11: If I was helpful
First of all, I would like to thank you for reading this guide ! I hope it helps you.

If you want to support me, you can subscribe my channel and watch my videos.

Visit My YouTube Channel

Related Instructables

How to Make an
Obstacle Obstacle How to Build Obstacle ARDUINO UNO : Obstacle
Avoiding Robot Avoiding Robot Obstacle Avoiding Robot the obstacle Avoiding Robot
Using Arduino Avoiding Robot using ultrasonic avoiding robot with arduino by
by SKYuvraj For Beginners with evive with L298N Dual
by kravi3
Karthik_Innovator With Arduino (Arduino H-Bridge Motor
Tutorial by powered Controller and
matthewh8 embedded ultrasonic
platform) by sensor by
evivetoolkit mohamed hedi
kasraoui

Advertisements

Comments

http://www.instructables.com/id/Arduino-Obstacle-Avoiding-Robot-with-L293D/

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy