Professional Documents
Culture Documents
Automated Color Sensor System Using LDR and RGB Leds Controlled by Arduino
Automated Color Sensor System Using LDR and RGB Leds Controlled by Arduino
Automated Color Sensor System Using LDR and RGB Leds Controlled by Arduino
www.arpnjournals.com
ABSTRACT
Color sensor systems evolved and reached a high level of technologies in detecting several colors, mostly in
robotics. Many factors can affect the success of this device like efficiency. It is so important when you are looking for
accurate results but it could fail if the cost is high. The purpose of this project is to create a color sensor system that has the
good efficiency and low cost. The system is made to detect ten different colors and differentiate between them. It has been
implemented as a breadboard using LEDs, an LDR, Op Amps and an Arduino UNO. This paper will be explaining the
components, working principle, connections, calculations, results and the errors. The motivation of this project is the
ongoing research in many parts of the world to alleviate color blindness [1, 3, 7, and 8]. Although this project might not be
directly applicable to human retina but it can be integrated with robots and automotive industries.
5532
VOL. 12, NO. 19, OCTOBER 2017 ISSN 1819-6608
ARPN Journal of Engineering and Applied Sciences
©2006-2017 Asian Research Publishing Network (ARPN). All rights reserved.
www.arpnjournals.com
C. Components
There are different types of electronic equipment
that can be used as color sensors. Electronic components
like LDRs and phototransistors detect light by changing
their behavior based on the intensity reflected on them. In
this project LEDs and LDRs are being used as the main
components of the color sensor. The central processing
unit is Arduino Uno displaying the results on a LCD.
PROCEDURE IDENTIFICATION
Figure-2. The relation between intensity and
Sensor working principle resistance in LDR.
The LDR exhibits photoconductivity and changes
its resistance depending on the light intensity falling on it. The Light from the LED is reflected by an object
The resistance of the LDR increases when the intensity of to the LDR. The black rectangle in Figure-3 represents a
the light decreases. For each object whose color is to be barrier to insure the light is the reflected one, not from the
detected, the three colored LEDs (red, green and blue LED directly.
lights) are turned on sequentially and data is recorded by
the LDR simultaneously. For example, during a scan of a
red object, each LED is shining on the object which causes
the reflected light from the object to fall on the LDR, and
it is known that a red object will tend to reflect all the red
light falling upon it while it absorbs the green and blue
lights as shown in Figure-1. In such situation, minimal
light intensity from the green and blue LEDs is reflected to
the LDR, while a maximum light intensity is reflected
from the red LED. Hence the LDR will have a larger
resistance for the green and blue light scanning, while it
has a minimum resistance for red light scanning.
5533
VOL. 12, NO. 19, OCTOBER 2017 ISSN 1819-6608
ARPN Journal of Engineering and Applied Sciences
©2006-2017 Asian Research Publishing Network (ARPN). All rights reserved.
www.arpnjournals.com
surface then it will have less voltage on that LED timing. DC circuit changes the variation due to the slight changes
For example, if the object is red, the red LED will have that can occur.
less voltage than the blue and green when it is on. Starting with the range that is already available,
If the object color is orange, the voltage will measuring the values to find out the highest and the
decrease in the same rate but slightly different from the smallest value would help know the exact amount for the
Red surface as in the Table-1 below. range increase. Subtracting the LDR values from the
range, which is from 4.65 – 4.95, we end up with a range
Table-1. RGB values for red, Green and Blue in between 0 and 0.3
surfaces in volts. 4.65 - 4.65 = 0
4.95 – 4.65 = 0.3
Having a range from 0 - 0.3, is really small for a
variety of 10 colors, an amplifier was used to increase this
range and make the maximum reach up to 4.8 V. The
maximum was chosen to prevent any error that can happen
in the circuit, such error can amplify the voltage over 5 V
which can cause the Arduino to malfunction. Using an
amplifier with gain = 16 was the solution to increase the
range from 0 - 0.3 to 0 - 4.8 and therefore help reduce the
probability of error that can happen.
When designing the circuit with the subtractor
and the amplifier, the drop voltage should be exactly equal
to 4.65 V, therefore, a voltage follower with a variable
The results shows that the difference in voltage is resistor was used to be able to get the most accurate drop
too small for all the 10 colors shown in Table-2 below, voltage needed. An amplifier was used to amplify the
and so an increase in the difference between the voltage’s current as the source used is 12 V, and because all the
values should be done, this amplification is done using OP amplifiers had to get that 12 V, another amplifier at the
AMPs. end needed to be added to get the current needed.
Table-2. RGB values for the rest of the colors in volts. b) Designing circuit segments
(1)
(2)
5534
VOL. 12, NO. 19, OCTOBER 2017 ISSN 1819-6608
ARPN Journal of Engineering and Applied Sciences
©2006-2017 Asian Research Publishing Network (ARPN). All rights reserved.
www.arpnjournals.com
The LCD is connected to show the results as The full circuit of the system must be finished as
color’s names.In case of no LCD, a connected computer to shown in Figure-6. The Amplification circuit is connected
Arduino will be needed. With the LCD, the system is to A0 pin in Arduino Uno. The LEDs system is connected
independent[10]. to Pin 11,12 and 13. Finally, the LCD is connected to Pin
2 to 7 in the Arduino.
5535
VOL. 12, NO. 19, OCTOBER 2017 ISSN 1819-6608
ARPN Journal of Engineering and Applied Sciences
©2006-2017 Asian Research Publishing Network (ARPN). All rights reserved.
www.arpnjournals.com
CONCLUSIONS
The idea of the research is to create a color sensor
with the lowest cost. Rigrious randon test were carried out
and the system produced a very high success rate with a
small percentage of error. As shown in Figure [13] above,
there are errors equal to 10%. This error can be reduced in
two ways, by improving the physical design of the system,
Figure-7 below is showing how the system is and brighter LEDs. Certainly, this improvement will be if
printing the number of the color on 7 segment display implemented will make the system much precise. The
since LCD was not available. The system was able to amplification circuit may not be needed if the LDR was
detect the color and could display the corresponding hex getting better intensity. This idea can be incorporated in
code.The total cost to design this project was around 15 home robots like the self cleaning vaccum machine, in
USD This could be developed as the low cost sensing factories to sort color merchandise (cloth, toys, electronic
system. prodcuts) depending on the colors and the application to
these could be many.
REFERENCES
5536
VOL. 12, NO. 19, OCTOBER 2017 ISSN 1819-6608
ARPN Journal of Engineering and Applied Sciences
©2006-2017 Asian Research Publishing Network (ARPN). All rights reserved.
www.arpnjournals.com
[6] Photoresistor(n.d.)[Online].Available:https://en.wikip
edia.org/wiki/Photoresistor.
[11] Colour(n.d.)
[Online].Available:https://en.wikipedia.org/wiki/Colo
ur.
5537