EE331: Embedded Systems
Major: Electrical Engineering
Robotic Arm Rover
Authored by:
Mr. Kunal Marathe (2104214)
Mr. Sumit Vanani (2104238)
Mr. Om Panchal (2104223)
Course instructors:
Dr. Sunil Dutt - Assistance Professor
Mr. Parmeshwar - Technical Superintendent
Mr. Diptesh R Naik - Supervisor
Mr. Pratik G and Tanu Kumari - TA
Table of Contents:
1. Introduction - 3
2. Selection of components - 4
3. Block or circuit diagram - 5
4. Explanation of diagram - 5
5. Flow chart - 6
6. Programming - 7
7. Challenges faced - 11
8. Key learning outcomes - 12
9. Future Aspects - 12
10. References -12
1) Introduction:
KSO:
The KSO is the name of our Robotic Arm Rover. The KSO is the Abbreviation of our names -
Kunal, Sumit, Om. The Pick and Place robotic arm vehicle automates tasks in industries like
manufacturing and warehousing. It streamlines production, increases productivity, and reduces
workplace injuries by picking and placing objects accurately. Equipped with sensors and adaptable
programming, it handles various objects efficiently. This technology revolutionises industry tasks,
enhancing speed, accuracy, and worker safety, driving advancements in automation and efficiency.
2) Selection of components
List of components:
a. Arduino Uno
b. Robotic gripper
c. L298 Motor Driver
d. MG995 Servo motor x 6
e. 12v DC gear motor x 2
f. DC to DC buck converter
g. HC-05 Bluetooth module
h. Power on-off switch
i. ESP32-CAM, camera model
j. LiPo - 11.1V battery, 5200mAh
k. Wheels x 4
l. XT60 connector
The components chosen for this project have been carefully selected to prioritize functionality,
versatility, and reliability. The Arduino Uno serves as the central control unit, offering user-friendly
operation and extensive community support. The robotic gripper, powered by MG995 servo
motors, provides dexterity for object manipulation, while the L298 motor driver effectively controls
the DC gear motors for propulsion. The incorporation of six MG995 servos ensures precise
movement control, and the 12V DC gear motors offer robust propulsion. The addition of a DC-to-
DC buck converter optimizes power management, while the HC-05 Bluetooth module enables
wireless communication. A power on-off switch ensures convenient control, and the ESP32-CAM
camera model enhances the project's capabilities with vision-based functionality. The project is
powered by a LiPo 11.1V battery, and reliable XT60 connectors ensure a secure electrical
connection. This comprehensive selection of components lays a solid foundation for successfully
realizing the project's objectives.
➢ Distribution of work among group members
1) 3d modelling - Kunal, Sumit, Om
2) Arduino code and different component configuration - Om
3) Esp32cam interaction with rover - Sumit
4) App for controlling all components - Kunal.
Here most of the works are interrelated thus everyone had to contribute in part as per the
requirement and as we were completing each task at a time so everyone has worked on the topic, the
above distribution is given by taking in consideration which person idealogy was involved more in
it.
3) Block or circuit diagram
4) Explanation of hardware or circuit connections:
Power Supply:
1) The circuit gets its power from a 7.4v battery which connects to the “7.4v In”
terminal on the power module.
2) The power module provides 5v output to the Arduino board which connects to the “5v
In” terminal on the Arduino.
Arduino Nano:
1) The “GND” (Ground) pin on the Arduino connects to the ground on the power
module.
2) Two DC motors are connected to Motor Driver 1 (MD1) and Motor Driver 2 (MD2) on
the Arduino.
Wireless Module:
The ZYTD520 wireless module connects to the Arduino’s RX (receive) and TX (transmit) pins to
enable wireless communication.
Motor Driver:
The circuit uses an L298N motor driver module which is a type of integrated circuit that allows the
Arduino to control the direction and speed of the two DC motors.
5) Flowchart
Here's a breakdown of the flowchart:
Start: The process begins here.
Gather Components: This step involves collecting all the necessary parts to build the robotic arm
rover. These parts include:
Robotic Arm
Vehicle Base
Sensors and Motors
Assemble Vehicle Base: The collected parts are used to assemble the base of the rover.
Design and Print Arm: This step involves designing the robotic arm using a software program and
then 3D printing it.
Assemble Robotic Arm: The previously designed and printed robotic arm is assembled.
Sensors & Motors: Sensors and motors are prepared for installation.
Install Sensors & Motors: The prepared sensors and motors are installed on the rover.
Connect Wires: After installing the sensors and motors, their respective wires are connected.
Test Functionality: The functionality of the assembled rover is tested to ensure everything works
as intended.
Check Calibration: This step involves checking the calibration of the sensors and motors to ensure
accurate data and operation.
Finalize Assembly: The assembly process is complete once everything is tested and calibrated.
6) Explanation of programming aspects
#include <Servo.h>
Servo motor_1;
Servo motor_2;
Servo motor_3;
Servo motor_4;
Servo motor_5;
#define enA 5 //Enable1 L298 Pin enA #define in1 A3
//Motor1 L298 Pin in1 #define in2 A2 //Motor1 L298
Pin in1 #define in3 A1 //Motor2 L298 Pin in1 #define
in4 A0 //Motor2 L298 Pin in1 #define enB 5
//Enable2 L298 Pin enB
int servo1 = 90; int servo2 =
110; int servo3 = 40; int
servo4 = 50; int servo5 =
90;
int bt_data; int Speed =
130;
void setup(){
[Link](9600); // initialize serial communication at 9600 bits
per second:
motor_1.attach(8);
motor_2.attach(9);
motor_3.attach(10);
motor_4.attach(11);
motor_5.attach(12);
motor_1.write(servo1);
motor_2.write(servo2);
motor_3.write(servo3);
motor_4.write(servo4); motor_5.write(servo5);
pinMode(enA, OUTPUT); // declare as output for L298 Pin enA pinMode(in1,
OUTPUT); // declare as output for L298 Pin in1 pinMode(in2, OUTPUT); // declare as
output for L298 Pin in2 pinMode(in3, OUTPUT); // declare as output for L298 Pin in3
pinMode(in4, OUTPUT); // declare as output for L298 Pin in4 pinMode(enB,
OUTPUT); // declare as output for L298 Pin enB
delay(1000);
}
void loop(){
//if some date is sent, reads it and saves in state
if([Link]() > 0){ bt_data = [Link]();
[Link](bt_data); if(bt_data > 20){Speed =
bt_data;}
}
analogWrite(enA, Speed); // Write The Duty Cycle
0 to 255 Enable Pin A for Motor1 Speed analogWrite(enB, Speed); //
Write The Duty Cycle
0 to 255 Enable Pin B for Motor2 Speed
if(bt_data == 1){forword(); } // if the bt_data is '1' the DC motor will
go forward
else if(bt_data == 2){backword();} // if the bt_data is '2' the motor will Reverse
else if(bt_data == 3){turnLeft();} // if the bt_data is '3' the motor will turn left
else if(bt_data == 4){turnRight();} // if the bt_data is '4' the motor will turn right
else if(bt_data == 5){Stop(); } // if the bt_data '5' the
motor will Stop
else if(bt_data == 6){turnLeft(); delay(400); bt_data = 5;} else if(bt_data ==
7){turnRight(); delay(400); bt_data = 5;}
else if (bt_data == 8){ if(servo1<180){servo1 =
servo1+1;} motor_1.write(servo1);
}
else if (bt_data == 9){ if(servo1>0){servo1 =
servo1-1;} motor_1.write(servo1);
}
else if (bt_data == 10){ if(servo2>0){servo2 =
servo2-1;} motor_2.write(servo2);
}
else if (bt_data == 11){ if(servo2<180){servo2 =
servo2+1;} motor_2.write(servo2);
}
else if(bt_data == 12){ if(servo3>0){servo3 =
servo3-1;} motor_3.write(servo3);
}
else if (bt_data == 13){ if(servo3<180){servo3 =
servo3+1;} motor_3.write(servo3);
}
else if (bt_data == 14){ if(servo4<180){servo4 =
servo4+1;} motor_4.write(servo4);
}
else if(bt_data == 15){ if(servo4>0){servo4 =
servo4-1;} motor_4.write(servo4);
}
else if (bt_data == 16){ if(servo5>90){servo5 =
servo5-1;} motor_5.write(servo5);
}
else if (bt_data == 17){ if(servo5<150){servo5 =
servo5+1;} motor_5.write(servo5);
}
delay(30);
}
void forword(){ //forword
digitalWrite(in1, HIGH); //Right Motor forword Pin digitalWrite(in2, LOW);
//Right Motor backword Pin digitalWrite(in3, LOW); //Left Motor backword
Pin digitalWrite(in4, HIGH); //Left Motor forword Pin
}
void backword(){ //backword
digitalWrite(in1, LOW); //Right Motor forword Pin
digitalWrite(in2, HIGH); //Right Motor backword Pin digitalWrite(in3, HIGH);
//Left Motor backword Pin digitalWrite(in4, LOW); //Left Motor forword Pin
}
void turnRight(){ //turnRight
digitalWrite(in1, LOW); //Right Motor forword Pin digitalWrite(in2, HIGH);
//Right Motor backword Pin digitalWrite(in3, LOW); //Left Motor backword
Pin digitalWrite(in4, HIGH); //Left Motor forword Pin
}
void turnLeft(){ //turnLeft
digitalWrite(in1, HIGH); //Right Motor forword Pin digitalWrite(in2, LOW);
//Right Motor backword Pin digitalWrite(in3, HIGH); //Left Motor backword
Pin digitalWrite(in4, LOW); //Left Motor forword Pin
}
void Stop(){ //stop
digitalWrite(in1, LOW); //Right Motor forword Pin digitalWrite(in2, LOW);
//Right Motor backword Pin digitalWrite(in3, LOW); //Left Motor backword
Pin digitalWrite(in4, LOW); //Left Motor forword Pin
}
Servo Motor Control
1. #include <Servo.h> includes the Servo library for controlling servo motors.
2. Servo motor_1, motor_2, ..., motor_5 create objects for each servo motor.
3. servo1, servo2, ..., servo5 variables store the initial positions of the servo motors.
4. In the setup() function, the servo objects are attached to the respective digital pins,
and the initial positions are set using motor_x.write(servo_x).
5. The code includes various conditions (bt_data values 8-17) to increment or
decrement the servo positions based on the received data from serial
communication.
DC Motor Control
1. #define enA 5, in1, in2, in3, in4, and enB 5 define the pins for controlling the DC
motors using the L298N motor driver.
2. pinMode(enA, OUTPUT), pinMode(in1, OUTPUT), ..., pinMode(enB, OUTPUT) set
the respective pins as outputs.
3. analogWrite(enA, Speed) and analogWrite(enB, Speed) control the speed of the DC
motors by setting the duty cycle of the PWM signals on the enA and enB pins.
4. The functions forword(), backword(), turnRight(), and turnLeft() set the
appropriate pin states (HIGH or LOW) on in1, in2, in3, and in4 to control the
direction of the DC motors.
5. The code includes conditions (bt_data values 1-5) to call the respective motor control
functions based on the received data from serial communication.
Serial Communication
1. [Link](9600) initializes serial communication at a baud rate of 9600.
2. if([Link]() > 0) checks if there is data available on the serial port.
3. bt_data = [Link]() reads the incoming data from the serial port and stores it in the
bt_data variable.
4. [Link](bt_data) prints the received data to the serial monitor for debugging
purposes.
5. if(bt_data > 20){Speed = bt_data;} adjusts the speed of the DC motors if the
received data is greater than 20.
Main Loop
1. The loop() function continuously checks for incoming data from the serial port.
2. Based on the value of bt_data, the appropriate motor control functions are called, or the
servo positions are incremented/decremented.
3. The delay(30) introduces a small delay between each iteration of the loop to prevent
overwhelming the microcontroller with too many operations.
In summary, this code allows controlling a robotic system with 5 servo motors and 4 DC motors
based on data received via serial communication. The servo motors can be positioned
individually, and the DC motors can be controlled to move forward, backward, turn left, or turn
right. Additionally, the speed of the DC motors can be adjusted by sending a value greater than
20 through the serial communication.
7) Challenges faced during the project and their respective solutions:
1. Delay in getting 3D printed parts. We utilized that time to work on something
2. The servo motors given were not working properly. The gears of the servos would
damage frequently. We had to frequently change motors with a new one.
3. In the Arduino code, we made use of only 1 enable pin to reduce the number of
pinouts. But the motor driver had 2 enable pins. To resolve this problem we shorted
both the enable pins.
4. Sometimes during heavy load on the motors, the bluetooth module would turn off and the
application would show a ‘broken-pipe’ error. For this problem we gave it an external
power supply.
5. Every servo motor had to be given Vcc and gound supply. We initially used jumper wire
and a breadboard for this, but this increased the number of wires a lot and it was too
much to handle. To resolve this we made a VCC and ground bus.
6. The Battery given to us was not of proper size, due to which we had to cut the battery
holder that we had designed in our rover to fit the battery.
7. 4 motors.
8. The Cam module stopped working, so we ordered a new one but it has not been
delivered yet.
8) Key learning outcomes:
One key learning outcome from a pick and place robotic arm vehicle made from Arduino UNO is
the understanding of robotics and programming principles. Building and programming such a
project helps individuals grasp concepts related to mechanical design, electrical components,
coding, and automation. It also enhances
problem-solving skills, creativity, and the ability to work with technologies that are shaping the
future. By working on a pick and place robotic arm vehicle, one can gain practical experience in
integrating hardware and software, which is valuable in various fields such as engineering,
technology, and automation. The project not only provides a hands-on learning experience but
also fosters a sense of accomplishment and curiosity to explore further in the world of robotics
and technology.
9) Future Aspects:
a) We can add a pressure sensor to the gripper and program it for pressures of various
material. This will be useful to lift an object that is delicate and can be damaged if more
that required pressure is applied on it.
b) We can create an autonomous picking system for our gripper so that it can sense the
required pressure and pick the object without any manual interaction.
c) We can include inverse kinematic in the code such that once it detect the object it can
perform can perform calculations on its own.
10) References :
● Youtube video link:
How to make a Robocar With Pick & Place Arm using Arduino at home
● [Link]