Implementation of Color Sorting
Implementation of Color Sorting
DEPARTMENT OF ELECTRICAL/ELECTRONIC
ENGINEERING TECHNOLOGY
SCHOOL OF ENGINEERING TECHNOLOGY
FEDERAL POLYTECHNIC NASARAWA
P.M.B 001 NASARAWA, NASARAWA STATE
DECEMBER, 2020
I
Implementation of Microcontroller Based Colour
Sorting Machine
By
DECEMBER, 2020
II
Declaration
We hereby declared this project is all our own work and has not been copied in part or
in whole from any other sources. All previous project work, publications, books,
journals, magazines, internet sources have been adequately reference within the main
Sign/Date:
Head of Department
Sign/Date:
Sign/Date:
III
Letter of Transmittal
Department of Electrical/Electronic
Engineering Technology
P.M.B 001
Nasarawa state.
Electrical/Electronic Technology
Nasarawa.
Dear Sir,
In the compliance with the policy of the institution, which stipulate that every student
at the end of his//her programme in the school is expected to carry out a supervised
Colour Sorting Machine in the partial fulfilment for the award of Higher National
Yours faithfully
IV
Acknowledgements
We want to give glory, honour and adoration to the king of kings for his love, grace,
mercy and protection and for making this project to be a great success. May his name
forever be praised.
We want to thank our project coordinator Engr P. A. Avong for his effort,
contribution, and guidance towards the project. Our appreciation also goes to our
project supervisor in the person of Engr. Mohammed Y. S., for his relentless effort
through supervision, correction and assistance towards this project. He indeed play a
key role to ensure the project is well done and greatly successful.
Special appreciation goes to my boss, Air Vice Marshal CU Nwagwu for his financial
and moral support, I want to also thank my Mother Mrs Afaramai Jummai, for her
great contribution towards my education, I also want to thank my siblings, friends and
colleagues for their prayers and support, I am indeed grateful to you all. Above all I
Am very grateful to my boss Air Vice Marshal AB Bagare, who has indeed
contributed greatly to my studies with encouragement, advice and prayer. May God
Am grateful to my Auntie and her husband Mr and Mrs Owabor for their financial
support, help and encouragement. Thanks also to my brother Mr John Afaramai and
my fathers and helpers, MWO Dados CC and MWO Otitodun and their families they
have indeed contributed greatly financially and other aspect to ensure the success of
that we couldn’t mention their names here that has contributed greatly to the
success of this programme, may God reward them mightily in Jesus name..
V
Table of Contents
Item Page
Chapter 1 - Introduction..............................................................................................1
1.1 Introduction.....................................................................................................1
1.2 Background and Justification..........................................................................2
1.3 Aim and Objectives of Project/Research.........................................................3
1.3.1 Aim...........................................................................................................3
1.3.2 Objectives.................................................................................................3
1.4 Motivation.......................................................................................................3
1.5 Contribution to Knowledge.............................................................................4
1.6 Scope and Limitation of project......................................................................4
1.7 Structure of the Report....................................................................................5
Chapter 2 - Literature.............................................................................................- 6 -
2.1 Introduction.................................................................................................- 6 -
2.2 Theory of operation.....................................................................................- 9 -
2.3 Functionality.............................................................................................- 10 -
Chapter 3 - Methodology/Implementation..........................................................- 12 -
3.1 Introduction...............................................................................................- 12 -
3.2 Methods of Information collection and Information Utilisation...............- 12 -
3.2.1 Information collection.......................................................................- 12 -
VII
List of Figures
Figure Page
Figure 1.1: Sorting Machine .........................................................................................3
VIII
Definitions of Terms:
DC -- Direct Current
DOF --- Degree Of Freedom
D:S -- Distance to Spot ratio
DSP-- Digital Signal Processor
IX
Abstract
X
Microcontroller Based Colour Sorting Machine Introduction
Chapter 1 - Introduction
1.1 Introduction
Automation is the technology by which a process or procedure is performed without
boilers and heat treating ovens, switching on telephone networks, steering and
been completely automated [1]. Sorting is a task carried out by a machine that
sorts objects such as rice, tea, or containers and heavy goods. Traditional methods
of sorting involved placing objects onto a conveyor and sort sonly one object at a
time. This method is time-consuming and expensive, besides the worker on the job
will be so tired after counting for a long while. Our paper aims at sorting
simultaneously [2].
The sorting operation takes place in a synchronized manner. It also includes a user-
defined volume selection menu through which the user can input the desired object to
be sorted. The entire system is more flexible and timesaving; therefore, it makes the
work done faster. The sorting operations are controlled using a Programmable Logic
Controllers (PLC). This is because Programmable Logic Controllers (PLCs) are very
flexible, cost-effective, space efficient and reduces complexity, works at a very fast
automation errors and monitor quality at the speed of production line. They are used
in assembly lines to identify and classify products by colour. The objectives of their
usage include checking the quality of products, to facilitate sorting and packaging, to
application-driven. Low cost and simple colour sensors are preferred over
sophisticated solutions for less demanding applications where the top priority is cost
Colour names can be used and conjure reasonably consistent perceptions. There have
eleven basic colour names that have been identified such as white, grey, black, red,
yellow, green, blue, orange, purple, pink, and brown. Most or all colours can be
described in terms of variations and combinations of these colours. Due to the fact
that human colour vision is accomplished in part by three different types of cone cells
in the retina, it follows that three values are necessary and sufficient to define any
colour. Colour theory describes that there are three values that can be thought of as
colour space. Thus, saturation, luminance is one such co-ordinate system, or colour
space.
1.3.1 Aim
The main aim of this project is to develop an automated sorting device that can
separate different colours from a mixed colour system and place them according to
1.3.2 Objectives
To study MCU architecture, cross compilation and development environment
To interface colour sensor and the MCU and also to interface LCD system and
the MCU
1.4 Motivation
Machines can perform highly repetitive tasks better than humans. Workers fatigue on
has been performing an inspection task over and over again may eventually fail to
recognize the colour of product and will end up mixing different colours. Automating
many of the tasks in the industries may help to improve the efficiency of
separate objects with different colours and place them according into a sorting
can without mixing different colours in one can. This system is also faced with
The device can only separate red, green and blue objects
- Chapter 4 this section will discuss test result, all measurement and analysis
Chapter 2 - Literature
2.1 Introduction
This content presents the critical analysis of the existing literature which is relevant to
the Ora sorting system. Though, the literature consists of a lot many research
contributions, but here, we have analyses some of the research and review papers.
Finally, the finding of summarized data to related the scanned and analysed research
papers. Snehal Shirgave [4] in their paper explain about colour sorting robot. This
system consists of colour sensor module, servo motor, Arduino UNO and LCD
display. TCS3200 is the colour sensor that detect light reflected light by an object and
convert it into frequency. Servomotor is use to move a slider according to the colour
microcontroller. Detected output colour and the count value of respective coloured
Rudresh. H. G and Prof. Shubha P. [2] this paper stated that the project deal with an
automatic material handling system. This project purposed organizing the coloured
object which are approaching on the conveyor by picking and placing the objects in
its separate located place. There by reducing the tedious work done human
accomplishing accuracy and rapidity in the work. The project includes colour sensors
that senses the object colour and lead the signal to the controller guides signal to the
motor driving circuit that drives the different motor of the robotic arm to understand
the object and place it in the correct location. Depending upon the coloured sensed the
robotic arm goes to the correct location to releases the object and come back to the
initial position.
Real Time Industrial Colour Shape and Size Detection System Using Signal Board
by Geda. Karthik Kumar and S. Kayalvizhi [3] in their paper introduce a project about
camera, display unit and mechanism such as conveyor belt use for the transport of
object in the industrial environment. The main purpose of design of this particular
system is to identify the colour, shape and size as well as the number of objects
Industrial automation and robotics play important role in growth of industry. The
main criteria in industry are quality and flexibility of the product. In 80‟s robot was
used to perform tasks like machine tending, material transfer, painting, welding which
does not require high accuracy [2]. Considering greater role of robots, it was predicted
in 90‟s that industrial robots will become increasingly vital in applications which
require high precision and accuracy. Autonomous robots with sensors are used for
accuracy and precision in product which gradually improves the growth of industry
[4]. To achieve this precision, robots are programmed for a single task taking sensory
information. Real time and highly accurate characteristics of small objects in a fast
flowing stream would open new directions for industrial sorting processes. Recent
advances in electronics and printed circuit board technology open new perspectives
The advance system of carton sorting is according to weight; old system was based on
sensor. There were some systems which counts that how many objects are going from
conveyer, at the side of conveyer normally transmitter and receiver infrared sensor are
used. When the carton cuts the infrared beam, the electronic counter system in digital
form gets „0‟ which was counted as count. Sensor based system sense coming object
and count it. However, the drawback of the system is that it can only senses the object
So it is not having the provision of sorting carton as per required weight Sensor-
automatic sensor separation techniques for primary and secondary raw materials[5].
controlled by the on a timer of the pulse rail appearing at its control inputs. According
to the structure of robotic arm, various degree of rotation for the servomotor are
assigned to carry out the operations. The arm of the robot realized using aluminium
brackets. Four types of brackets are arranged for this purpose [3].
The robotic arms are too costly and complex due to the complexity and the fabrication
process. Two types of the brackets are for holding the servomotors and two types for
the extensions and interconnections of the robotic arm. The IR sensor identifies the
box and it sends the data to a microcontroller, which controls the arm motion
according to the height of the box. The motion of the servomotor is controlled in a
manner so that each box is dropped into a respective boxes place in a predetermined
position. The time taken by the robotic arm for a single motion is set to approximately
0.5 seconds. Eight steps of motion of robotic arm are required for a box to be picked
up and to be dropped in the correct basket. That includes motion of arm from the
default position, picking a box, motion to the correct basket, dropping the box to the
basket and return to the default position. The number of steps taken by the arm to pick
the box and drop the box counts to seven steps and from there to back to default
identify height of the box is around one second. Therefore, the total time needed for
picking and dropping the box including identifying the height is around five seconds.
Four motors are used in the robotic arm. One to control the rotational motion of the
base, one to control the angle at the elbow, one to control the wrist movement
and last one to control the gripper, that is to hold and drop the ball. The initial position
of the robotic arm when power is applied and the robot is ready for operation. A lever
mechanism was used for opening and closing the gripper. Therefore, a single motor is
enough for the gripper control. Fingers come closer to pick and hold the box and
move apart when it drops the box. Two positions was designed for the fingers by
using a single servomotor. One in close position and other in open position. Two
motions are permitted for the motor at wrist and elbow that is to move up and down
[9].
diameter and 1cm height. The distance between the top surface of the object and the
colour sensor, during the time of detection process, must always be the same.
The reason for such a constraint is owed to the fact that TCS230 produces output
signals of different frequencies while detecting the colour of the same object kept at
different distances from the sensor. We have used four aluminium rods and a
fibre plate to suspend the colour sensor above the first conveyor belt so that a 17cm
wide and 6cm high rectangular window is provided for the object to move under it. In
other words, deducting the height of our test object, the sensor and the top of the
2.3 Functionality
When a supply of 3.4V is given to the DC motor (12V, 3.5rpm) it starts to rotate. It
will control the movement of the conveyor belt on which the product is placed. When
the light falls on the product, it is reflected back to the colour sensor. As mentioned
before, colour sensor TCS230 has 4 colour filters for green, red, blue and black (no
colour), which is opted by its select pins. The program saved in the microcontroller
selects filters. Frequency output from colour sensor depends on colour n the colour of
the object as well as the select pin configuration input from microcontroller. Select
pin can select one of the four photo diode filters, which can give output according to
the colour of the object. When there is no object, in front of sensor, it produces an
output of 330Hz range frequency and when there is an object, it produces an output
The microcontroller can find the frequency of the output from TCS230 by counting
falling or rising edge of sensor given to its TOCK1 pin using pre-scalar
settings set by option register configuration. The pre-scalar was set for
1:16 arrangement and the time for counting is 50ms. Hence, PIC counts the frequency
using its timer at the rate of one increment for sixteen falling edges of input frequency
330Hz range frequency. Hence, we set a break down value of 32H for deciding
whether there is an object on the conveyor belt or not. Therefore, the PIC can only
proceed to the next step after checking this condition. If there is an object, the sensor
produces an output frequency, which is proportional to the colour of the object and the
selected photo diode configuration in such a way that it provides maximum frequency
for the respective to the respective photo diode. Hence sensor gives maximum
frequency for red coloured object when red filter is selected, and in the same way
registers and these values are examined for taking the greater one, in order to identify
the colour of the object. The second DC motor is in contact with another conveyor
belt, on which a container is placed. The container has three sections; first section for
Red, middle for Black, and third for Green. According to the colour, the container will
possible by connecting the DC motor to L293D hybrid IC. The products will finally
Chapter 3 - Methodology/Implementation
3.1 Introduction
This chapter deals with the “Implementation of a Microcontroller Based Colour
Sorting Machine”. It discusses the design, steps involved, working process, and
this project.
described as follows, The data for the research of this study were obtained both from
- Secondary data: on the other hand were obtained by searching on the internet
etc.
includes
Studied Documentation
Library
the internet source, consulting supervisor and learned personnel in the field,
consulting other books, reading journals and observing similar designs work carried
out.
- List all parts preferable in tabular form, list and write simple statement why
section. The sensor analysis and classifies the RGB colours and provides
the corresponding output values for the RGB colours to the Arduino UNO.
The perfect colour sensor used for this colour-sorting machine is TCS
connections in the board are made through Arduino UNO BOB which is a
the chute according to the colour sensed by the colour sensor. The chute is
portion of the colour sorting section. Another servomotor is used here for
Arduino Uno board comes with a pre-programmed bootloader that lets in you
Connect Arduino board to the computer and pick out the perfect com port in
Arduino ide. Collect the program (TCS3200). Pick out the proper board from
equipment board menu in Arduino IDE and upload the sketch. Load this
heart of the machine and includes out all major features. simulation
The device was soldered on Vero board, Vero board was used in this project
cost and takes long process in designing but works in high efficiencies
The components were place on the Vero board after the constructional
diagram was prepared; the constructional diagram is the diagram that presents
the actual look of the project on the board. In addition, it formed the basis of
the components placement, which was achieved using the circuit diagram.
After the components have been placed on the Vero board, soldering of the
components was carefully carried out using soldering tools, which were
soldering irons, the lead sucker, lead, soldering brush and cutter. The
necessary soldering skills to ensure that the components were well soldered.
4.1 Introduction
In This chapter analyses the construction of the project based on tests carried out to
ensure proper operation of the design, the results from the tests and discussions
confirm their workability. After soldering the component on the Vero-board, test was
carried out in the following order. At the power supply, using a multi-meter, the
diodes were tested and the diode characterization is checked to note if the diodes
were properly soldered, the LCD connections, the controller pins, the fingerprint
The circuit design is then read with the multi-meter to confirm continuity and
was powered. The Feeders were read and confirmed with 220v ac voltage, and the
The complete system was tested at different conditioning and different voltage and
load. This test was carried to ascertain the performance of the system. Different
readings were recorded from both the sensors and the output voltage of the panel.
Colour-sorting test are conducted on three different colours. The result is presented in
Table 4.1.
1 Red 10 7 3 0
2 Green 10 6 2 2
3 Blue 10 8 1 1
Chapter 5 - Conclusion/Recommendation
5.1 Introduction
This project is centred on implementation of a microcontroller based colour sorting
machine which is used to sort different coloured objects. This project has
sensors, which sense the colour of an object and separate it into its respective
container. This project consists of components such as PLC, colour sensors, electronic
system and motors. The objects are being sorted according to their respective colour.
The main conveyor is supported of two branches to load the distinguished object on to
the respective one as separated by the electronic system and detected by the colour
sensors.
5.2 Conclusion
As it has been aforementioned, sorting machine is very important in industries
because machines can perform highly repetitive tasks better than humans can. Worker
fatigue on assembly lines can result in reduced performance, and cause challenges in
different coloured object and place them according to their colours in their respective
5.3 Recommendation
- The project did achieve colour sorting at discrete unit and not in a mixed
system as proposed.
The model can be improved by making some changes in the program and
components. Some suggestions are given below. We can add a load cell for
measurement and control of weight of the product. We can also add a counter
for counting the number of products. Speed of the system can be increased
controller by adding more sensors. The sensor can be changed according to the
type of product. The DC motor can be replaced with stepper motor. The PIC
References
APENDIX A
Front view of Colour Sorter model
APPENDIX B
Colour Detection
APPENDIX B
Simulation view