Obstacle Avoiding Robot Using Arduino and L293d
by My Tech Studio in Circuits > Arduino
1642 Views, 4 Favorites, 0 Comments
Obstacle Avoiding Robot Using Arduino and L293d
Hello Everyone! Welcome back to another exciting project from My Tech Studio. Today's topic is Obstacle avoiding robot, which is the another example of arduino project. Basically an Obstacle avoiding robot consist of some set of sensors like ultrasonic sensor (distance measurement sensor), which measure the distance of an object from a particular distance and then it returns the distance as an input to the microcontroller arduino. Arduino will further process the input for executing some set of instruction. Before making the robot you have to know about some basic important things. Obstacle avoiding robot is a basic example of automation projects, where we are building a car by the help of arduino uno and ultrasonic sensor. Read More >>
Supplies
Components –
- Arduino Uno
- L293d Motor Driver
- Servo SG90
- Ultrasonic Sensor
- DC Geared Motor
- Wheels
- Jumper Wire
- Lipo Battery
Structure Designing
First of all take the DC geared motor and soldier the wires in the both terminals of the motor. Then the next thing is to build the chassis for holding the DC geared motors. For this purpose take a wooden board of suitable size. Then fix all the Dc geared motors at each corner of the wooden board. While fixing the dc motors you have to check the alignment of the motors. The alignment should be perfect for a better result. Otherwise your robot will face problem at performing time. Read More >>
Circuit Connection
Circuit connection is the most important thing in automation projects. Because a simple fault in circuit may cause a big error in the performance of the robot. So it is advised to keep focused while making the circuit. In the circuit we use the arduino uno as the main processing unit of the robot. To avoid the problems of wiring we use L293d motor driver shield. This shield is fully designed to put up on arduino uno. It has also some other benefits. It can run four dc motors at a time. So connect the dc motors with the motor driver one by one. If you see the motors are running in the opposite direction at the run time, then you should interchange the connection of the motors. Also it has an inbuilt servo pins for connecting the servo. As a result we don’t need any other circuit to connect our servo. Now the next thing is to connect the servo in the L293d motor driver shield. Read More >>
Arduino Coding
Now come to the coding part of the robot, which is the most important thing of any arduino project. You have to write the code according to your robot configuration. However we will provide a sample code for better understand. Now to do the coding, you have to visit the Arduino IDE software. Then you have to write down the code without any error. Then you have to compile the code to check, whether any error is present or not. But before compilation you have to save the code. Once the code is compiled, you have to open the tools section. There you have to select the board type which is Arduino uno. Also you have to choose the port from the tools section. Once you have done all this things, click on upload button to upload the code. The sample code for obstacle avoiding robot is given below –
//OBSTACLE AVOIDING CAR//
#include <AFMotor.h>
#include <NewPing.h>
#include <Servo.h>
#define TRIG_PIN A5
#define ECHO_PIN A4
#define MAX_DISTANCE 200
#define MAX_SPEED 150 // sets speed of DC motors
#define MAX_SPEED_OFFSET 20
NewPing sonar(TRIG_PIN, ECHO_PIN, MAX_DISTANCE);
AF_DCMotor motor1(1, MOTOR12_1KHZ);
AF_DCMotor motor2(2, MOTOR12_1KHZ);
AF_DCMotor motor3(3, MOTOR34_1KHZ);
AF_DCMotor motor4(4, MOTOR34_1KHZ);
Servo myservo; Read More >>
Testing of Obstacle Avoiding Robot
Now we come to the end of this project. The last and final thing that you have to do is battery connection. For this we used a 7.4 volt Lipo battery. But you can also use a 12 volt Lipo battery. It totally depends upon you and it does not affect the performance of the robot. After connecting the battery switch on the circuit. Now your robot might be start working. You can place your robot on a smooth surface and observe the performance of robot. You can put some additional obstacles to check the efficiency of the robot. However if it is not working properly, you should recheck your circuit and the code. This may solve your problems. And this is all about the obstacle avoiding robot. Read More >>