Home » , , , » Design & Implementation of Color Sensor

Design & Implementation of Color Sensor

Presentation on Design & Implementation of Color Sensor.

Introduction
Light is a physical phenomenon.When the components of light are absorbed or transmitted in different proportions by an object, color occurs. The color of an object is apparent only when light strikes the object. For color to be perceived, the viewer must have blue, green, and red receptors. Depending upon its chemical make-up, matter has the ability to absorb, reflect or transmit visible light.
When all the components of visible light are absorbed by matter, the object is said to be black.On the other hand, if all the components of visible light are reflected or transmitted by the object, the object is considered white or clear. The visible light spectrum is a small part of the electro-magnetic spectrum. The visible spectrum has a wavelength range of about 380 to 740 nm. Human eye can perceived only the visible light.
Wavelength & frequency interval of different colors

Color Name
Wavelength Interval
nm
Frequency Interval
THz
Violet
380-450
668-789
Blue
450-495
606-668
Green
495-570
526-606
Yellow
570-590
508-526
Orange
590-620
484-508
Red
620-750
400-484
Objectives

The main objective of our project is to detect the color of an object. Our target is to detect ten colors.The target colors are Black, Green, Red, Blue, Yellow, Magenta, Yellow-lemon,Pink,
Gray, White.
To relate color system wherein color purity and mixings is identified perfectly and is independent of human observations or subjective judgments.
Possible Outcome

To detect the color of an object with high precision even under varying environment conditions, such as fluctuations in the ambient temperature or variations of incidence light on the object to be measured.
Experimental Design

A color sensor includes a light receiving element for receiving the light from an object(target) illuminated by the lights from the light emitting sources and a circuit arrangement for producing output signals representing the color of the object.
Experimental Design

Design & Implementation of Color Sensor
Op-amp

The op-amp is basically a differential amplifier having a large voltage gain, very high input impedance and low output impedance. Most of the time operational amplifiers are used to compare voltages of unequal magnitudes. They are called ``operational'' amplifiers, because they can be used to perform arithmetic operations (addition, subtraction, multiplication) with signals.
Op-amp Circuit Notation

Op-amp
V + : non-inverting input
V- : inverting input
Vout : output
Vs+: positive power supply
Vs-: negative power supply
Pin Connection of LM741

Pin Connection of LM741
Analog-to-digital converter (ADC)

An analog-to-digital converter (A/D) takes an analog voltage or current and after a certain amount of time it produces a digital output code that represents the analog input.
Simply, an analog-to-digital converter is a device which converts continuous signals to discrete digital numbers.

General Block Diagram (ADC)

General Block Diagram (ADC)

Pin diagram & free running connection

Pin diagram & free running connection
Pin diagram of ADC0804

Pin diagram of ADC0804
Free running connection

Microcontroller

Microcontroller is a programmable integrated circuit which contains Processor, memory and input/output functions in a single chip. It is a microprocessor emphasizing high integration. In contrast to a general-purpose microprocessor, the microcontroller integrates additional elements such as read write memory for data storage, read-only memory for program storage, EEPROM for permanent data storage, peripheral devices, and input/output interfaces.
Pin diagram (PIC16F84A)

Pin diagram (PIC16F84A)
Pin function

Pin diagram (PIC16F84A)
Circuit Diagram

Color Sensor circuit diagram

Color Sensor circuit diagram
Program

TRISA = 0
TRISB = 255
Dim a As Byte
PORTA = 0
WaitMs 10
main:
PORTA = 0
a = PORTB
If a < 11 Then PORTA = 1 '//Black
If a > 6 Then
If a < 27 Then PORTA = 2 '//Blue
Endif
If a > 26 Then
If a < 31 Then PORTA = 3 '//green
Endif
If a > 39 Then
If a < 44 Then PORTA = 4 ''// Pink
Endif
If a > 44 Then
If a < 50 Then PORTA = 5 '//Red
Endif
If a > 49 Then
If a < 57 Then PORTA = 6 '//Megenta
Endif
If a > 56 Then
If a < 63 Then PORTA = 7 '// White
Endif
If a > 64 Then
If a < 73 Then PORTA = 8 '//Yellow
Endif
If a > 89 Then
If a < 93 Then PORTA = 9 '//Gray
Endif
If a > 92 Then
If a < 96 Then PORTA = 10 '//Yel+lem
WaitMs 200
Goto main
Result

Our project is designed for detection of ten colors. But we have detected eight colors successfully. The detected eight colors are red, green, yellow, yellow-lemon, pink, gray, black & white.
Error

We can’t detect two colors. The colors are blue & magenta. This two colors are overlapped with green & red.
Limitation
  1. The major limitation of our project is that it can’t detect the object which contains number of colors.
  2. One limitation of this project is that it can’t display the color name. But it is possible to display the color name with the help of LCD display by proper programming.
  3. Our blue sensor can’t work properly. So we can’t detect the blue color as well as other color.
  4. We can’t filter the color perfectly.

Future study & improvement

  1. To display the detected color name.
  2. To increase the number of detected color.
  3. To detect number of colors even exist as a narrow strip within the object.
  4. Sort objects by color
Reference
  1. “Digital Systems Principles and Applications” By, Ronald J. Tocci, Neal S. Widmer & Gregory L. Moss
  2. “Digital Logic and Computer Design” By, M. Morris Mano
  3. “Operational Amplifiers and Linear Integrated Circuits” , Sixth edition By, Robert F. Coughlin and Frederick F. Driscoll
Submitted By Anup Kumar Das and Prashanta Kumer Sarker
Share this article :