application of color sensor in an automated system-norfazlinda daud-tj211.35.n67 2007

28
TECHNICAL UNIVERSITY MALAYSIA, MELAKA APPLICATION OF COLORS SENSOR IN AN AUTOMATED SYSTEM Thesis submitted in accordance with the requirement of the Technical University Malaysia Melaka for Degree of Bachelor of Manufacturing Engineering (Robotic and Automation) By Norfazlinda Binti Daud Faculty of Manufacturing Engineering May 2007

Upload: teptep-gonzales

Post on 13-Jul-2016

4 views

Category:

Documents


0 download

DESCRIPTION

sadascxsacascas

TRANSCRIPT

TECHNICAL UNIVERSITY MALAYSIA, MELAKA

APPLICATION OF COLORS SENSOR IN AN

AUTOMATED SYSTEM

Thesis submitted in accordance with the requirement of the Technical

University Malaysia Melaka for Degree of Bachelor of Manufacturing

Engineering (Robotic and Automation)

By

Norfazlinda Binti Daud

Faculty of Manufacturing Engineering

May 2007

ABSTRACT

Sensor provides a means for gathering information on manufacturing

operations and processes being performed. In many instances sensors are used to

transform a physical stimulus into an electrical signal that may be analyzed by the

manufacturing system and used for making decisions about the operations being

conducted. The purpose of sensors is to inspect work in progress, to monitor the

work-in-progress interface with the manufacturing equipment, and to allow self-

monitoring of manufacturing by the manufacturing system’s own computer. Color

sensors register items by contrast, true color, or translucent index. True color sensors

are based on one of the color models, most commonly the RGB model (red, green,

blue). A large percentage of the visible spectrum can be created using these three

primary colors. Many color sensors are able to detect more than one color for

multiple color sorting applications. Depending on the sophistication of the sensor, it

can be programmed to recognize only one color, or multiple color types or shades for

sorting operations. Through this report, the color identification, the basic color theory

and the applications of color sensor will be review. In this report will be focusing on

the application of color sensor using conveyor system for sorting RGB color.

i

ABSTRAK

Sensor merupakan suatu alat untuk mengumpul maklumat untuk operasi

pembuatan dan proses yang sedang dijalankan. Kebanyakannya, sensor digunakan

untuk menukar stimulus fizikal kepada isyarat elektrik yang mana ia akan dianalisis

oleh sistem mekanikal dan akan digunakan untuk membuat keputusan mengenai

operasi yang sedang dijalankan. Tujuan sensor digunakan adalah untuk memastikan

sesuatu kerja dilakukan dengan betul. Selain itu sensor juga digunakan untuk

mengawal kerja-kerja antara muka dengan alatan pembuatan. Sensor juga

membenarkan sesuatu operasi di kawal dengan menggunakan Komputer. Sensor

warna merupakan sesuatu alat untuk mengesan warna. Ia terdiri daripada kontras,

unit warna asas atau index lut cahaya. Unit cahaya adalah terdiri daripada model

warna kebiasaannya ialah merah, biru dan hijau. Spektrum boleh dihasilkan dengan

peratus yang tinggi dengan menggunakan ketiga-tiga warna asal. Kebanyakan sensor

warna boleh mengesan lebih daripada satu warna untuk pelbagai jenis aplikasi warna.

Bergantung kepada kebolehan sensor, ia boleh di program untuk mengesan hanya

satu warna atau pelbagai jenis warna atau bentuk untuk operasi pengasingan. Melalui

laporan ini, identiti warna, teori asas warna dan aplikasi sensor warna akan

ditunjukkan. Laporan ini juga akan menumpukan kepada aplikasi mengenalpasti tiga

jenis warna asas iaitu merah, biru dan hijau dengan menggunakan sistem conveyor.

ii

CHAPTER 1

INTRODUCTION

1.1 Introduction To The Project

Industries today are approaching to use color sensor to fulfil their needs for a higher

production and precise quality. Historically, components used for color sensing were

considered expensive and required precision support circuitry, limiting their

application mostly to specialized instrumentation. However, new technologies of

color sensors with higher levels of integration are becoming available, allowing for

more cost-effective solutions. As the cost of color sensing comes down, the number

of applications using color sensing is increasing. Color sensors play a significant role

in end equipment such as color-monitor calibration, color printers and plotters,

paints, textiles, cosmetics manufacture and medical applications such as blood

diagnostics, urine analysis, and dental matching. The complexity of a color sensor

system is based largely on the number of wavelength bands, or signal channels, it

uses to determine color. Systems can range from a relatively simple three-channel

colorimeter to a multiband spectrometer.

In this project, an application is going to be developed using TCS230 Color Sensor

for detecting RGB color. The TCS230 has an array of photodetectors, each with

either a red, green, or blue filter, or no filter (clear). The filters of each color are

distributed evenly throughout the array to eliminate location bias among the colors.

The applications of this sensor include sorting by color, and color matching.

1

Certain matters shall be looked upon to complete this project. Information

concerning color sensor, their function, application and Basic Stamp programming

should be search through many ways such as internet, journals and books.

Information on how to program TCS230 Color Sensor must be learning in order to

program this application into reality.

The programming should be successful and information of this color sensor can be

useful to further understand their application. As a result of this, organization can use

this application for student, to use in their research, or studies especially those

majoring in Automation and Robotics.

1.2 Problem Statement

Machines can perform highly repetitive tasks better than humans. Worker fatigue on

assembly lines can result in reduced performance, and cause challenges in

maintaining product quality, an employee who has been performing a repetitive

inspection task may eventually fail to recognize a defective product. But automating

many of the tasks in the industries may helps to improve the productivity and product

quality. In other hand, the use of sensor technology will give the opportunity to the

industry to employ more automated processes.

In the past, traditional color sensor output only a ‘match/no match’ condition to the

machine controller. Most color sensed unlike other color sensors that can be

programmed to match only one to eight color. For example, some company try to use

single sensor type for sorting colors. It is desirable to be able to apply only one single

sensor type to identification and separation of all plastic resin types and colors. The

primary consideration is to apply the proper sensor, or sensors, to the specific

application in order to obtain the best available separation efficiency, with the highest

reliability, and at the least cost.

As many industries are looking forward to automate their production, it is difficult

for them to select the correct color sensor for their industries or organization as

2

recently has many types of color sensor. Most sensors are color blind although colors

play an increasingly important role in today's manufacturing and processing

procedures. Many sensors can distinguish between contrasts, light and dark and matte

and gloss. But when the detection of a specific color becomes the primary

requirement, the sensors find their limitations.

Thus, to relate with industry area, basic design of conveyor system will be construct,

then the conveyor system will be fabricate. The main important thing is to define

how the color sensor can read the color by using basic stamp program. In describing

this project to readers, description of the factors that could affect the performing of

this programming and the conveyor system are discussed.

1.3 Objectives, Aims and Scopes of the Project

Objectives

With the use of TCS230 Color Sensor, Basic Stamp programmer and BS2P

microcontroller, this project explores the possibility of creating a programming that

can sort RGB colors. In this project, the main objective is to create program that can

identify red, green and blue colors and fabricate a mechanical system for identify

RGB color by using a conveyor. The other objective also includes the understanding

of the application of color sensor in an automated system by related literatures

review.

1. Learning the basic stamp programming and its application also how it

functions.

2. Learning information concerning the TCS230 color sensor module.

3. Create the program that can identify RGB color by using basic stamp.

4. Understand the areas of color sensor application.

3

1.3.2 Aims

The aims of this project are to ensure that basic stamp has capabilities in

programming. Certain matter shall be given priority:

i). Understanding a new knowledge of programming, which can easily be

developed as it has be.

ii). Create the program that will show the TCS230 color sensor able to

detect RGB colors.

1.3.3 Scope of the Project

The scopes of this project are:

1. Design a system that can identify RGB color from an object

2. Fabricate the system using:

a. Parallax Board of Education (BOE) Module

b. TCS230 Color sensor

c. DC motor

d. Relay

e. Microcontroller

f. Conveyor structure

3. Create a program that can use to identify RGB color.

4. Run the programming system.

4

5

1.4 Gantt Chart for PSM 1

CONTENTS W1 W2 W3 W4 W5 W6 W7 W8 W9 W10 W11 W12 W13 W14 W15 W16

PROJECT SELECTION

SEM

EST

ER

BR

EA

K

INFORMATION SOURCING

MAKE LITERATURE REVIEW FROM RESEARCH DISCUSS ON SIMPLE PROJECT THAT USING COLOR SENSOR DRAFT THE OBJECTIVE AND INTRODUCTION OF COLOR SENSOR SEARCHING MATERIAL AND SELECT INSTRUMENT/TOOL THAT NEED TO BE USED IN THE PROJECT STUDY AND LEARNING ABOUT TCS230 COLOR SENSOR MODULE AND PROGRAMMING

DESIGN A CONVEYOR

START MAKE A DRAF REPORT

PREPARATION FOR FINAL DRAFT REPORT PREPARATION FOR POWER POINT SLIDE SEMINAR PRESENTATION AND REPORT SUBMISSION

Table 1.1: Gantt chart for PSM 1

6

1.5 Gantt Chart for PSM 2

CONTENTS W1 W2 W3 W4 W5 W6 W7 W8 W9 W10 W11 W12 W13 W14 W15 W16

START CREATE PROGRAMMING FOR SORT COLOR

SEM

EST

ER

BR

EA

K

FABRICATE THE CONVEYOR STRUCTURE FABRICATE THE CONVEYOR SYSTEM USING SELECTED PARTS

TEST RUN THE CONVEYOR SYSTEM

TEST RUN THE CONVEYOR SYSTEM WITH TCS230 COLOR SENSOR RUN THE SYSTEM WITH THE SUCCESSFUL COLOR SORT PROGRAM COLLECTS THE DATA RESULT AND CONCLUSION. PREPARATION FOR FINAL PSM II REPORT PREPARATION FOR POWER POINT SLIDE SEMINAR PRESENTATION AND REPORT SUBMISSION

Table 1.2: Gantt chart for PSM 2

7

CHAPTER 2

LITERATURE REVIEW

2.0 Introduction

Most sensors are electrical or electronic, although other types exist. A sensor is a

type of transducer. Sensors are either direct indicating (e.g. a mercury thermometer

or electrical meter) or are paired with an indicator (perhaps indirectly through an

analog to digital converter, a computer and a display) so that the value sensed

becomes human readable. In addition to other applications, sensors are heavily used

in medicine, industry and robotics.

A common requirement in the field of color sensing is that of color identification, or

sorting of objects by color. Typically this type of application is simpler than a

general-purpose color measurement application. A common task in color sensing is

to identify an unknown color as falling into one of these general categories.

2.1 Color Identification

Color names can be used and conjure reasonably consistent perceptions. There have

eleven basic color names have been identified such as white, gray, black, red, yellow,

green, blue, orange, purple, pink, and brown. Most or all colors can be described in

terms of variations and combinations of these colors. Due to the fact that human

color 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 color.

8

2.1.1 Color Theory

Berlien (2004) was said that there has three values can be thought of as coordinates

of a point in three-dimensional space, giving rise to the concept of color space. Hue,

saturation, luminance (HSL) is one such color coordinate system, or color space. A

more precise method of describing color is by hue, saturation, and lightness. Hue is

the attribute of a color according to its similarity with one of the colors red, yellow,

green, or blue, or a combination of adjacent pairs of these colors considered in a

closed ring, as shown in this figure 2.1

Figure 2.1: HSL diagram with Hue circle (Berlien 2004)

Color theory can also be defined by Soloman (1998). Color science defines color in a

space, with coordinates of hue, saturation and intensity (HSI). Hue is related to the

reflected wavelength of a color when a white light is shined on it. Intensity

(lightness) measures the degree of whiteness or gray scale of a given color.

Saturation is a measure of the vividness of a given hue. The term chromaticity

primarily includes elements of hue and saturation components. Researchers depict

color in space using hue as angle of a vector, saturation as the length of it and

intensity as a plus or minus height from a center point as shown in figure 2.2.

9

Figure 2.2: Coordinates of hue, saturation and intensity of color in space (Soloman

1998)

From figure 2.3, a color is depicted at a molecular level. Color is created when light

interacts with pigment molecules. Color is generated by the way pigment molecules

return (bend) incoming light.

Figure 2.3: Model of color interpretation (Soloman 1998)

10

2.1.2 Color and Light

A ‘color’ is an interaction between a very small range of electromagnetic waves and

the eyes and brain of a person. What people call red, green, or blue are just ways of

categorizing what their brain experiences. An article by Bishop and Lee (2006) brief

that, the spectrum of light where the eye can see is called the visible region as can be

seen in figure 2.4. Light is a type of energy, which makes up a small portion of the

electromagnetic spectrum. Visible light could be expressed as a frequency, but the

magnitude is so large people generally express the wavelength of light in units of

nanometers (10-9 meters) to describe light. The region of visible light consists of

light with a wavelength between approximately 380 nm to 780 nm. The visible colors

and their corresponding range of wavelengths can be found in Table 2.1

Figure 2.4: Electromagnet radiation (Bishop and Lee 2006)

11

Table 2.1: Color vs. Wavelength Range (Bishop and Lee 2006)

Color Wavelength Range (nm)Violet 380 ~ 410Indigo 410 ~ 450Blue 450 ~ 510

Green 510 ~ 560Yellow 560 ~ 600Orange 600 ~ 630

Red 630 ~ 780

2.2 Color Sensor

Color sensors register items by contrast, true color, or translucent index. True color

sensors are based on one of the color models, most commonly the RGB model. A

large percentage of the visible spectrum can be created using these three primary

colors. Many color sensors are able to detect more than one color for multiple color

sorting applications. Depending on the sophistication of the sensor, it can be

programmed to recognize only one color, or multiple color types or shades for

sorting operations. Some types of color sensors do not recognize colors, instead

focusing on light wavelengths.

Sensor can be configured to locate wavelengths from near infrared (colors in the 750

nm to 2500 nm wavelength range), far infrared (colors in the 6.00 to 15.00 micron

wavelength range), and UV (colors in the 50 to 350 and 400 nm wavelength range),

in addition to the visible range. Sensors that read the visible range are the most

common type of color sensors. They measure color based on an RGB color model. A

large percentage of the visible spectrum (380 nm to 750 nm wavelength) can be

created using these three colors. Color sensors are generally used for two specific

applications:

12

1. True color recognition

Sensors used for true color recognition are required to "see" different colors or to

distinguish between shades of a specific color. They can be used in either a sorting or

matching mode. In sorting mode, output is activated when the object to be identified

is close to the set color. In matching mode, output is activated when the object to be

detected is identical (within tolerance) to the color stored in memory.

2. Color mark detection.

Color mark detection sensors do not detect the color of the mark; rather they "see"

differences or changes in the mark in contrast with other marks or backgrounds. They

are sometimes referred to as contrast sensors. Color sensors shine light onto the

object to be monitored and measure either the direct reflection or the output into

color components. Many color sensors have integral light sources to achieve the

desired effect. These integral light sources include LEDs, lasers, fiber optic, and

halogen lamps.

2.3 Sorting

Sorting is any process of arranging items in some sequence and/or in different sets. It

has two common distinct meanings such as ordering and categorizing. Ordering is

arranging items of the same kind, class, nature, etc. in some ordered sequence while

categorizing is grouping and labeling items with similar properties together by sorts.

2.3.1 Sorting Information or Data

One important kind of sorting is arranging items of information in alphabetical

sequence according to some pre-defined ordering relation (sort key by each group of

lists), e.g. when one sorts the books in a library by title, subject or author (all

13

alphabetically sorted normally in ascending order). The resulting order may be either

ascending or descending, because essentially all sorting is numerical sorting. The

main purpose of sorting information is to optimize its usefulness for specific tasks.

2.3.2 Physical Sorting Processes

Various sorting tasks are essential in industrial processes. For example, during the

extraction of gold from ore, a device called a shaker table uses gravity, vibration, and

flow to separate gold from lighter materials in the ore (sorting by size and weight).

Sorting is also a naturally occurring process that results in the concentration of ore.

Sorting results from the application of some criterion or differential stressor to a mass

to separate it into its components based on some variable quality. Materials that are

different, but only slightly such as the isotopes of uranium, are very difficult to

separate.

2.3.3 Application of Sorting and Color Sorting

Bickman, Josh et al (1996) state in the article about automated color-sorting uses

optical technology that has evolved from early designs intended to remove ceramic

contaminants. The system configuration is similar to automated ceramic removal

equipment, but color-sorting equipment uses a different light source. Automated

systems can generally be instructed to remove any one or a combination of the three

glass colors.

According to BG and DW (1992), industrial applications require some sort of

automated visual processing and the classification of items placed on a moving

conveyor. A typical process comprises of:

(i) Looking at the items on the conveyor via some type

of sensor such as a camera

14

(ii) Localizing any single item

(iii) Classifying the item based on a set of features such

as shape

(iv) Performing the necessary action depending on the

classifications made.

Bozma and Yal-cin (2002) in their journal explains about a Visual classification

setup in an industrial setting typical setup is as shown in Fig. 2.5. In this journal state

that how items at random positioned and oriented to be moving on a conveyor. A

camera located above the conveyor views the items orthographically. They assume

that there is an item separator placed before the camera so that the incoming items

are not overlapping which is a realistic assumption in many manufacturing

environments. A sensing device signals the presence of perception that is instead of

processing the whole image, only areas that are deemed ‘‘interesting’’ and thus

calling for attention are analyzed.

Figure 2.5: Visual classification setup in an industrial setting (Bozma and Yal-cin

(2002)

An automated remote controller sorting system has been developed for a TV

manufacturing plant as shown in figure 2.6. There are five different types of remote

controllers with about ten different colors. Each type of remote controller can be

distinguished based only on the outer shape. In this application, all the different types

of remote controllers are being manufactured on the same assembly line. The right

part at from figure 2.6, the remote controllers are fed automatically one-by-one from

the assembly line. A camera acquires their image and visual processing determines

their type. Accordingly, the remote controllers are directed to one of the control

15

stations. Those whose types are unidentified are directed to a basket as seen in the

front. After being manufactured, they are subjected to functional testing which varies

according to their type.

Figure 2.6: Automated sorting system. (Bozma and Yal-cin (2002)

Boukouvalas et al (1997) describes an integrated system developed for the detection

of defects on color ceramic tiles and for the color grading of defect-free tiles. The

integrated system developed under the ASSIST project (automatic system for surface

inspection and sorting of tiles) are used for the detection of defects on color tiles and

for the color grading of defect-free tiles.

To meet the ASSIST demands, a multi-camera vision approach has been developed

in order to cover many different kinds of defects. The integrated vision system is

presented schematically in Figure 2.7. From this figure, the tiles are first inspected

for bumps and depressions using a laminated light source at an angle for maximum

sensitivity to surface imperfections. This means that each line across the tile receives

more or less light of the same intensity. Next, the tile is inspected for other structural

faults, such as cracks and holes, using diffuse lighting. Finally, the tiles are inspected

for color defects and color grading using the tri-linear color scanner and again diffuse

lighting.

16

Figure 2.7: The overall structure of the ASSIST system (From Boukouvalas et al,

1997)

There have issues in automatic sorting and present advanced solutions for the sorting

of recyclable packaging towards the process automation. Mattone et al (1999) had

explained about a technique for detecting and classifying objects. The most of the

authors prefer to use 2D Vision techniques to separate the objects from the known

belt background and to get some of their geometrical parameters (typically: length,

width, or shape parameters). When other parameters than geometrical ones are

relevant for sorting, specific sensors are employed. However, a complete different

situation characterizes the sorting of recyclable packing, where items of many

different kinds (plastic, metals composite, etc), together with some other undesired

materials, have to be separated into homogeneous fractions that will undergo the

same process.

(i) The shape and position of any item is unknown

(ii) The items on the belt may be in contact or even

overlapping.

(iii) Their physical and geometrical characteristics

vary in a wide range.

(iv) The items flow can be just characteristics vary in

a wide range.

17

Due to these conditions, that violate all assumptions at points (i-iv), thus making

standard automatic techniques inapplicable, this sorting process has not yet been

automated actually. After some mechanical and magnetic presorting, the process has

to be completed manually by human operators, with serious risks for their health. For

this robot application, a semi-automatic solution had been developed at the robotics

lab of Fraunhofer IPA. In this setup from figure 2.8, the material to be sorted is

poured directly from its container onto a moving conveyor belt which is sealed

against the environment. It is then identified and localized by the operator by means

of a touch-screen system. A SCARA robot picks the identified items according to a

first-in-first-out policy and deposits them in a suitable shunt.

Figure 2.8: The semiautomatic cell for the sorting of wasted packaging developed at

Fraunhofer IPA (Mattone et al (1999))

In order to accomplish a fully automated wasted packaging sorting, the following

problems have to be faced:

i. Automatic localization of the single items on the belt in presence of

contact and overlap.

18

ii. Classification of a wide class of packaging items for which

mechanic/magnetic presorting do not be sufficient.

iii. Optimization of the gripping strategy to keep acceptable system efficiency

in spite of the varying load situations.

Jones et al (1989), brief about color sorting system and method. Color sorting system

and method is applied to sort fruits and vegetables. The objects to be sorted are

scanned with a color video camera and the signals from the camera are digitized and

utilized to addresses for colors to be rejected. In this system the data collected by

camera will sent to color sorter processor to finalize the good or bad fruits or

vegetables. If the objects are rejected, mean the object only have a certain number or

sequence of unacceptable colors.

By referring figure 2.9, the sorting apparatus of the present innovation has on

preferred use in sorting moving item on a conveyor belt, which the item may be fruits

or vegetables. A camera and flash allows for multiple images of the items or products

on moving belt to be captured and processed by a color sorter processor. Color sorter

processor which is in general controlled by a central processor unit or minicomputer

are use to operate a rejecter unit. Timing as to be location of the item on the conveyor

belt to provide for proper rejection is accomplished by timing feedback, which for

example may be an output from a rotating pulse. Since all of the foregoing must be

done on a real time basis and with a conveyor moving at high speed, the color sorter

processor must receive the pictorial value from the camera and flash and process

them. Typically, video camera will charge coupled device which has a fast response

time and it will provide red, green and blue separate outputs. The present invention is

also applicable to black and white cameras which will provide gray scale value.

These require somewhat less processing time with the same equipment. While items

on a moving conveyor belt have been shown, any type of succession of the sorted

where a high speed processing of the image information is desired.

19

Figure 2.9: Block diagram of items on a conveyor belt being sorted by the apparatus

(Jones et al (1989))

Figure 2.10: Simplified block diagram of color sorting system (Jones et al (1989))

Figure 2.10 show a line scan color video camera which has an array of photosensors.

With the belt moving in a direction generally perpendicular to scan line, successive

readings of the photosensors are taken to provide data for different scan lines. The

data is processed in frames which can consist of any desired number of scan line. The

output signals from the video camera are normalized and applied to an analog-to-

digital converter. The output of A/D converter is applied to a frame grabber. The

output of LUT 1 is applied to the input of shift register and the output of the shift

register is applied to the address lines of second look up table (LUT). Shift register

and LUT 2 form a spatial filter which causes an object on the conveyor belt to be

rejected only if it has a certain number or sequence of unacceptable colors. The

LINE SCAN VIDEO

CAMERA

A/D CONVERTER

FRAME GRABBER

MONITOR

LUT1

LUT2

SHIFT REGISTER

VALVE DRIVER

EJECTOR

AIR

20

output signal from LUT 2 is applied to a valve driver which controls the discharge of

air through a plurality of nozzles in an ejector. The air jets from these nozzles divert

objects identified as having defects from the normal path of delivery by the belt to a

reject area.

2.3.4 Color Sensor Applications.

Historically, components used for color sensing were considered expensive and

required precision support circuitry, limiting their application mostly to specialized

instrumentation. However, new technologies of color sensors with higher levels of

integration are becoming available, allowing for more cost-effective solutions. As the

cost of color sensing comes down, the number of applications using color sensing is

increasing. Soloman (2004) explain several example applications using color sensor.

The following are five examples of unique situations requiring innovative solution.

1. Sorting automotive parts with different colors.

A manufacturer of automotive parts needs to differentiate parts whose only

visible difference is a slight variation in color. One part is black, the other a

dark grey. Because efficiency demands that the part be sorted at a high rate of

speed, the opportunity for mistakes is extremely high. By using advance color

sensing technology, the manufacturer can sort these parts at an enhanced rate of

speed, saving time and virtually eliminating errors.

2. Assembly of medical closures with different color components.

In this situation, containers of liquid medications consist of an aluminum cap

with a plastic cover. A complete closure assembly requires the assurance of

proper color combination of two components. Because of this absolute

necessity of color accuracy, color sensing technology proves invaluable.

21

3. Lumber sorting by color.

Color cording has become a standard method of differentiation in the lumber

industry. Not only different types of lumber but the grade, quality and intended

purpose of the lumber is indicated by color. Because the environments in which

lumber is sorted can be highly abusive, it is recommended that protective

covers be employed to protect the fiber optics used for this process.

4. Color sensing in the food industry.

Sensing a white target on a white background is challenging using conventional

photoelectric sensors. A manufacturer who needs to insure the presence of the

white cap on a jar of mayonnaise improves accuracy with a color sensor that

employs the RGB color concept. This technology improves the contrast

between two slightly different whites.

5. Ammunition final inspection and sorting process.

An ammunition manufacturer codes the style and caliber of bullets with various

colors on the tips. The need to insure that the proper type and caliber of product

are correctly packaged necessitates the automation of the product line with

color sensing technology. Because of the critical nature of this application, it is

recommended that two color sensing stations be implemented to add an extra

safety margin to the operation.

2.4 Color Sensor

2.4.1 The TCS230 Color Sensor

The TCS230 has an array of photodetectors, each with either a red, green, or blue

filter, or no filter (clear). The filters of each color are distributed evenly throughout

the array to eliminate location bias among the colors. Internal to the device is an

22

oscillator which produces a square-wave output whose frequency is proportional to

the intensity of the chosen color.

Table 2.2: Specification of TCS230 (TAOS Inc (2003))

Light Source Silicon PhotodiodesOutput Options Pulse Train; Square WaveInput Voltage DC input; 6VOperating Temperature (F) 32 to 158Notes Programmable color and full-scale output frequency

According to Basic of Light and Color from TAOS Inc (2003) TCS230 combines

three photodiodes, dye-based RGB (red, green, blue) filters, and a current-to-

frequency converter circuit on a single chip. Based on the theory of trichromacy,

three values, in this case R, G, and B, are necessary and sufficient to describe any

color. In a color measurement application, a white light source, such as an

incandescent lamp or white LED, is used to illuminate a sample. Reflected light from

the sample is directed to the TCS230, either through a lens, or ideally, simply by

close proximity to the sample. In the case of a colored source, light from the source is

directly incident on the TCS230. The three outputs from the TCS230 are then

processed to determine color.

Figure 2.11: Measuring color (Basic of Light and Color (2003))

Williams (2003) brief about TCS230 color Evaluation Module Connected to Basic

Stamp as shown as figure 2.12. Pins labeled S0 and S1 which are used to divide the

23

frequency output of the TCS230. Left unconnected, the output frequency is not

divided. It's important to point out that in very bright conditions the output frequency

of the TCS230 can exceed the capabilities of the BS2's COUNT function.

Figure 2.12: TCS230 color Evaluation Module Connected to Basic Stamp (Williams

(2003)

2.5 BASIC Stamp

2.5.1 Introduction to the BASIC Stamp

The BASIC Stamp is a microcontroller developed by Parallax, Inc. which is easily

programmed using a form of the BASIC programming language. It is called a

“Stamp” simply because it is close to the size of an average postage stamp. BASIC

Stamps are microcontrollers (tiny computers) that are designed for use in a wide

array of applications. Each BASIC Stamp comes with a BASIC Interpreter chip,

internal memory (RAM and EEPROM), a 5-volt regulator, a number of general-

purpose I/O pins (TTL-level, 0-5 volts), and a set of built-in commands for math and

I/O pin operations. BASIC Stamps are capable of running a few thousand

instructions per second and are programmed with a simplified, but customized form

of the BASIC programming language, called PBASIC.

24

2.5.2 PBASIC Language

PBASIC (Parallax BASIC) is a hybrid form of the BASIC programming language in

which many people are familiar. Currently there are three versions of PBASIC:

PBASIC1 for the BASIC Stamp 1, PBASIC2 for the BASIC Stamp 2 and

PBASIC2sx for the BASIC Stamp 2sx. Each version is specifically tailored to take

advantage of the inherent features of the hardware it runs on. PBASIC is called a

hybrid because, while it contains some simplified forms of standard BASIC

commands, it also has special commands to efficiently control the I/O pins. It

includes many of the instructions featured in other forms of BASIC (GOTO,

FOR...NEXT, IF...THEN) as well as some specialized instructions (SERIN, PWM,

BUTTON, COUNT and DTMFOUT). Information on Basic Command Reference

will include at Appendix 1.

The items need to get started with the BASIC Stamp:

1. The BASIC Stamp Windows Editor programming software

2. The programming cable (a DB-9 serial cable for all BASIC

Stamp 2s and a parallel to three-pin cable for BASIC Stamp 1s

3. The BASIC Stamp User's Manual

4. The BASIC Stamp module itself, and optionally

5. The appropriate development board or kit.

2.5.3 Hardware: Board of Education (Rev. B)

The Board of Education is designed to accommodate the BS2-IC, BS2e-IC and

BS2sx-IC modules. This board provides a small breadboard for quickly prototyping

25