You are on page 1of 20

CONTENTS

Page
1. Introduction 2

2. Aim and objective 3

3. Specification of Integrated Components 3

3.1. TCS 3200 Color Sensor 3

3.2 Servo Motor 6

3.3 Arduino Uno R3 7

4. Project plan 7

4.1. Plan Chart 7

4.2. Data Collection 8

4.3. Design Drawing 8

4.4. Activities for 4th and 5th week 9

5. Budget Plan 10

6. Project Specification 11

6.1. Process Flowchart 11

6.2. Program Code 12

6.3. Circuit Diagram 15

6.4. Result 16

7. Project Evaluation 18

8. Problem & Solving 18

9. Project Performance 19

10. Conclusion 20

1
1. INTRODUCTION

Color sensor systems are increasingly being used in automated applications to detect
automation errors and monitor quality at the speed of production line. They are used in assembly
lines to identify and classify products by color.

An employee who has been performing an inspection task over and over again may

eventually fail to recognize the color of product. Automating many of the tasks in the industries
may help to improve the efficiency of manufacturing system.

The purpose of this Integrated Design Project is to develop an idea of how to implement a
system which automatically separates products based on their color and packaging the product
which consist of different colors in one package. This DIY Arduino based color sorter and
sequencer project consists of three parts: servo motor to fetch products, color sensor and another
servo motor to drop objects. The output and input of these parts was interfaced using Arduino
microcontroller.

2
2. AIM AND OBJECTIVES

AIM
To sort different objects according to the color.

OBJECTIVES
To program and design a sensor which can detect frequency range of different colors and
differentiate between them.
To apply the basic knowledge on microcontroller, sensor and actuators.
To solve sensor problems and errors.

3. SPECIFICATION OF INTEGRATED COMPONENTS

3.1. TCS 3200 COLOR SENSOR

FIGURE 1. TCS3200 color sensor and magnified views of its photodiode arrays

The TCS3200 has an array of photodiodes with 4 different filters. A photodiode is simply a
semiconductor device that converts light into current.
The sensor has:
▪ 16 photodiodes with red filter sensitive to red wavelength
▪ 16 photodiodes with green filter sensitive to green wavelength
▪ 16 photodiodes with blue filter sensitive to blue wavelength
▪ 16 photodiodes without filter

3
3.1.1. SENSOR SPECIFICATION
• Power 2.7V to 5.5V
• Size:28.4*28.4 mm
• Interface: digital TTL
• High-resolution conversion of light intensity to frequency
• Programmable color and full-scale output frequency
• Communicates directly to microcontroller

FIGURE 2. Light intensity is absorbed by photodiodes & converted to frequency and then sent to
microcontroller as an Input

By choosing the photodiode filter’s readings, we can detect the intensity of different colors.
The sensor has a current -to-frequency that converts its reading into a square wave with a frequency
that is proportional to the light intensity of the chosen color. And then this frequency is read by the
Arduino as shown above figure.
TABLE 1. Pinouts of TCS 3200

Pin Name I/O Descriptions

GND Power supply ground

OE I Enable for output frequency (active low)

OUT O Output frequency

S0, S1 I Output frequency scaling input

S2, S3 I Photodiode type selection inputs

VDD Voltage supply

4
FIGURE 3. Schematic Diagram of TCS 3200
TABLE 2. Choosing the percentage of output frequency
depending on the microcontroller
3.1.2. FREQUENCY SCALING
Pins S0 and S1 are used for Output frequency S0 S1
scaling the output frequency. It can scaling
be scaled to the following preset
values: 100%, 20% or 2%. Scaling Power down Low Low
the output frequency is useful to
optimize the sensor readings for 2% Low High
various frequency counter or
microcontrollers. For the Arduino, it 20% High Low
is common to use a frequency scaling
of 20%. So, we set S0 pin to HIGH 100% High High
and S1 pin to LOW. 100% frequency
can be used for high speed
processers.

3.1.3. FILTER SELECTION TABLE 3. Choosing the type of photodiode for reading the
specific color
To select the color read by the
photodiode, we use the control pins Photodiode type S2 S3
S2 and S3. As the photodiodes are
connected in parallel, setting the S2 RED Low Low
and S3 LOW and HIGH in different
combinations allows us to select BLUE Low High
different photodiodes.
No filter (clear) High Low

GREEN High High

5
3.2 SERVO MOTOR
• Rotary actuator and can also be used as linear actuator
• Work on PWM (Pulse Width Modulation)
• Made up of DC motor which is controlled by a variable resistor and some gears

Tower Pro SG-90 Features

• Operating Voltage: +5V typically


• Torque: 2.5 kg/cm
• Operating speed: 0.1s/60º
• Gear type: plastic
• Rotation: 0º-180º
FIGURE 4. Servo motor pinout
• Weight: 9g
• Package includes: gear horns and screw

TABLE 5. Servo Motor SG-90 wire configuration

Wire Wire Description


Number Color

1 Brown Ground wire connected to the ground


of system

2 Red Powers the motor typically +5V is used

3 Orange PWM signal is given in through this


wire to drive the motor

From figure 5, understand that the PWM


signal produced have a frequency of 50 Hz that is
the PWM period is 20ms. Out of which the on-time
can vary from 1ms to 2ms. So, when the on-time is
1ms, the motor will be in 0º and when 1.5ms, the
motor will be 90 º, similarly when it is 2ms, it will
be 180 º. So, by varying the on-time from 1ms to
2ms, the motor can be controlled from 0 º to 180 º.
FIGURE 5. PWM signal produced

6
3.2. ARDUINO UNO R3

FIGURE 5. Arduino Uno R3 Microcontroller

The Arduino Uno is an open-source microcontroller board. This board is equipped with sets
of digital and analog input/output (I/O)pins.It has 14 digital pins,6 analog pins and programmable
with the Arduino IDE via a type B USB cable.It can be powered by the USB cable or by an external
9V battery.

4. PROJECT PLAN
4.1. PLAN CHART

Activities 1st 2nd 3rd 4th 5th 6th 7th 8th


Weeks Week Week Week Week Week Week Week Week

Data Collection

Collect parts

Discussion

Draw design

Construction

Programming

Testing & Modifying

Final report

7
4.2. DATA COLLECTION

Color Sensor Examples

Asking to
supervisor

From
Internet ://howtomechatronics.com/

FIGURE 6. Data Collection Pie Chart

4.3. DESIGN DRAWING

FIGURE 7. 2D Layouts of each components of the frame (Dimensions are in millimeter)

8
4.4. ACTIVITIES FOR 4TH & 5TH WEEK

Activities 1st 1st 1st 2nd 2nd 2nd


Days MON TUE FRI MON TUE FRI

Collect Parts

Cutting

Circuit Testing

Programming

Check

Assembly

Design Testing

9
5. BUDGET PLAN

Components/Tools/Materials Quantity Cost Transportation


Fee

Arduino Uno R3 1 8500 MMK -

TCS3200 Color Sensor 1 6500 MMK -

Servo MG995 1 6000 MMK -

Micro Servo SG90 1 2000 MMK -

Jumper wire 2 2000 MMK -

On/Off Switch 1 200 MMK -

Mentos 10 2500 MMK -

Nail Polish 5 2500 MMK -

Glue Gun 1 - -

Cutter 1 - -

Wire Tape 1 500 MMK -

Plywood 1 3000 MMK -

Total 33700 MMK

10
6. PROJECT SPECIFICATION

6.1. PROCESS FLOWCHART


SORTING

Power On

Top Servo 134º

Top Servo 81º

FIGURE 8. Process Flowchart


Sense Color showing how objects are fetched,
sensed and sorted according to
colors.

YES Is Color NO
Red?

Bottom Servo82º YES Is Color


Green?

Top Servo 15º


Bottom Servo119º
NO

Top Servo 15º Bottom Servo 159º


Cup2

Top Servo 15º

Cup3

Cup4

END
11
6.2. PROGRAM CODE

12
13
14
The program code shown above is compiled in Arduino IDE and uploaded to Arduino board by
USB cable. Then, connect a 9V battery to Arduino board and run the project. Results for sorting and
sequencing are shown with figure in Section 6.4.1 and 6.4.2.

6.3. CIRCUIT DIAGRAM

FIGURE 9. Complete Circuit Diagram with Common GND and Vcc

15
6.4. RESULT

FIGURE 10. Step-by-step Construction of the Frame

6.4.1. OUTPUT ( SORTING)

FIGURE 11.
Step-by-step
sorting of
objects until
each color is
gathered in
separate cup.

16
6.4.2. OUTPUT ( SEQUENCING)

The Sequencing process is as follows:


1st RED 2nd RED 3rd RED 4th RED 1st GREEN 2nd GREEN 3rd GREEN 4th GREEN

CUP 1 CUP 2 CUP 3 CUP 4

1st BLUE 2nd BLUE 3rd BLUE 4th BLUE


FIGURE 13. How sequencing or filling depends on the number of counts of each color

Then, the process is repeated from beginning. Detail of the how to loop the program when count is
greater than four can be checked in the program code.

FIGURE 12. Step-by-step filling of objects in each cup. Each cup contains three different colors. The filling
process starts from the left hand si
17
7. PROJECT EVALUATION

Time Costs Standard Resource Implemen Total Rank


(Quality) tation Score Order

1.Collect Parts + + E + + 4 1

2.Data Collection + + - + E 3 2

3.Construction + + E + + 4 1

4.Testing - + E + + 2 3

5.Progrmming + + - E + 2 3

6.Modifying - - + + + 1 3

+=1, E=0, - = -1
(Total Score 4-3=Rank 1/ Total Score 3=Rank 2/ Total Score 1-2=Rank 3)

8. PROBLEMS & SOLVING

1.Cutting problem
Solving-Make square holes instead of circular holes.
-Overlap 2 foam boards using glue and reduce the thickness.
2.Color problem
Solving-Avoid using nearly similar colors to take significant range between R,G& B values.

18
3.Sensor problem
Solving-Cover from the external light that disturbs in sensing.
4.Power supply problem
Solving-Use external 9V or 12 V battery when the servo motors struggle to run. Using
external battery will support enough power (currnet and voltage) than supply from laptop by USB
cable

TABLE 6. Brief explanation of problems and how it is solved

No. Problems Solving

1 Cutting problem Make square holes instead of circular holes

2 Color problem Take significant range between R,G &B

3 Sensor problem Cover from the external light

4 Power supply problem Use external 9V or 12V battery

9. PROJECT PERFORMANCE

In this project, the objects are mentos. So, the objects become soft and get damaged over
time. So, the performance at this time is 75% - 83%.
If the color of the objects do not get fainted, the project performance would be above 98%.

19
10. CONCLUSION

In this project, we have implemented a design that can detect colors of each object

and sort and sequence according to color.

We were able to finish this project successfully from combing and using the knowledge from

the subjects we have studied, such as, PIC Microcontrollers, Circuit Analysis, Sensors and Actua-
tors, Design, Workshop, Engineering Economy and also by the help of supervisors.Based on the
idea on this mini-project, we tend to implement a truly useful color sorting and packaging system
that can be used in industries.

We give our special thanks to our supervisors and teachers and credit to the references we
have used for this project.

REFERENCES
Kunhimohammed C.K, Gokul M.S and Sheez and Usman Abdulla/ Automatic Color Sorting
Machine Using TCS2300 and PIC Microcontrller (International Jouranal of Research and
Innovatons in Science and Technology)
www.HowToMechatronics.com / Arduino Color Sensing Tutorial
www.HowToMechatronics.com/ Arduino Color Sorter Project

20

You might also like