Image Processing Based Automatic-7488
Image Processing Based Automatic-7488
Vol. 7, Issue 2, pp: (50-62), Month: April - June 2019, Available at: www.researchpublish.com
Abstract: In recent years, there is a clear growth and development in the field of automation both in industry and
residential areas. The rates of products of industries have considerably increased leading to increase the needing of
more employment or new techniques. Product sorting process plays an important role as these industries cannot
afford any human errors for sorting products. Therefore, it becomes necessary to develop a system that could sort
these products with higher accuracy and with minimum human interference. The use of image processing to
automatically sort objects based on their colors is an interesting area of research. In this, products would be sorted
according to the colors using an accurate and high level technique. So, this project focused in a highly automated
system which uses Raspberry pi 3 and it is interfaced with camera module to detecting the, Arduino Uno which
interfaced with Ultrasonic sensors to tracking the products and then sorts them using PLC system.
Keywords: Raspberry pi 3, PLC system, Conveyor belt, Arduino Uno, CD drives.
I. INTRODUCTION
It is in the nature of a human to make mistakes however a company or factories may experience significant monetary losses
due to human error due variability of products being produced. In some businesses it can mean loss of inventory and
profits; in the case of healthcare or pharmaceuticals, it could even cost lives. Almost 30% of quality defects were attributed
to human error and investigations into these root causes are generally poor and superficial. There were often no sustainable
CAPAs (corrective and preventive actions) defined, and the corrective action was mainly just re-training. So, the most
common approach to correcting this is re-training, however it often fails to produce the desired result, and training is only
responsible for about 10% of the human errors that occur. This is because it only takes care of issues related to lack of
knowledge, skill or ability (Howtomechatronics, 2016)
From this point, sorting based on color is done in many industries to ensure the quality of the object is reliable and up to the
mark. The error cased due to human negligence are avoided by the use of automated system because of that, this project
was developed. During the starting of this project, it was clear that automated sorting systems play an integral part in
ensuring goods and products across a range of industries are organized and distributed correctly and the manufacturers now
understand the speed, accuracy and capacity benefits automated sorting machinery brings to the production line (Amol,
2018).
In this project, a low cost automation system will developed as a part of an industrial project for sorting the objects
according to their colors. The project mainly focuses on sorting 4 different color objects using image processing, ultrasonic
sensors and DC geared motors interfaced with Programmable Logic Controller (PLC) to sort the products. The system
consists of conveyor belt which takes the objects in front of sensors and thus sorting logic is decided by PLC.
II. OBJECTIVES
This project purposed to automate the sorting process of products in the industries based on their colors. In addition, it
aimed to automate the process of sorting products to eliminate human errors in sorting products and hence the manual
effort, time consumed and avoids danger which happed when humans work in dangerous places. Moreover, the project
aimed to developing this system with long durability, low cost, less maintenance, and try to make this system as user
friendly as possible. Therefore, color object sorting system will be developed by using the image processing and PLC
system which will serve the factories with the production of high quality and accurate products that will raise the reputation
of the company and will also provide customers satisfactory products.
Page | 50
Research Publish Journals
International Journal of Electrical and Electronics Research ISSN 2348-6988 (online)
Vol. 7, Issue 2, pp: (50-62), Month: April - June 2019, Available at: www.researchpublish.com
V. PROJECT DESIGN
The idea of the project is combines the mechanical, electronic and software aspects. Therefore, using Solidworks program,
the mechanical design was designed as following:
Page | 53
Research Publish Journals
International Journal of Electrical and Electronics Research ISSN 2348-6988 (online)
Vol. 7, Issue 2, pp: (50-62), Month: April - June 2019, Available at: www.researchpublish.com
After a long planning, the overall design which is represented by conveyor belt was built as shown in the following figure:
Page | 54
Research Publish Journals
International Journal of Electrical and Electronics Research ISSN 2348-6988 (online)
Vol. 7, Issue 2, pp: (50-62), Month: April - June 2019, Available at: www.researchpublish.com
On the other hand, the LEDs were used to ensure color detection process. This was happened by control the outside world
by being connected to electronic circuit. Therefore, using General Purpose Input Output (GPIO), the Raspberry Pi was able
to control LEDs with the detection of the colors. The following figure shown the connections of GPIO with LEDs circuit:
Therefore, the overall connections between raspberry pi 3 and LEDs electronic circuit was illustrated as shown:
The LEDs circuit was built in the Breadboard then in the Stripboard and finally in printed circuit board (PCB) as shown
below:
B. PRODUCTS TRACKING:
After detected the colors, the system should track the presence of the objects. Therefore, Arduino UNO was interfaced with
three ultrasonic sensors which were connected to three different LEDs. The following table shows the pins connections
between Arduino and the circuit:
Page | 55
Research Publish Journals
International Journal of Electrical and Electronics Research ISSN 2348-6988 (online)
Vol. 7, Issue 2, pp: (50-62), Month: April - June 2019, Available at: www.researchpublish.com
int ledPin1 = 3;
int ledPin2 = 4;
int ledPin3 = 5;
int trigPin1 = 6;
int echoPin1 = 7;
int trigPin2 = 8;
int echoPin2 = 9;
Moreover, the distance between the object and the sensor was determined to be no more than 40cm as it is depend on the
distance between the object in the center of the belt and the location of the sensor. This was illustrated as:
Therefore, the overall connections between Arduino and its electronic circuit was illustrated as shown:
As raspberry pi 3 LEDs circuit, this circuit was built in the Breadboard then in the Stripboard and finally in printed circuit
board (PCB) as shown below:
Relays 5V
Raspberry pi 3 5V
Arduino UNO 5V
CD motor Drives 20 V
DC motor 2V
PLC System 24 V
In input sides, six relays (5 DC volts) coils were connected with Arduino and raspberry pi 3 while NO (normally open)
contact are connected with input channels by taking consider that input channels are DC (sink type) NPN transistor. In
output sides, it was consider that output channels are DC (source type) PNP transistor. Therefore, seven relays (24 DC
volts) coils are connected with output channels while NO (normally open) contact are connected to drive a seven 5 DC
volts relays to run forward motor of belt conveyor (KM1) and for forward and reveres of CD motor drivers for three color
as every CD motor need to two relays to run forward and reverse (KM2 to KM7). The following figure illustrate the
connection of these relays:
IX. TESTING
After each system was implemented separately, each of them was tested as follows:
A. COLORS DETECTION TEST:
As it was explained, using Pyhton language, the color code was built to detect the colors then to send a specific signal to the
LEDs circuit. Firstly, the code was built to detect the colors by adding a rectangle contour around them as it shown below:
After that, a specific signal was sent to a specific LED when the camera detect the color as it is illustrated below:
Figure 12: Sending a Signal to the LED when the Camera Detect the Color.
Page | 58
Research Publish Journals
International Journal of Electrical and Electronics Research ISSN 2348-6988 (online)
Vol. 7, Issue 2, pp: (50-62), Month: April - June 2019, Available at: www.researchpublish.com
Figure 13: Test the presence of the object using ultrasonic sensor and LED.
As it was mentioned in table 4, SW1 shows the stop case. So, if SW1 ON the system is still in stop mode. On the other
hand, SW2 shows the start case. Therefore, if SW2 is ON the conveyor belt (Km1) will start working as well the whole
system cases.
When the system is in run mode (SW2 ON) and the signals of red colors are ON (KA1 and KA2) which show the signal
from the camera pi and ultrasonic Sequentially, CD motor drive will start run forward (Km2) then it will reversed (Km3).
Page | 59
Research Publish Journals
International Journal of Electrical and Electronics Research ISSN 2348-6988 (online)
Vol. 7, Issue 2, pp: (50-62), Month: April - June 2019, Available at: www.researchpublish.com
The same process was repeated for green and blue colors. When the signals of green colors are ON (KA3 and KA4), CD
motor drive will start run forward (Km4) then it will reversed (Km5). As well as the blue color, when the signals are ON
(KA5 and KA6) CD motor drive will start run forward (Km6) then it will reversed (Km7).
Page | 60
Research Publish Journals
International Journal of Electrical and Electronics Research ISSN 2348-6988 (online)
Vol. 7, Issue 2, pp: (50-62), Month: April - June 2019, Available at: www.researchpublish.com
Page | 61
Research Publish Journals
International Journal of Electrical and Electronics Research ISSN 2348-6988 (online)
Vol. 7, Issue 2, pp: (50-62), Month: April - June 2019, Available at: www.researchpublish.com
[3] Howtomechatronics., 2016, February. A Novel Design Of A Robotic Object Sorter Based On Color Differences
Using Image Processing Techniques. In 2016 International Conference On Computer, Communication, Chemical,
Material And Electronic Engineering (Ic4me2) (Pp. 1-4). Ieee.
[4] Nasif Hassan Khan, Deb Kumar Sarkar, Asif Siddique, Md. Mamunur Rahman, Swarup Chakraborty., 2017.
Fabrication Of A Conveyor Belt With Object Sorting And Counting Facility. International Journal Of Advancements
In Research & Technology.
[5] Stephanie Przybylek., 2018. What Is A Color Model? - Uses & Definition. Study-Academy-Lesson.
[6] Fleischer, R.C., Mcintosh, C.E. And Tarr, C.L., 2014. Product Handling Concepts. Molecular Ecology, 7(4), Pp.533-
545.
[7] Lekha Bhausaheb Kachare., 2016. Object Sorting Robot Using Image Processing. International Journal Of
Electronics, Electrical And Computational System.
Page | 62
Research Publish Journals