Revista Científica Interdisciplinaria Investigación y Saberes
2023, Vol. 13, No. 3 e-ISSN: 1390-8146
Published by: Universidad Técnica Luis Vargas Torres
How to cite this article (APA):
Perez, J., Robalino, F., Torres, P., López, X. (2023) Free
RGB colorimeter for the sensing and classification of pigmented spheres, Revista
Científica Interdisciplinaria Investigación y Saberes, 13(3) 44-71
RGB free colorimeter for sensing and sorting of pigmented spheres
Colorímetro libre RGB para la sensorización y clasificación de esferas pigmentadas
Julio Perez
Master's Degree, Universidad Técnica de Ambato, Ambato, Ecuador, jperez6656@uta.edu.ec,
https://orcid.org/0000-0002-0119-5570
Freddy Robalino
Master's Degree, Universidad Técnica de Ambato, Ambato, Ecuador, frobalino@uta.edu.ec,
https://orcid.org/0000-0001-8774-4560
Paulo Torres
Master's Degree, Universidad Técnica de Ambato, Ambato, Ecuador, pc.torres@uta.edu.ec,
https://orcid.org/0000-0001-9804-5693
Xavier Lopez
Master's Degree, Universidad Técnica de Ambato, Ambato, Ecuador, mx.lopez@uta.edu.ec,
https://orcid.org/0000-0001-8159-8603
The present work shows the design, development and testing of a
first prototype system for classifying color pigmented spherical
objects. The objective is the analysis of efficiency and error that digital
photoelectric devices can have. Based on the detection of color
patterns called RGB model (Red, Green & Blue) the system is
composed of a digital color detector sensor TCS3472 controlled by
an open source electronic platform Arduino. The ATMega328P
microcontroller processes the data obtained by the sensor, which
then executes the actions responsible for moving the servomotor that
controls the selector mechanism which, in turn, consists of an access
and output channel to three containers. An external control panel with
four push buttons: start, pause, reset and emergency; the latter
configured for the total disconnection of the system in case of
possible jamming failures. Finally, the system delivers the results of
the sphere separation by color on the control panel and physically in
the repositories of the structure.
Abstract
Received 2023-04-25
Revised 2023-06-13
Published 2023-09-07
Corresponding Author
Julio Perez
jperez6656@uta.edu.ec
Pages: 44-71
https://creativecommons.org/lice
nses/by-nc-sa/4.0/
Distributed under
Copyright: © The Author(s)
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
45
Keywords:
colorimeter, color sorter, TCS3472 sensor.
Resumen
El presente trabajo muestra el diseño, elaboración y pruebas de un
primer sistema prototipo clasificador de objetos esféricos
pigmentados de colores. El objetivo versa sobre el análisis de
eficiencia y error que pueden tener los dispositivos digitales
fotoeléctricos. Basado en la detección de patrones de color
denominado modelo RGB (Red, Green & Blue) el sistema se compone
de un sensor detector de color digital TCS3472 controlado por una
plataforma electrónica de código abierto Arduino. El
microcontrolador ATMega328P procesa los datos obtenidos por el
sensor, que seguido ejecuta las acciones encargadas de mover el
servomotor que controla el mecanismo selector que, a su vez, consta
de un canal de acceso y salida hacia tres contenedores. Un panel de
mando externo con cuatro pulsadores: inicio, pausa, reseteo y
emergencia; este último configurado para la desconexión total del
sistema por posibles fallos de atascamiento. Finalmente, el sistema
entrega los resultados de la separación de esferas por color en el
panel de mando y físicamente en los repositorios de la estructura.
Palabras clave:
colorímetro, clasificador de colores, sensor
TCS3472.
Introduction
With the vertiginous advance of technology in recent years, various
electronic systems have been designed to help automate industrial
processes in different fields, such as production, food, manufacturing,
maintenance, etc. The classification of objects is part of a production
process, in this case, the color of the object is the main parameter to
take into account in this process. (Filote Razo, 2016).
A more advanced application of the system is the detection of objects
by shape and its application in supermarkets. Here, the cashier has to
distinguish several dozens of products without barcodes, such as
vegetables, sausages, breads, etc. Remembering all these goods is a
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
46
heavy task and even more so if it changes every day. Therefore,
automated recognition requires a system that can reduce the cashier's
workload. (Morimoto, 2018) The development of the present project
is accompanied by a previous study of articles concerning the use of
color sensors for object classification that have considered a TCS3472
sensor, and that provides perceived wavelength values of light
according to the RGB model.
A spherical object has been defined as the subject of study for the
classification. This is replicated in 4 bodies with a different color (blue,
red, green, yellow). Thus, after determining the model and color of
the object, we proceed to establish the mathematical model to be
used for color detection based on the saturation of the color and the
luminosity reflected on the body.
By being able to classify objects based on their coloration, future
applications for this classification system are thought of, being the
manufacture of fruit sorting and packaging.
In 2020, a group of researchers from the National University of
Colombia developed and evaluated a prototype for measuring the
color of fresh vegetables, using DHT11 sensors for temperature and
TCS230-3200 for color. Through tests carried out it was deduced that
the color measurement with the prototype is dynamic, because it
avoids the use of a lighting system, since the color sensor has
integrated LED devices. After the analysis of the results it was
concluded that the prototype developed by integrating components
such as sensors and data acquisition card and free software, allows to
evaluate the color in a different way; 2) the average error recorded by
the prototype was 15.57 %, lower value than that recorded by the
commercial colorimeter was 27.45 %. (Sarria-Dussán, Garzón-García,
& Melo-Sevilla, 2020).
Similarly Hermoza Llanos (2018) in his research conducted in Sacha
Inchi producing companies in Lima, determines as main objective the
design of a peeled fruit sorting system by color. All materials in
contact with the seeds were considered as non-contaminating, the
final output flow is 200 Kg/h distinguishing between dark brown and
almond colored seeds. A TCS3472 RGB color sensor, a vibrating table
and an LCD screen were used as materials.
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
47
A research conducted in 2018 in Italy to determine the impact of light
pollution on a vehicular driver used the RGB sensor type TCS34725
as a luminance meter as it allows the possibility to adjust the data
acquisition rate, between very high or low rates the latter range of
obtaining is necessary for situations where there is little traffic or
partially uninhabited areas in order to reduce the amount of data.
(C.D. Galatanu, 2018)
Tests carried out showed that the structure of the system is suitable
for modifications to an image processing system capable of
controlling the quality of the seeds to be processed. It is concluded
that the cost, dimensions and final processing capacity of the system,
make it competent compared to other options currently existing in
the market, in addition to increasing productivity in the seed selection
process, since it translates into shorter production times and therefore
greater commercial gains. (Hermoza Llanos, 2018). According to
these authors, the electronic color interpretation system that is
intended to be realized is feasible and has tools that are within reach
such as, for example, the RGB sensor TCS3472, microcontrollers of
the ATMEGA series, etc. The communication between these devices
and the visualization through a physical graphic interface can be done
since, in the analyzed researches, the architecture used and the
programming algorithms used can be observed.
Methodology
The classifier system has an RGB sensor, a servomotor, a 7-segment
display to visualize the number of hits of the classifier, programming
algorithms to meet the main objective which is to classify objects
according to color. The RGB sensor is the main element of the system,
since it can be used to determine the color of the object, which is not
possible without the help of the code. By means of these, the
acquired data can be processed and functions can be sent to the
actuators to perform the classification procedure. These actuators are
the servomotors that direct the object to a specific place according to
the detected color. The visual interface is a 7-segment display that
shows the count of each classified object. The following figure shows
the architecture of the exposed process.
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
48
Figure 1
Block diagram of operation
Test objects
Figure 2
RGB color sensor
The bodies selected for sorting are made of wood, because of their
easy sizing to the main storage funnel, and the shape that future
research will entail. These, at the time of the tests, have a diameter of
2cm and a weight of 70gr covered with blue, green, yellow and red
acrylic paint. The importance of these wooden objects lies in the
similar and irregular shape of their surface, like a vegetable. And their
color, which will inevitably change due to natural aging. These color
effects are visible over time and not necessarily at the time of
experimentation.
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
49
The color of a surface is described by a color composition: red, green
and blue. Thus, in a colored image each pixel is represented by a
certain value of these components. In the RGB color space, the pixel
p (i) is defined by an ordered triplet of red, green and blue
coordinates (r(i), g(i), b(i)), representing the red, green and blue light
intensities respectively. The intensity value varies from 0 to 255. (A.
Kanade, 2015)
Table 1.
Color analysis
Color
(nm)
Colors
analogs
(nm)
Color type
Blue
436-495
Blue
Turquoise
Blue
Violaceous
489.04
380-
500
Monochromati
c
Red
620-700
Red
Orange
600-
500
Monochromati
c
Green
495-570
Green
Blue
Yellow
Greenish
555-
574
Monochromati
c
Yellow
566-589
Orange
592-
620
Monochromati
c
RGB sensorization
This device has the ability to provide a digital RGB return from its
incident light in a sharp and accurate manner. Thanks to its integrated
infrared filter in the photodiodes along with its high sensitivity,
dynamic range place it as an ideal color sensor solution for use under
lighting conditions and through attenuating materials. (TAOS, 2012)
Figure 3.
RGB color sensor
The data taken by the RGB sensor are sent to the processing board,
where through the Arduino IDE the data will be processed to calibrate
the sensor, control the speed of the servomotor and count the sorted
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
50
objects. It is necessary to carefully set the speed at which to work and
install the necessary libraries to avoid problems in the execution of
the program.
These algorithms are created through a flow chart shown in the
methodology section. The importance of the algorithms is due to the
fact that, the classification process will be performed correctly and
through tests it will be possible to reduce the margin of error, if any.
The servomotors will be in charge of routing the route with the specific
angle to where the classified sphere should arrive according to its
color, the programming plays an important role in this stage since it
will be the physical basis of the classification.
Through the use of 7-segment displays, the number of objects that
have been sorted can be visualized. These are placed with labels to
identify which color corresponds to a certain quantity.
Mathematical model
The parameters taken into account to describe the color are:
L: brightness
a: Red/green coordinates where +a indicates red and -a
indicates green.
b: Yellow/blue coordinates in which +b indicates yellow and -
b indicates blue.
c: represents the chroma key.
h: corresponds to the hue defined as an angle (in degrees) on
the color wheel.
Once the color data is obtained, it is compared with other samples to
evaluate their differences (Ruíz Martinez, 2002). (Ruíz Martinez, 2002).
If these differences are called !", !#, y !$for the axes L, a and b
respectively, the total distance between two colors is given by !
whose formula is:
(1)
With the data acquired from the RGB sensors, it is divided for 255 in
order to have values in the range of 0 to 1 as shown below.
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
51
(2)
(3)
(4)
With this data, the pitch is calculated with the following formula:
(5)
The brightness is calculated depending on the luminosity:
(6)
Where:
S: saturation.
!total color differential
L: Luminosity.
For the calculation of the percentage error, a standard statistical
formula is used in which the actual value and the approximate value
are used:
F%
'
(
!"#$
)(
%&'(
'
(
!"#$
6B33G
(7)
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
52
System development
Principle of operation
Figure 4
Control Program
In this way, the principle of operation of the system is represented.
Thus, the sphere enters the upper part of the structure through a
circular duct of 2.3cm in diameter until it reaches the TSC34725
sensor. This is in charge of measuring the frequency of the visible
spectrum, determining its color. If there is a problem such as external
light leakage inside the cavity, the system will not work properly and
will show values not established in the programming, i.e. an alert.
Therefore, the user must re-enter the object to be classified and verify
that there is no filtration of ambient light inside the mechanism. If the
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
53
measurement made by the sensor is within the programmed
parameters, the sphere will move to the classification stage. Here, the
servomotor will move within the four positions previously defined and
depending on the value provided by the sensor. Each one will be
taken to the containers according to its color. For this action a Me-
0634 detector sensor is provided, which allows the system to be
automatic, even if it has a manual mode.
Since the spheres are sized according to the design, possible
blockages are reduced. Even so, it could be the case that the servo
runs through the propeller prematurely, then it will be necessary to
intervene with an anti-jamming function. The second and third points
focus even more on the action of the RGB sensor TSC34725. This is
responsible for measuring the frequency of the visible spectrum by
extracting the color of the sphere. As the same can have external
variations such as light and ambient temperature, the system is
designed to cover and place the sensor on the basis of displacement
of the sphere to reduce to the minimum possible sudden changes.
Therefore, if it were to fail while controlling these parameters, a
complete module replacement would be necessary.
Finally, this point four focuses on the mechanical part of the system,
which includes the servomotors, may have failures either
programming, physical and electrical, these should be corrected first
by programming, if this process does not work, the status and
operation of the servomotors should be verified.
Table 2.
Main components of the system
Hardware
Reason for selection
Sensor
TCS34725
It has an activatable IR signal
filter.
ATMega 328P
High performance, low
power consumption and
optimized for C compilers.
HiTec
Servomotor
Load handling up to 4Kg
7-segment
display
Efficiency and
implementation
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
54
Potentiometer
50k𝛺
For adjusting the current
flow.
Figure 5
Electronic structure of the system
The electronic boards define the communication structure of the
classification system by stages. In this way the logic stage, contains
the programming code (algorithms) that allow the proper operation
on control parameters that exerts on the physical components, i.e.
servos, mechanical stage that according to the sensor data locates the
objects (spheres) in the place established in the structure, in angle and
time.
Figure 6
Electronic control circuit and serial connection
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
55
Figure 7
Control and display panel circuit.
After the electrical communication tests on the breadboard, the
printed circuit boards are designed. These provide stability and
reliability to the control and data visualization system, since the
movement to which it is exposed by the servomotors can directly
affect the connection and its collateral effects.
Source code and programming
The systematization of the sensor, the processing of the data obtained
by it and the configuration of the selector mechanism is performed on
a programmable Arduino Nano board, with the use of the
Adafruit_TCS34725 library for the interpretation of the recorded
values.
First, the necessary libraries are included according to the chosen
sensor, this is done from the IDE library. Then, we proceed to declare
the variables for the counting of red, yellow and green spheres,
additionally we create a buffer where the counting of the spheres is
stored to send them by serial communication to the displays.
At this point, the variables in which the hit count of classified spheres
will be stored and a buffer for displaying the hits on the screen are
established.
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
56
Number of occurrences or events
Then the pins to which the modules will be connected are declared,
which consist of LEDs for the start and end of the process, as well as
the button that allows the system to start.
Table 4.
External Actions
At this stage the code that is executed once (void setup) is set. It is
usually set to mark general operating parameters such as module
startup and preconfigurations. There may be more stages of the same
type called functions.
Counting variables
int countR=0;
int countN=0;
int accountG=0;
int accountA=0;
byte buf[4];
Control Outputs
const int led_start=3;
const int ledSensor=4;
const int led_pare=5;
const int
buttonStart=6;
const int enced;
serovo=13;
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
57
Now, for the motion control, the pins for the servomotors are
assigned, in this case the pins (7 and 8) for PWM outputs will be used.
Afterwards, the Arduino serial communication is declared at the 9600
bits per second (baud rate) required for the microcontroller.
Table 5
. Position Control
In the "void setup" the programming that does not depend on
repetitions is established, that is to say that they will be executed only
once. A clear example is when the operation range is defined for each
frequency (color), from there it is calculated for all those used (red,
green, blue and yellow) which in turn will be stored in a buffer
parameter (buff) the number that will be recorded. If one of the
conditions is not met, the counter will return its previous value, i.e.
unchanged, this is because it can represent values with variation due
to external changes such as ambient brightness. In case of errors, the
hexadecimal code is printed in the serial monitor, besides serving as
an aid to verify that it is working correctly.
In this part, you set the limits of the data obtained from the sensor
that the algorithm accepts to describe the color. If one of the
conditions is not met, the counter will return the last correct value. If
the received data is outside the parameters, the received value is
printed on the Arduino IDE serial monitor.
Table 6.
Color detection
Servo control
topServo.attach(7);
bottomServo.attach(8);
Serial.begin(9600);
Color ranges
if((r < 2.15) & (r > 1.8) & (g < 0.75)&(g > 0.45)){
color = 1; // Red
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
58
buf[0]=1+countR++;
cont=0;
}
if((g < 1.4) & (g > 1) & (b < 0.6)&(b > 0.35)){
color = 2; // Yellow
buf[1]=1+countN++;
cont=0;
}
if((r < 1.15) && (g > 1.20) && (b < 0.8)){
color = 3; // Green
buf[2]=1+countG++;
cont=0;
}
if ((r < 1) && (g < 1.2) && (b > 1)){
color = 4; // Blue
buf[3]=1+countB++;
cont=0;
}
else{
cont++;
if(cont==5){
/*buf[0]=accountR++;
buf[1]=countN++;
buf[2]=G++ account;
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
59
In this stage, functions are created and executed in loops depending
on the data obtained from the sensors. It starts with the analog and
digital readings from the RGB sensor and the power button,
respectively. An anti-bounce function is created so that the state of
the button remains stored applying a delay of 20 milliseconds, this
allows that when the button is pressed, only one state remains stored
and not the other states that are presented at the moment of short-
circuiting positive and negative with the button.
After the previous function we proceed to perform an 'if' conditional
where it is indicated if the status of the button is 1 or if the infrared
LED detects a sphere, the main function called "main_system" will be
executed, otherwise the function "OFF" will be executed. When using
a push-button, an anti-bounce function must be performed in the
code since the residual currents generated when pressing it can send
wrong values to the board, this function provides a 20ms delay that
allows saving only one value at the moment of pressing the push-
button.
buf[3]=countB++;*/
output=0;
cont=0;
}
}
Serial.write(0xff);
for(int i=0;i<sizeof(buf);i++){
Serial.write(buf[i]);
delay(2);
}
return color;
}
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
60
Table 7.
Off Control
Shutdown Control
void loop() {
ReadBall=analogRead(DetecBall);
status=digitalRead(startButton);
//ANTI-REBOUND FUNCTION
if(status==HIGH && statusPrevious==LOW){
output=1-output;
delay(20);
}
statePrevious=status;
if(output==1||ReadBall<7){
systemPrincipal();
}else{
shutdown();
}
}
Table 8.
Color libraries
Acquisition of sensor
readings
Description
ReadBall=analogRead(De
tecBall);
Take readings
from the sensor
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
61
connected to
analog pin A1.
Servo movement
Description
digitalWrite(encedico_ser
ovo, HIGH);
Controls the
section that
transports the
sphere to one of
the containers.
Sensor data storage
Description
tcs.getRawData(&red,
&green, &blue, &clearcol);
Stores the RGB
spectrum data in
the assigned
variables for
further
processing.
Table 9.
HTML color analysis
HTML
#7828
RGB (r,g,b) B
(120, 40, 140)
CMYK(c,m,y,k)C
(70, 100, 0)
HSV (h, s, v)
(288H, 71%, 55%)
Violet: between 420 and 400 nm wavelength. Attenuated violet:
between 400 and 380 nm, it constitutes a band with a double
connotation, because on the one hand it is considered as part of the
visible violet light and on the other hand it is part of the ultraviolet
radiation (UV). Visible ultraviolet light: between 380 and 310nm.
Although by definition UV radiation is not visible, a part of this
radiation is called UVA or near ultraviolet.
The instrument (colorimeter) is composed of two devices: the control
and sorting device. The first, composed of controls that allow the
system to activate, pause, restart, accelerate or stop its operation. The
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
62
second has a section for transporting, sensing, transporting and
locating.
Figure. 5
3D CAD control
Table 10.
Elements and symbology
Element and function in the system
1
7-segment display: counters
2
Green Led: Indicates that it is working
3
Red Led: Indicates that it is stopped
4
Button: Starts the system
5
Button: Pauses the system
6
Button: Resets the system
7
Potentiometer: Accelerates or slows down
speed
8
Button: Emergency
9
Red Led: ON = emergency; OFF = normal
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
63
Figure. 6
Control and visualization implementation
The transport section, designed specifically for the test objects and
their dimensions, carries the spheres to the duct in which the digital
sensor is located. Under these placement conditions, the component
extracts the colors of each of the objects arranged in the chute as they
arrive. When the color is known, the servomotor locates them at the
correct angle in their respective repository, and in parallel sends a
signal to the optoelectronic devices for counting and numerical
display.
Results
The group of non-degraded color tests chosen, allows us to establish
the degree of efficiency in the specific detection of the solid colors of
a wide gamma that it is understood would be detected. In the end,
this allows us to know if the system composed mainly by the sensor
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
64
based on the criteria of sensitivity and luminosity configuration, as
well as its location, are acceptable for this type of process. For this,
three primary colors and a secondary one are chosen, which will allow
us to know the number of hits in the detection of these essential
colors.
On the number of tests (1089 per sphere) separated in ranges of 99
consecutive repetitions for each one. And, taking into account the
effectiveness of the sensor that is given by the saturation and
luminance of the object, as well as the configuration divided into three
stages, with percentages of tone in the saturation and luminance of
50%, 75%, 100%, obtaining the following:
The unforeseen initial conditions between 0 and 50% allow us to
perform a test with error reduction and adequate illumination and
saturation conditions.
Table 6.
Hit and Miss T1 (50%)
Samples
Colors
Hits
Saturat
ion
Brightness
Error
1089
Blue
101
6
50%
50%
0,060%
Green
103
5
0,049%
Yellow
102
3
0,060%
Red
100
9
0,073%
Total
408
3
Total
0,242
%
In all the events, the saturation and luminosity are maintained. And
from this, a total of 273 failures are obtained divided into 73 for the
blue color with an error percentage of 0.060%, 54 for the green color
with an error of 0.064%, 66 for the yellow color with a percentage
error of 0.066% and 80 failures for the red color with an error
percentage of 0.073%.
Table 7.
Hit and Miss T2 (75%)
Samples
Colors
Hits
Saturation
Brightness
Error
1089
Blue
1031
75%
75%
0,053%
Green
1024
0,059%
Yellow
1036
0,048%
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
65
Red
1031
0,053%
Total
4119
Total
0,213%
In all the insertions the system maintains the saturation and luminosity
stable with the parameter set to 75% and this results in a total of 4119
hits and 237 misses divided into 58 for the blue color, with a
percentage error of 0.053%, 65 for the green color with an error of
0.059%, 53 for the yellow color with a percentage error of 0.048% and
61 misses for the red color with an error percentage of 0.053%.
Table 8.
Hit and Miss T3 (100%)
Samples
Colors
Hits
Saturation
Brightness
Error
1089
Blue
1071
100%
100%
0,016%
Green
1054
0,032%
Yellow
1066
0,021%
Red
1067
0,020%
Total
4258
Total
0,089%
Stabilizing the brightness and saturation to 100%, the system shows
no variation in this factor, and from this we obtain a total of 98 failures
divided into 18 for the blue color, with an error percentage of 0.016%,
35 for the green color with an error of 0.032%, 23 for the yellow color
with a percentage error of 0.021% and 22 failures for the red color
with an error percentage of 0.020%.
Figure. 7
Efficiency increase
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
66
Figure. 8
Error Decrement
Figure. 9
3D CAD classifier
Color Yellow
Series 1, limited to 50% sensitivity and luminosity, detects 1023 blue
spheres out of a total of 1089 tests of this color on the sphere. That
is, a difference of 66 misses corresponding to only 6.1% error in the
expected sensing, which, on the contrary, shows 93.9% effectiveness
in its determination (efficiency).
Series 2, defined at 75% sensitivity and brightness, detected 1036
blue spheres out of a total of 1089 tests of this color on the sphere.
On the other hand, there were 53 misses, which corresponds to 4.9%
of failures in detection, with 95.1% of effectiveness in detection.
Series 3, established at 100% sensitivity and luminosity, detected
1066 blue spheres out of a total of 1089 tests of this color on the
sphere. That, in its defect presents 23 errors that correspond to only
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
67
2.1% of error in its discovery; with a 97.9% of effectiveness in its
detection.
Color Blue
Series 1, limited to 50% sensitivity and brightness, detects 1016 blue
spheres out of a total of 1089 tests of this color on the sphere. That
is, a difference of 73 misses corresponding to only 6.7% error in the
expected sensing, which, on the contrary, shows 93.3% effectiveness
in its determination (efficiency).
Series 2, defined at 75% sensitivity and brightness, detected 1031
blue spheres out of a total of 1089 tests of this color on the sphere.
On the other hand, there were 58 misses, which corresponds to 5.3%
of failures in detection, with 94.7% of effectiveness in detection.
Series 3, established at 100% sensitivity and luminosity, detected
1071 blue spheres out of a total of 1089 tests of this color on the
sphere. That, in its defect presents 18 errors that correspond to only
1.65% of error in its discovery; with a 95.1% of effectiveness in its
detection.
At the end of the test series 1 with an intensified sensitivity and
brightness from 50% to 100% shows an increase of 5.1% in the
detection of the number of blue spheres, i.e. 55 additional spheres
with an equal and inversely proportional reduction of the error.
Color Red
Series 1, limited to 50% sensitivity and brightness, detects 1009 blue
spheres out of a total of 1089 tests of this color on the sphere. That
is, a difference of 80 misses corresponding to only 7.3% error in the
expected sensing, which, on the contrary, shows 93.3% effectiveness
in its determination (efficiency).
Series 2, defined at 75% sensitivity and brightness, detected 1031
blue spheres out of a total of 1089 tests of this color on the sphere.
On the other hand, there were 58 misses, which corresponds to 5.3%
of failures in detection, with 94.7% of effectiveness in detection.
Series 3, established at 100% sensitivity and luminosity, detected
1067 blue spheres out of a total of 1089 tests of this color on the
sphere. That, in its defect presents 22 errors that correspond to only
2% of error in its discovery; with a 98% of effectiveness in its detection.
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
68
Color Green
Series 1, limited to 50% sensitivity and brightness, detects 1035 green
spheres out of a total of 1089 tests of this color on the sphere. That
is, a difference of 54 misses corresponding to only 4.9% error in the
expected sensing, which, on the contrary, shows 95.1% effectiveness
in its determination (efficiency).
Series 2, defined at 75% sensitivity and brightness, detected 1024
green spheres out of a total of 1089 tests of this color on the sphere.
On the other hand, there were 65 misses, which corresponds to 5.9%
of failures in its detection, with 94.1% of effectiveness in its detection.
Series 3, established at 100% sensitivity and luminosity, detected
1054 green spheres out of a total of 1089 tests of this color on the
sphere. That, in its defect presents 35 misses that correspond to only
3.2% of error in its discovery; with a 96.8% of effectiveness in its
detection.
Testing of the classification system
Figure 10
Complete sorting device
The classifier system contemplates a sequential scheme where there
is a point of entry of the spheres, then it is directed with an actuator
to the TCS3472 sensor, this is responsible for determining based on
algorithms a correct decision (code), determining the position of the
servo in the following degrees (red 58°, yellow 92°, green 134° and
blue 175°), at the end the sphere descends to be placed on the base
of which were presented f, as follows:
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
69
The spheres, by complying with regular proportions and in
accordance with the design of the structure, did not present
inconveniences as expected in the circuit of travel of this one, giving
an optimal work flow for the operation tests in the first 152 samples.
To guarantee a better result, a stopper was added in the ejection zone
so that it does not hit the surface of the base and consequently there
is no greater wear on the paint.
In test sequence 153, the sorter jammed, requiring the emergency
button to be pressed to bring the prototype to a complete stop. This
behavior was repeated in a subsequent range of 130 to 160 runs on
the mechanism.
When running the 752 test, the classifier suffered the jamming of a
green sphere, being necessary to press the emergency button to stop
the mechanism, however, it got stuck in its cavity, so it was necessary
to restart the system and disconnect the power of the prototype to
unjam the button.
Conclusions
The use of the sensor itself, the white LED, helped to avoid the
principle of color saturation, which supports the principle of
luminosity, which contributed to the fact that by bouncing the light
from it on the sphere, the real wavelength value of the color used on
it can be obtained. At the end of the test series 1 with an intensified
sensitivity and luminosity from 50% to 100% presents an increase of
5.1% in the detection of the number of blue spheres, i.e. 55 additional
ones with an equal and inversely proportional reduction of the error.
At the end of the test series 2 with an intensified sensitivity and
luminosity from 50% to 100%, there was an increase of 1.7% in the
detection of the number of green spheres, i.e. 19 additional spheres,
with an equal and inversely proportional reduction of the error. At the
end of the test series 3 with an intensified sensitivity and luminosity
from 50% to 100%, there was an increase of 3.9% in the detection of
the number of blue spheres, i.e. 19 additional spheres with an equal
and inversely proportional reduction of the error.
At the end of the test series 4 with a sensitivity and luminosity
intensified from 50% to 100% presents an increase of 5.3% in the
detection of the number of blue spheres, i.e. 58 additional spheres
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
70
with an equal and inversely proportional reduction of the error. The
tests performed were able to determine that the higher the
percentage of hue, saturation and luminosity, the greater the number
of spheres classified. With a percentage of 100 % in each of the above
mentioned parameters, the error could be reduced from 6.26 % to
2.27 % with respect to the average error among all colors.
The saturation of the spherical object was an important factor in the
classification. The blue color is greatly affected by this parameter,
since at first it had an incidence of error equal to 6.70 % with
saturation equal to 50 %, which could be reduced to 1.74 % with a
saturation of 100 %. The mechanical prototype, although it works
properly in 96%, since it has only two displays for each color to count
the number of hits, it does not allow to display more than 99 tests with
positive results continuously for each one before having to restart the
system.
When the emergency button got stuck and the system was
continuously restarted, it was determined that the cavity that houses
it is narrower on the inner edge due to a fault in the construction of
the container, making it necessary to replace it with a switch that
provides more safety in its operation because the mechanism does
not interact with the structure that contains it.
Reference
Ruíz Martinez, J. (2002). Fisica Y Quimica. Profesores de Enseñanza
Secundaria. Murica: MAD-Eduforma.
Filote Razo, J. D. (2016). RGB sensor to detect color changes in fruit
skin. Acta Universitaria, 7.
Ohno, Y. (2000). CIE fundamentals for color measurements. Society
for Imaging Science and Technology, 2000, 540--545.
Serrano Tierz, A., & Biel Ibáñez, M. P. (2013). Aesthetics of the
industrial product and its graphic representation. Zaragoza:
Presses of the University of Zaragoza.
Sarria-Dussán, S., Garzón-García, A. M., & Melo-Sevilla, R. E. (2020).
Development and evaluation of a prototype for color
RGB free colorimeter for sensing and sorting of pigmented spheres
Revista Científica Interdisciplinaria Investigación y Saberes , / 2023/ , Vol. 13, No. 3
71
measurement in fresh vegetables. Information Technology, 253-
260.
Hermoza Llanos, E. A. (2018). Design of a peeled sacha inchi seed
sorting machine by color with a capacity of 200 kg/h.
Dissertation. Pontificia Universidad Católica del Perú, Lima.
A. Kanade, A. S. (2015). Development of Machine Vision based system
for classification of Guava fruits on the basis of CIE1931
chromaticity coordinates. Symposium on Physics and
Technology of Sensors. Pune, India.
C.D. Galatanu, L. C. (2018). Measuring the driver exposure to the light
pollution. IEEE International Conference on Environment and
Electrical Engineering and 2018 IEEE Industrial and Commercial
Power Systems Europe (EEEIC / I&CPS Europe). Palermo, Italy.
TAOS (2012).
Morimoto (2018). An Object Recognition Method using RGB-D
Sensor. Second IAPR Asian Conference on Pattern Recognition.
Himeji, Japan.