Object Sorting System Using Robotic Arm
Object Sorting System Using Robotic Arm
Graduation Project
Team work:
Enas Ideas
Haneen Qabajah
Kifah Abdeen
Supervisor:
Dr. Liana Tamimi
A final project submitted in partial fulfillment of the requirements for the bachelor
degree in Computer Systems Enginnering
Hebron - Palestine
June 2018
Chapter 1
Introduction
This chapter will discuss briefly the project overview, motivation, importance,
objectives, a description of the project and a summary.
Also,we will analyze system problems, introduce system requirements, present
some of the problems and risks to which we can face and how to solve it, and the
results of this system.
1.1 Overview
In this fast growing industrial age every industrial unit needs speed in
manufacturing. Robotics has found a wide application in industries. Automation
provides far better service to customers eliminating the monotonous work by human,
achieving accuracy and speed in work.
Robot is an integral part in automating the flexible manufacturing system that one
greatly in demand these days." Robots are now more than a machine, as robots have
become the solution of the future as cost labor payments and customers demand"[1].
In our project, we build a robot that will interact with computer to classify object
based on owner commands. The purpose of this is to provide a robotic arm that sorts
the objects in the most efficient way.
1.2 Motivation
The robotic arm is one of the most useful pieces of technology to be introduced in
th
the 20 century, and quickly became a cornerstone in many areas of manufacturing.
It can be used for many different jobs and functions that may be too boring, difficult
or dangerous for a human to do [2].
This project also may be a solution for people who works in factories,
specially sorting section to sort objects by color.
1
1.3 Importance:
The importance of this project is to improve process by purchasing a robotic arm
to replace the workers performing this hard effort.
This robot has an arm which is used for the function of pick and place. This project
presents an object sorting system solution based on color using computer vision, it's
used for identification of color and information out of it. This information is
processed for picking the object on the basis of color and place at particular position.
The project deals with an automated material handling system.
The goal of the project is classify the object based on their color.
In addition, this project will open new prospects to other developers to enable robot
to classify object based on other techniques like, size and shapes.
1.4 Objectives:
Our main objective is to build a robot that does some task that constrained to sorting
objects according to their color.
Hence, the project is assumed to achieve these objectives:
1. Use camera to determine the signature for objects.
2. Send pixy camera parameters to the microcontroller (Arduino) .
3. Use arduino sorting algorithm to analyze the color of object.
4. Show the color on LCD device .
5. Build an arm system that is able to grap the object and place it.
In addition to these main parts, there will be other components to enable the main
parts work, such as arduino, stepper motors, LCD, and color detection defined in
arduino-uno sorting algorithm .
2
1.6 Problem statement
Based on a survey conducted in a Helmet manufacturing company, there was a
problem regarding the count of the total manufactured products and also, there were
various assembly lines for every different colored helmet. The main idea was to
provide a single conveyor for all the different colored products which would decrease
the work space and labor cost but also provides the basic function of segregating
different colored objects into its respective boxes. In addition, the accurate count of
the manufactured products could be centralized using wireless communication[3].
In a food packaging industry huge amount of time and labor was invested in
segregating raw and ripened tomatoes. An object sorting robot would decrease
the time, work space and labor cost while providing the basic function .
3
1.8 Risk management
This section includes a list of the risks that may face us in our project, and these risks
are:
1. Failure in the components and the difficulty of obtaining other copies of the
same type, which will be solved by buying new alternative components that
will suit our project.
2. Failure in the program pieces or failure of the laptop which leads to loss
of work, so we will put everything in our Google drive account.
3. Hardware components may not fit properly with each other, so we will
search for alternate components and buy them.
4. Memory may not be enough to hold our project programmes.
1.9 Results
We expect to gain the following results:
1.10 Summary
This chapter discusses the system in general terms, also introduces the problem
statement and the state of the art solution that we suggest. Chapter 2 introduces the
background of the project, and the various devices accompanied and assembled to build the
whole system. Chapter 3 discusses the design of the system, it introduces the flowchart, block
diagram, sequence diagram, system diagram and the main component of the systems.
Chapter 4 discusses software and hardware implementation. Chapter 5 discusses the software
and hardware testing. Chapter 6 highlights the future work and the conclusion of our project.
4
Chapter 2
Background
2.1 Overview
This chapter introduces the theoretical background of our project, short description
of the hardware components that will be used in the system, short description of the
software components, design specifications and constraints.
This section introduces some information about the hardware components of the
project and the technologies that will be used in our project.
Since our project is a new developed idea in the region, they have a similar project
only in a sorting definition :
A can sorting machine is built in this project. In this machine, used cans of
beverages are categorized in two stages: material (metal versus non metal) and
color (red, yellow and green) .
Ball collector robot is a vehicle that analyze its surrounding area then detect
balls and collect them to specific point known with predefined sign .
5
2.4 Design Options
In this section, we will discuss about design options that include controller options
and arm options.
Boards:
Arduino Mega board has:
● 54 digital I/O pins, of which 14(D0 to D13) can be used as PWM outputs.
● 16 analog input pins, which can also be used as digital I/O pins, adding to the existing 54
digital I/O pins.
● 4 serial communication lines(pins D0, D1, and from D14 to D19)[5].
The Arduino Uno board has:
● 14 digital I/O pins, of which 6 (D3, D5, D6, D9, D10, and D11) can be used as PWM
outputs.
● 6 analog inputs, which can also be used as digital I/O pins, adding to the existing 14
digital I/O pins.
● Only one serial communication line (D0, D1)[5].
The reason behind our selection for arduinouno instead of arduino mega is that we do not
need that much of pins, we only need 4 PWM pins and it is much smaller.
6
2.4.2 Arm Options
We found many choices for the arm during our search, each one has its
characteristics, which differ from others and may be similar to other in
some characteristics. Below some of arms that we have chosen between
them.
The reason behind of that we have not choose it is it’s price, it needs about US $1,022.93 and
we cannot afford this price.
2.4.2.2 6DOF Robot Arm Clamp Claw Mount Full Set Metal
Structure without Steering wheel
The specifications of this arm are good and suitable of our project, because it's have a
good stability and the price is cheap, it's need about US $350.So, we choose it .
This section describes the main hardware that we will use to construct the project.
In addition to the function of each one.
The Arduino Uno is an open source hardware and software a microcontroller platform
based on the ATmega328. It has 14 digital input/output pins (of which 6 can be used as
PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power
jack, an ICSP header, and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power it with a AC-
to-DC adapter or battery to get started. The Uno differs from all preceding boards in that
it does not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega16U2
(Atmega8U2 up to version R2) programmed as a USB-to-serial converter[6].
7
It is used in this project because of it is simplicity to be used and programmed to use
high-level languages such as C and C++.
Arduino uno specifications [6]:
● Microcontroller ATmega328
● Operating Voltage 5V
● 14 digital input/output pins (of which 6 can be used as PWM outputs)
● DC Current per I/O Pin 40 mA
● DC Current for 3.3V Pin 50 mA
● Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
● Memory: Flash 32KB, SRAM 2KB, EEPROM 1KB
● Clock Speed 16 MHz
The Arduino uno has the main function in the project, which is control the whole system.
2.5.1.2 6DOF Robot Arm Clamp Claw Mount Full Set Metal Structure
without Steering wheel
This arm will be used as a whole package after being bought, it will be a basic
component in our project. It is already assembled and tested well for its work by the
manufacturers.
We will use the arm to classify objects and put them in their proper place, it will be
connected to Arduino-uno.
Figure 2.2 6DOF Robot Arm Clamp Claw Mount Full Set Metal Structure
2.5.1.3 Camera
We will use this camera, Pixy CMUcam5 that has a smart vision sensor and is an
object-tracking camera for Arduino uno.
9
This camera is connected to the arduinouno in order to reflect the color of object to
the arduino. The arduinouno will interpret these information and make the arm
movement decision to the appropriate location at the appropriate time
Driving servo motors with the Arduino Servo library is easy, but each one consumes
a precious pin - not to mention some Arduino processing power. The Adafruit 16-
Channel 12-bit PWM/Servo Driver Shield will drive up to 16 servos over I2C with
only 2 pins. The on-board PWM controller will drive all 16 channels simultaneously
with no additional Arduino processing overhead. What's more, you can stack up to 62
of them to control even more servos - all with the same 2 pins!. The Adafruit
PWM/Servo Driver is the perfect solution for any project that requires a lot of servos.
[9]
Even if in our project we needed only 5 servos, and still we used the shield, it
because of the current leakage that cause the arm to stop moving or to move randomly
10
2.5.1.5 Conveyor
Is a common piece of mechanical handling equipment that moves objects
from one location to another.
11
2.5.1.8 Object
An object to be classified like cubes that have different color specifically four
colors: red, green ,yellow and blue.
Figure 2.8:Objects
This kit was used to power the arduino servo shield since it needs separate voltage
and current to operate well rather the one provided to the arduinouno . We supplied it
with 5 volts -at least- and more than 1.8 ampere.
12
2.5.1.10 LCD
The LCD display the color, When the camera recognize the color of object .
Figure 2.9:TheLCD
2.5.1.11 Breadboard
It was used to connect the lcd pins with it .
2.5.1.12 Laptop
Laptop is an important part in our project .We used it to program the Arduino-uno,
also to connect the camera in order to see what it is seeing and to install the required
application for it .
2.5.1.13 Wires
Wires are used to connect the component of the system to each other.
This section describes software components that we will use to program the
project. In addition to the function of each one.
13
2.5.2.2 PixyMon
“PixyMon is an application that allows you to configure Pixy and see what it sees. It
runs on several different platforms including Windows, MacOS and Linux, as well as
other smaller embedded systems . It also allows you set the output port and manage
color signatures. PixyMon communicates with Pixy over a standard mini USB
cable”[12].
This software was used in order to give each object an signature, and to teach the
pixycamera the object in order to detect it later.
2.6.2 Constraints
The use of a large number of servo motors in the automatic arm, which
required amount of energy that was not enough to use the microcontroller
directly, forcing us to use an external power supply.
The amount of power supply required for the arm is fixed ,it have a
voltage about (5.3-5.9) V and the current is nearly about 1.9A.
14
2.7 Inverse kinematics equation
voidSpecial_Calc_Point() {
15
Chapter 3
System Design
3.1 Overview
This chapter discusses the conceptual description of the system, it show schematic
diagrams ,block diagrams, flowcharts and circuits of its hardware and software.
Our project mainly consists of the following parts, The first part presenting the
automatic sorting based on color processed in arduino microcontroller, the
microcontroller in turn will control the servo motors . These servomotors will control
the movement of robotic arm, by controlling their angular movement with respect to
the colored objects moving on conveyor belt which is also controlled by arduino.
The robotic arm will be fully controlled by servomotors. The gripper of Robotic arm
will pick the object place it depending on its colors .
The other main part of this project is pixy camera for high resolution and color
identification using PixyMonsoftware.The camera perform the well job of identifying
objects, in addition it helps for turning of robotic arm to the next object sorting.
The sequence of system steps are: -
1. Turn on the robot system.
2. Put colored objects in conveyor belt and turn it on .
3. The pixy camera will identify the color for the current object by using
signature configuration, also conveyor belt will stop automatically when the
first object appear on PixyMon window.
4. Pixy Camera will send signature in file that contains pixy parameters to
arduino-uno to determine the color for object in arduino sorting algorithm .
5. Display the detected color for object on LCD device .
6. Arduino will control the arm movement by angular movements for servo
motors to grasp the object from conveyor belt then put it in suitable place .
7. Continue the steps from 1 to 6 while conveyor belt on and objects are
available else turn off the system .
16
3.3 System design
3.3.1 Logical structure
The conveyor motor receive the power form the power supply. The one pulley
conveyor belt, with a circular loop of objects on the conveyor belt that rotates about
them.
Forward movement of the belt bring the objects near the pixy camera lens. When
objects detected by the camera the conveyor belt stop for the identification of the
color for the object with the help of the smart vision sensor ( pixy camera),this camera
considered as smart camera provide computer vision using particular software called
PixyMon .
Then the signature of the particular object color is send to the control unit in arduino
for color determination which is using pixy parameters for arduino sorting algorithm ,
then the control unit (Arduino) sends the signal to the robotic arm that picks the object
and place it in the boxes based on their colors , after placing the object, the arm of the
robot is comeback to the normal place and waiting for the next object to arrive. Then
the microcontroller start the conveyor to bring the next object to the sensor unit in the
camera and the process continuous as explained in above in this page until the objects
become not available on conveyor or when power for system turned off .
Objects on
LCD boxes
17
Figure 3.1 : The general block diagram
Figure 3.2 show how hardware components are connected with each other .
ARM
Gripper
Arduino-uno
Conveyor belt
LCD
PC
18
3.3.4 Flow Charts
Figure 3.3, 3.4 and 3.5 represent the flowcharts of system activity following the
steps mentioned in section 3.2.
Flowchart : Methodology
In our project, we used a simple method for sorting the objects of a different colored ,
it is detecting the color of the object and sort out the different colored objects. With
the help of a robotic arm that is controlled by a controller unit in Arduino, we ensure
that place the same colored objects in the same boxes .
19
The general flowchartdiagram :-
Is there object
YES NO
on conveyor ?
Object color is being sensed with the help of pixy camera by sending pixy parameters to the
control unit in Arduino to detect the color for object
Figure 4.6
Display the color of object on LCD then move robotic arm to carry object from conveyor
and place it in boxes
Figure 4.5
NO Is button YES
still ON ?
End
20
Figure 3.3: General flowchart diagram
Figure 3.3 show the flowchart of the procedure followed for sorting of objects based
on their color. Initialize the arduino module. Then the stepper motor is initialized to
rotate the belt and then the objects are placed which move along the belt. Camera is
activated and conveyor belt will stop If any object is detected, after that the camera
determine the signature of that object and detect the color of it, then make arm
moving by a specific angle to grasp the object from conveyor belt and put it on the
correct box then arduino make conveyor belt on , the process will repeat infinite
number of times until the power turned off or the system does not have objects.
21
Flowchart for sorting :-
Start
NO If color YES
object is Carry the object from the belt
red YES
End
22
Figure 3.4 : The flowchart diagram for sorting
PixyMon software
Set configuration for each signature( signature range, labels, camera brightness, Min brightness,… )
If the
NO YES
signature
value is 1 ?
23
Figure 3.5 : The flowchart diagram for color detection
Figure 3.6 shows the sequence diagram of the whole system. As the figure shows, the
operation starts when the conveyor belt start rotation around color object to reach it
near the camera .
The camera will detect the signature of the object and send it to the arduino.
The arduinouno will determine the color of each object depending to the signature
received. If the system have objects and the camera still detect block for object,
arduinouno will send the movement command to the arm and the arm will grasp the
object from conveyor then place it on the boxes and display the color on LCD until
the first object sorted .The sorting syatem will end if objects not available, or the
power turned off .
24
Conveyor Camera Arduino-uno Arm LCD Boxes
Start rotation
Move colored
object near camera
Send object
signature
Reflect the
colored object
Movement
signal
Display
color on
LCD Place
object
25
3.3.6 Sub-Circuits
Figure 4.7 shows how each servo of the robot arm is connected with the servo motor
shield. We connect ground of servo with ground pin of shield, Vcc of servo with 5V
pin of shield, and the servo data pin with one of the output pins of shield.
26
Stepper motor circuit
Figure 4.8 shows how stepper motor is connected with TB6560 driver. We connect
ground and Vcc of driver with power supply,{A-,A+,B-,B+} of driver with stepper
motor , step pins of driver with pin 5 of arduino, direction pins of driver with pin 2
of arduino ,enable pins of driver with pin 8 of arduino ,and others on GND of
arduino.
27
3.3.7 Schematic diagram
● Servo motor with PWM Shield schematic diagram
Figure 4.10 shows how each servo of the robot arm is connected with the servo
motor shield. We connect ground of each servo with ground pin of shield, Vcc of
each servo with 5V pin of shield, and the each servo data pin with one of the output
pins of shield
28
● LCD schematic diagram
Figure 4.11 shows how LCD screen is connected to arduinouno. We do this by
connecting the following pins: We connect ground of LCD with ground pin of
arduino, Vcc of LCD with 5V pin of arduino, data pins of LCD from D4 to D7 with
arduino pins from pin 5 to pin 8, RS with pin 10, E with pin 9.
Additionally, wire a 10k pot to +5V and GND, with it's wiper (output) to LCD
screens VO pin (pin 3). A 100E is used to power the backlight of the display, usually
on pin 15 and 16 of the LCD connector.
29
Stepper motor schematic diagram
Figure 4.8 shows how stepper motor is connected with TB6560 driver. We connect
ground and Vcc of driver with power supply,{A-,A+,B-,B+} of driver with stepper
motor.
30
Chapter 4
Software & Hardware Implementation
4.1 Overview
In this chapter, we described the implementation of software and hardware
components that are used in our project.
31
4.2.2 PixyMon
“PixyMon is an application that allows you to configure Pixy and see what it sees. It
runs on several different platforms including Windows, Mac OS and Linux, as well as
other smaller embedded systems . It also allows you set the output port and manage
color signatures. PixyMon communicates with Pixy over a standard mini USB cable”
This software was used in order to give each object a signature, and to teach the pixy
camera the object in order to detect it later.
32
4.3.1 Pixy CMU cam5 configuration
We used the camera in the project to identify the color by placing a signature for each
color. Assisted by the smart color sensor.
The figure 4.3 shows a descriptive image of the connection of the camera with the
arduino- Uno.
33
Figure 4.4: The connection of Arm servo motors with servo motor shield.
The conveyer is one of parts of the system and is used to move the object from one
place to another by stepper motor. The figure 4.5 show a descriptive image of
moving the conveyer.
34
4.3.4 LCD configuration
LCD is a useful part of the project where it was used to display color.
The figure 4.6 show a descriptive image of the connection of the LCD with the arduino-uno
35
4.3.5 All the system connected together
The figure 4.7 below shows the connection of all the components of the system together.
Figure 4.7: The connection of all the components of the system together.
36
Chapter 5
Testing
5.1 Overview
In this chapter we described and discussed the steps, results of the implementation
and the testing of the system.
37
After applying the code on the stepper motor, the conveyer was move as showen on
figure 5.2
Figure 5.3 shows how the arm moved to specific box and put the object on this
place.
38
Figure 5.4 :The gripper of arm pick the object into specific box
The figures 5.5 below show the detected object by the camera, and the camera
calibration process by finding the color and ignoring everything outside these
coordinates
The figures 5.5 and 5.6 show the operation of determine in which square each object
is placed and its signature in order to determine what is on each square of the board
(red or green or blue and yellow objects ), and in which square does this object exist.
39
5.5: The detected objects by the cameraFigure
40
Figure 5.7 shows that the status of conveyer that have an objects blue color.
41
Figure 5.10 code of red color
42
Figure 5.13 The status of the conveyer if the object is yellow
43
Chapter 6
Conclusion & Future Work
6.1 Overview
In this chapter, we will conclude the challenges, final results and future works of our
project.
1. We faced a problem with the camera, it detect more than one object ,
And filter pixels but we solve this problem in PixyMonsoftware .
2. Problem with ports in arduino-ide .
44
6.3 Final Results
This robot involves sorting of objects through camera , the future advancements can
be done by increasing the efficiency of the camera . This method is verified to be
highly beneficial for automated industries. The camera is key component of project
which aides in distinguishing the objects. Failing of which may result in wrong
material handling. So it becomes vital that the sensor in camera had a very high sense
of sensitivity and ability to distinguish between colors. There is a reset button
provided on the base which can used to restart the system from the beginning when
there is stuck or hang situation. There are two main steps in color sensing part, objects
detection and color recognition. This project is depicting the prototype of sorting
systems which are used in industries.
45
References :-
[1]https://www.ijareeie.com/upload/2013/july/69_OBJECT
https://nocloudinthesky.wordpress.com/2013/01/17/technology-of-the-robotic-arm/
https://www.irjet.net/archives/V4/i8/IRJET-V4I891.pdf
https://www.irjet.net/archives/V3/i4/IRJET-V3I4291.pdf
[6]Arduino Uno,URL:
https://www.arduino.cc/en/Main/ArduinoBoardUnoSMD
https://learn.adafruit.com/16-channel-pwm-servo-driver?view=all
46