Arduino 4in1 Robot Projects
Introduction: Arduino 4in1 Robot Projects
Hello friend!
In this tutorial, I'm going to show you how to make arduino 4in1 robot that you can easily build at home. First line follow robot, Second obstacle avoiding, Third the line follow robot with obstacle avoiding, and fourth the object follows robot. Visit my website for more tutorials.
Step 1: ​Component Requirement:
1. Arduino Uno is the brain of the robot.
2. Motor driver l298n for controlling the motor.
3. 2 sets of IR sensors for line tracking and object follow.
4. Ultrasonic sensor (hc-sr04) with mount for detecting an object.
5. Servo motor.
6. 2 sets of Bo motors with the wheel.
7. Caster wheel.
8. 949
Jumper wire.
now, we have all the components
Step 2: Let's Build the Circuit:
First, Take a chassis 13 x 16 size and then stick Bo-motors on the bottom of chassis with the help of double tap after that stick a caster wheel too. With this robot easily move and rotate.
For command the robot we need an arduino Uno and then we need a motor controller l298n and stick both on the chassis . you can also control motor with l293d IC.
Now connect the motor to the motor driver. Motor 1 is connected to the out 1 and 2. Motor 2 is connected to the out 3 and 4.
Connect the motor driver to the Arduino Uno.
First, EnableA pin is Connected to the Arduino pin 11.
IN1 pin is Connected to Arduino pin 13.
IN2 pin is Connected to Arduino pin 12.
IN3 pin is Connected to Arduino pin 7.
IN4 pin is Connected to Arduino pin 6.
EnableB is Connected to Arduino pin 5.
EnableA and EnableB is use for controlling speed of the motor.
Next, take a wheel and attach it to the Bo motor.
Step 3:
Next, take an IR sensor and stick it on the front of the chassis after that stick a breadboard too for power connection.
Connect the Arduino 5v pin to the breadboard positive side and gnd pin to the breadboard negative side.
Now, connect the IR sensors to the Arduino Uno.
Connect right IR sensor Out pin to Arduino pin 4.
Connect the Vcc pin to the 5v.
Connect the GND pin to the GND.
Connect left IR sensor Out pin to Arduino pin 3.
Connect the Vcc pin to the 5v.
connect the GND pin to the GND.
Next, connect a dc jack with the switch to the motor driver for powering.
Positive terminal is connected to the motor driver input pin and Negative terminal is connected to the Motor Driver GND pin and also connect Arduino GND pin to the Motor Driver GND pin for a logic connection after that take servo motor and stick it on the chassis.
Connect servo motor signal pin to Arduino pin 2, Vcc pin to 5v, and gnd pin to gnd.
Next, Take an ultrasonic sensor and attach it to the mount with the help of a screw after that Attach an ultrasonic sensor on the top of the servo motor and secure it with a screw. It will help us to rotate the sensor and get the left and right distances. If you want to Know how ultrasonic sensor works?
To connect the ultrasonic sensor with Arduino.
Connect VCC pin to Arduino 5v pin.
Trig pin is Connected to Arduino A5 pin.
Echo pin is Connected to Arduino A4 pin.
Gnd pin is Connected to Arduino gnd pin.
Step 4:
Now stick a supporter on the mount with help of a double-tap and then take an IR sensor and stick it on the supporters. With this IR sensor robot can detect the object and follow it.
for the connection of IR sensor,
Left IR sensor signal pin is connected to Arduino pin A0.
Right IR sensor signal pin is connected to Arduino pin A1.
Connect VCC pin to 5v. Connect gnd pin to gnd.
Now, take a 7.4-volt lion battery and stick it on the bottom of the chassis. Don't use a 9v volt battery for powering the motor driver. Connect the battery to the dc jack.
Now, the circuit is completed.
Step 5: Coding:
connect the USB from computer to the Arduino for program it.
Upload the line follower code after that remove the USB and connect a 9v battery to the Arduino dc jack.
*** IMPORTANT***
Now, we have to calibrate the IR sensor for that rotate its potentiometer until it detected a black and white surface. 230