COLOR BASED SORTING
A PROJECT REPORT
                        Submitted by
     Vignesh                             (513421106704 )
     Mohamed Sheik Hakkim                 (513421106029)
     Hareetha                             (513421106015)
     Swetha                               (513421106048)
       In partial fulfillment for the award of the degree
                              Of
         BACHELOR OF ENGINEERING
 ELECTRONICS AND COMMUNICATION ENGINEERING
UNIVERSITY COLLEGE OF ENGINEERING KANCHEEPURAM
       ANNA UNIVERSITY: CHENNAI 600025
                        APRIL 2024
          ANNA UNIVERSITY : CHENNAI 600 025
                         BONOFIDE CERTIFICATE
Certified that this project report“ COLOR SORTING IMPLEMENTATION ”is
the bonafide work of “ Vignesh (513421106704 ),Mohamed Sheik Hakkim
(513421106029),Hareetha (513421106015),Swetha(513421106048)” carried
the project work under work under my supervision.
          SIGNATURE                           SIGNATURE
                                            (SUPERVISOR)
Dr.M.MALLESWARAN,M.Tech,                 Mrs.C.HEMALATHA,
              Ph D,
 HEAD OF THE DEPARTMENT,                     TeachingFellow,
            Professor,                     Department of ECE,
       Department of ECE,
      University college Of               University college Of
    Engineering Kanchipuram,            Engineering Kanchipuram,
     Kanchipuram—6351552.                Kanchipuram—6351552.
Submitted for the Project Viva-Voce examination held on____\____\______
INTERNL EXAMINAR                                EXTERNAL EXAMINAR
                                  ABSTARCT
This paper presents the design and the implementation of a real-time color
based sorting system that is intended to be used in agriculture applications.
The control part of the system is realized with the versatile microcontroller
Atmega328. The color detection of the analyzed objects is obtained with the
specialized digital sensor TCS230 that contain all the circuitry that is necessary
for converting the light into frequency signal for convenient acquiring and
processing with the microcontroller. The actuation elements of the sorting
system are realized with a set of TowerPro SG90 servomotors which have a
very lightweight construction but are capable to generate relatively high
output power. Being a microcontroller-based system that relies on an advanced
color sensor and dedicated proprietary control software, the proposed sorting
system is characterized by improved reconfigurability and adaptability.
The system can be easily integrated within a very broad spectrum of
applications including Internet of Things or quality control in industrial domain.
             TABLE OF CONTENTS
CHAPTER NO         TITLE                   PAGE NO
              LIST OF FIGURES
              LIST OF ABBREVATIONS
      1       INTRODUCTION
             1.1 OVERVIEW
             1.2 MOTIVATION
   2          LITRETURE SURVEY
             2.1 EXISTING SYSTEM
             2.2 PROPOSED SYSTEM
   3          BLOCK DIAGRAM
             3.1 HARDWARE REPRESENTATION
             3.2 SOFTWARE REPRESENTATION
  4           HARDWARE DESIGN
             4.1 ARDUINO UNO
             4.2 ARDUINO SHEILD
             4.3 SPECIFICATIONS
             4.4 TOWER PRO SG 90
                 MICRO SERVO MOTOR
             4.5 TCS 3200 COLOUR SENSOR
             4.6 JUMPER CABLES
             4.7 BATTERY(3200mah)
                 AND ADAPTER
5     SOFTTWARE REQUIREMENTS
     5.1 ARDUINO IDE
6     FLOW CHAT AND PROGRAM
7     PROJECT PHOTOCOPY
8     CONCLUSION
9     FUTURE SCOPE
10    REFRENCES
LIST OF FIGURES
FIGURE NO         FIGURE NAME              PAGE NO
  1               BLOCK DIAGRAM
  2               ARDINUO UNO
  3               ARDINUO SHEILD
  4               TOWERPRO SG 90
  5               TCS 3200 COLOUR SENSOR
  6               BATTERY(3200mah)
  7               BATTERY ADOPTER AND
  8               JUMPER CABLES
LIST OF ABBREVATION
ACROYMN               ABBREVATION
IOT                   INTERNET OF THINGS
1. INTRODUCTION
Agriculture and Horticulture is one of the largest economic sectors and it plays
the major role in economic development of India. Still in India, the traditional
inspection of fruits is performed by human experts. A lot of time is wasted in
the fields for checking the quality of the crops. In this Paper, an economic and
safe way is used to analyze the fruit or vegetable quality which is based on
colour, shape and size. Fruits should be tested via non-destructive techniques
because these are delicate materials. The most important physical property
is fruit size while colour resembles visual property. Hence, classification of fruit
is necessary in evaluating agricultural produce, meeting quality standards and
increasing market value. It is also helpful in planning, packaging, transportation
and marketing operations. If the classification and grading is done through
manual techniques, the process will be too slow and sometimes it will be error
prone. The labours classify fruits and vegetables based on colour, size, etc. if
these quality measures are mapped into automated system by using
suitable programming language then the work will be faster and error free. In
recent years, computer machine vision and image processing techniques have
been found increasingly useful in the fruit industry, especially for applications
in quality inspection and shape sorting
Colour and shape characteristics of fruits are decisive for visual inspection.
1.1 OVERVIEW
The tremendous progresses in the field of microcontrollers and sensors created
new opportunities for developing advanced solutions that can significantly
improve the efficiency of the classical systems used in various sectors of
industry and agriculture. Particularly, the agriculture domain faces nowadays a
very important technological transformation becoming more and more
influenced by the development of new concepts like Internet of things (IoT)
or self-driving machines. The benefits and the additional opportunities created
by these trends are directly related to the integration of new technologies.
The sorting process represents a repetitive and time consuming task which don’t
requires a very high level of qualification, been feasible for automation using
dedicated machines. In this context aroused the idea of implementing automates
machines for sorting objects on the basis of color characteristics. Although
seems to be easy realizable, the color-based sorting is a complex problem that
rise many issues on the design and practical implementation as well.
1.2 MOTIVATION
In most of the industries, packaging systems use a line bridge as a sorting
element in their industry. While some industriesuse manual sort in their systems
as labor is available and theyfind the sorting systems are of higher cost. But to
see, themanual sorting process has its own cons. It requires plenty oftime and
excess efforts. But even after that there is noguarantee that the objects will be
sorted precisely and therewill be 100% accuracy in it. In some industries like
thepharmaceutical industry objects are produced according tobatches and when
this sorting fails, the entire batch needs tobe discarded. It wastes a lot of efforts
and cost of producingthe objects. So to assist these industries, a system that will
sortobjects automatically according to their color can be designed and the result
obtained will be totally accurate. Color sorting machine, works under IOT.
Here IOT (Internet of Things) implies a combination of interrelated computing
devices, Mechanical and digital machines. IOT encourages the communication
between the devices which is famously know as machine to machine
communication. In the world automation is increases with the help of IOT. IOT
have both advantages and disadvantages. Although it contains few
disadvantages, it is widely used. Time saving is the main advantage,
soconsumers are mainly attracted to it. IOT based colored products sorting
machine is an effective machine which works under the mechanism of sorting.
2.LITERATURE SURVEY
         Microcontroller Based Product Sorting by Using Colour Sensor
         Manoj Kharade, Sarthak Bhavsar, Swati Rathod, Kajal Molane,
                                    Suraj Mishra
1.Assistant Professor, Trinity College of Engineering and Research, Pune, India.
      2.Student, Trinity College of Engineering and Research, Pune, India.
                Corresponding Author: kajalmolane6@gmail.com
The proposed system works on a microcontroller which is widely used in the
industries. The system will work when any colored object is placed on the
conveyor belt. The object can be colored Red, Blue, Green or a mixture of any
of these colors. A color sensor is attached on the side of conveyor belt for
detection of the object. The color sensor will read the color values in terms of
RGB percentage of the object color and compare it with a predetermined value
threshold already programmed using the microcontroller. If the color sensor will
find the color to be above the threshold it will instruct the microcontroller to
activate the piston right next to the color sensor. The piston will now push the
object into a bucket right in front of it. If the color sensor reads a different
value,then the set threshold it will just pass it forward where another piston will
sort the product in another bucket. The system will become more complex if we
want to increase the number of objects sorted based on different colors.
Microcontroller has been used to control the various operations. It is a very
useful in a wide variety of industries with the help of amicrocontroller
especially into the packaging section.
Automatic sorting machine enhances the efficiency, practicality, and also the
safety of the operators. It ensures that the remarkable processing capacity is also
peerless performance including the color detection. Although we need to add a
higher speed DC motor and sensor with an appreciable response to speed up the
system for the industrial application. The model can be improved by making
some changes into the program and components. Some suggestions
are given for improving the system like adding a load cell for the measurement
and control of weight of the product. A counter can be used for counting the
number of products. System speed can be increased accounting to speed of
production. Adding more sensors for quality control will benefit. The sensor can
be changed according to the application as a future scope of this project. DC
motor can be replaced with a stepper motor. Microcontroller can be
replaced with a PLC. Segregation which is based on size can be done by
installation of sieves of various sizes PH sensors installed for food industry
application to check the freshness.
                  Arduino Based Color Sorting Machine using
                             TCS3200 Color Sensor
                      Ch.Shravani, G. Indira, V. Appalaraju
Sorting of object is an essential mechanical process in which difficult work is
quite required. Chronic manual arranging makes consistency troubles. Machines
can perform mainly dreary assignments superior to human beings. Laborer
exhaustion on sequential manufacturing structures can result in decreased
execution, and purpose troubles in retaining up object fine. A employee who has
been appearing research undertaking over and over may additionally in the end
forget about to recognize the color of item, but a machine in no way. On this
paper a compact records close to arranging of articles based totally totally on
shading has been implemented making use of TCS3200 shading sensor with
SERVOMOTORS associated with AURDINO UNO.
In the cutting-edge-day scenario of competitive manufacturing in commercial
zone performance of manufacturing holds the important component for
achievement. It's miles essential to beautify manufacturing pace, lower the
labour charge and reduce the breakdown time of production gadget.
Merchandise should be taken care of in numerous ranges of manufacturing and
manual sorting is time consuming and labour extensive. This paper discusses
about the automatic sorting tool which helps the sorting mechanism to kind
based at the coloration. For sensing TCS3200 coloration sensor has been used.
With the aid of reading the frequency of the output of the sensor, color
primarily based absolutely sorting is completed. Layout of a innovative venture
referred to as item sorting system by means of spotting the only of a kind shades
of the item has been leader goal of the challenge. Accumulating the objects
from the hopper and distributes those objects to their accurate area based on
their coloration even they'll be unique in coloration. Many paintings
environments aren't suitable for manual sorting and a few areas are risky for
humans to paintings on. Consequently to avoid the unstable work, time
consumption and hard paintings catch 22 situation. This prototype is built as a
simple digital gadgets like microcontroller for processing, Servo motors for
actions and coloration sensor for recognizing exclusive colored
devices.
2.1 EXISTING SYSTEM
The current existing systems contain use of different technology is made
according to different conditions like budget and scope of industry. Some more
components that can be included to make the system better are robotics systems,
microcontroller based system, sensor based system and pneumatic based
system, etc. Further the accuracy of the system depends mostly on the use and
type of color sensors. Currently existing systems usually contain an RGB based
color detection system. The ratio of RGB declares the exact color of the product
that is being sorted. In current systems, use of different technology is made \
according to budget and scope of industry. It includes robotics systems,
microcontroller based system, sensor based system and pneumatic based
system, etc. In currently existing systems, use of different technology is made
according to budget and scope of industry.It includes robotic systems,
microcontroller based systems,sensor based system and pneumatic based
system,etc. Automatic colour sorting machines are expensive ,So our proposed
method is developed to design machines are low cost,and and more accuracy
2.2 PROPOSED SYSTEM
This venture makes use of simplified and not steep priced techniques for sorting
the substances of a unique coloured items
It’s far sensing the colour of the objectr and kiut the different coloured devices
This proposal is based on the colour sorting machine with the increasing
demand for small company, a cheap and less complex design is an absolute
need, Usually, particular set of objects are differentiated based on
color. This will be done in different industries for food Processing as their
requirement. Previously, it is done manually but as the technology is developing
day-by-day, this sorting based on color is done by color sorting machine,
which does not require any manual support. By using this color sorting
machine, sorting will be based on its color and put into different bins. Here
again previously count and which color is sorted is done manually, but to avoid
manual involvement, this model will sort, displays which color is being sorted
and gives total count for each colour.
      3.BLOCK DIAGRAM
 POWER SUPPLY
 TCS 3200 COLOUR
      SENSOR
                                                                COLOUR
                                                             SEGMEBNTATION
                            ARDUINO UNO BOARD
  TOWER PRO SG 90                                               BY SERVO
                                                                MOTORS
MICRO SERVO MOTOR
      ARDUINO
 SHEILD(ADDITIONAL
POWER SUPPLY FOR AC
   SERVO MOTOR)
      3.1 HARDWARE REQUREMENTS
        • ArduinoUno (1 nos)
        • Arduino Sheild (Extra power supply for ac servo motor) (1nos)
   •   TowerPro SG 90 Micro Servo Motor (2 nos)
   •   Jumper cables
   •   Battery(3200mah) (2nos)
   •   Battery adapter (1nos)
   •
3.2    SOFTWARE REQUIREMENTS
  • Arduino ide
 4. HARD WARE DESIGN
4.1 Arduino UNO
The Arduino Uno is a popular microcontroller board that serves as the
cornerstone for countless DIY electronics projects, prototypes, and
educational endeavors. Here's a breakdown of its key features and
components:
Microcontroller: At the heart of the Arduino Uno is the Atmega328P
microcontroller, which is clocked at 16 MHz. This microcontroller
provides the processing power for executing the instructions
programmed into the board.
Digital I/O Pins: The Uno boasts 14 digital input/output pins (of
which 6 can be used as PWM outputs), allowing users to connect
various sensors, actuators, LEDs, and other components. These pins
can be configured as either inputs or outputs in software.
Analog Inputs: In addition to digital I/O, the Uno includes 6 analog
input pins, marked A0 through A5. These pins can read analog
voltage levels from sensors and other analog devices.
                          Fig1.Arduino Uno
Voltage Regulator: The board features a voltage regulator that allows
it to be powered via a DC power jack or USB connection. It can
accept voltages ranging from 7 to 20 volts (though 7-12V is
recommended) and regulate it down to the 5 volts needed by the
microcontroller.
USB Interface: The Uno can be programmed and powered via its
USB interface, making it easy to connect to a computer for uploading
sketches (programs) and debugging.
Reset Button: A reset button allows users to restart the
microcontroller, restarting the currently loaded program.
LEDs: The board includes a built-in LED connected to pin 13, which
is often used for basic visual feedback in sketches. Additionally, there
is a power LED indicating when the board is powered on.
Clock Crystal: The Atmega328P chip is supported by an external 16
MHz crystal oscillator, ensuring precise timing for the
microcontroller's operation.
Headers: The Uno includes male headers for connecting jumper
wires, shields, and other accessories. These headers provide
convenient access to the various pins and features of the board.
Compatibility: One of the key advantages of the Arduino Uno is its
compatibility with a wide range of sensors, shields, and expansion
boards, making it a versatile platform for experimentation and project
development.
Overall, the Arduino Uno offers a user-friendly and accessible
platform for electronics enthusiasts, students, and professionals to
bring their ideas to life through programming and hardware
interfacing. Its simplicity, affordability, and extensive community
support have made it a staple in the maker and STEM
education communities.
 Implementing a project in the Arduino IDE involves several key
steps:
Setting up the Arduino IDE: If you haven't already, download and
install the Arduino IDE from the official Arduino website. Once
installed, open the IDE.
Selecting the Board: Go to the Tools menu, then Board, and select the
appropriate board you're using (e.g., Arduino Uno, Arduino Nano,
etc.). Ensure that the correct board is selected to match your
hardware.
Selecting the Port: Under the Tools menu, navigate to Port and select
the serial port your Arduino is connected to. If you're unsure, you can
check which port is being used by your Arduino in the Device
Manager (Windows) or System Information (macOS).
Writing the Code: In the Arduino IDE, you'll write your program,
known as a "sketch." This is typically written in the Arduino
programming language, which is a simplified version of C/C++. Write
your code in the editor window.
Verifying and Compiling: Click on the Verify button (checkmark
icon) to compile your code. This step checks for syntax errors and
verifies that your code can be compiled successfully.
Uploading the Code: Once your code has been successfully compiled,
click on the Upload button (right arrow icon) to upload your sketch to
the Arduino board. The IDE will compile your code again if
necessary and then upload it to the board via the selected serial port.
Monitoring Serial Output (Optional): If your sketch includes serial
output for debugging or data communication, you can monitor the
serial output by opening the Serial Monitor in the Arduino IDE. Go to
Tools > Serial Monitor or press Ctrl+Shift+M (Cmd+Shift+M on
macOS).
Testing and Debugging: After uploading your code, test your project
to ensure it functions as expected. If you encounter any issues, use
debugging techniques such as serial output messages, breakpoints,
and code inspection to identify and resolve problems.
Iterating and Refining: Refine your code as needed, making
adjustments based on testing results and feedback. Iterate on your
project until it meets your requirements and functions reliably.
Saving Your Project: Save your Arduino sketch by going to File >
Save or File > Save As. This allows you to keep a copy of your code
for future reference or modifications.
By following these steps, you can implement your project in the
Arduino IDE, from writing code to uploading it to your Arduino
board and testing its functionality.
4.2 SPECIFICATIONS&FEATURES
  ▪ Developer- arduino.cc
  ▪ Type- Single board Microcontroller
  ▪ CPU- Microchip AVR(8-bit) at 16mhz
  ▪ Memory- 2kb (static RAM)
  ▪ Storage- 32kb flash
      1kb EEPROM
  ▪ Operating volt- 5 volt
  ▪ Digital I\P pin- 14
  ▪ Analog inputs- 6
  ▪ PWM Pins- 6(pin # 3,5,6,9,10          and 11)
  ▪ DC current per I\O pin- 20ma
  ▪ DC current for 3.3V Pin- 15ma
  ▪ Clock speed- 48mhz
4.3 ARDUINO SHEILD
An Arduino shield is an expansion board that attaches directly onto an
Arduino microcontroller board, such as the Arduino Uno, Arduino
Mega, or Arduino Nano. Shields are designed to provide additional
functionality, features, or connectivity options to the Arduino
platform. They stack neatly on top of the Arduino board, utilizing the
standardized header layout and interface.
key aspects of Arduino shields:
Physical Form Factor: Arduino shields typically follow a standardized
form factor to ensure compatibility with various Arduino boards.
They are usually rectangular in shape and feature a set of female
headers that plug directly into the male headers on the Arduino board.
Header Pins: Shields have sets of header pins that make electrical
connections with the corresponding pins on the Arduino board. These
pins provide power, ground, and data connections between the shield
and the Arduino.
Functionality: Arduino shields can add a wide range of functionalities
to an Arduino project, including but not limited to:
Motor control
Sensor interfaces (e.g., temperature, humidity, motion)
Communication protocols (e.g., Ethernet, Wi-Fi, Bluetooth)
Display options (e.g., LCD, OLED, LED matrix)
Audio capabilities (e.g., sound playback, voice recognition)
Data logging and storage
                        Fig2.Arduino Sheild
Robotics components (e.g., motor drivers, servo controllers)
Compatibility: Shields are designed to be compatible with specific
Arduino boards. For example, shields designed for the Arduino Uno
may not fit properly on an Arduino Mega due to differences in pin
layouts and form factors. It's essential to ensure compatibility between
the shield and the Arduino board you're using.
Ease of Use: Arduino shields simplify the process of adding complex
hardware functionalities to Arduino projects. They often come with
libraries and example code that streamline the development process,
making it easier for hobbyists, makers, and students to incorporate
advanced features into their projects without extensive electronics
knowledge.
Expansion Possibilities: Since shields stack on top of the Arduino
board, it's possible to use multiple shields simultaneously, expanding
the capabilities of your Arduino project even further. However, be
mindful of potential conflicts or resource limitations when using
multiple shields.
Overall, Arduino shields offer a convenient and modular way to
enhance Arduino projects by adding new capabilities and features.
They provide a bridge between the simplicity of the Arduino platform
and the complexity of various hardware components and interfaces,
enabling users to create a wide range of innovative
projects and prototypes.
To power an AC servo motor using an Arduino shield, you
typically need a dedicated motor driver shield that can handle the
high current requirements of the motor. Here's how you might set
it up:
Choose the Motor Driver Shield: Select a motor driver shield
compatible with your Arduino board and capable of driving AC servo
motors. Popular options include shields based on H-Bridge or
MOSFET drivers.
Power Supply: Since AC servo motors require higher voltage and
current than what the Arduino board can provide directly, you'll need
a separate power supply for the motor. Make sure the power supply
can deliver the voltage and current required by your servo motor.
Connect the Motor Driver Shield: Plug the motor driver shield onto
your Arduino board, ensuring that it's securely seated on the header
pins.
Connect the Power Supply: Connect the positive and negative
terminals of the power supply to the appropriate terminals on the
motor driver shield. Ensure that the voltage matches the requirements
of your servo motor.
Connect the Motor: Connect the AC servo motor to the motor driver
shield. Follow the manufacturer's instructions for wiring the motor
properly. Typically, you'll connect the motor's terminals to the outputs
of the motor driver.
Control Signals: Connect the control signals from the Arduino to the
motor driver shield. These signals typically include direction and
speed control signals. Refer to the documentation of your motor
driver shield for the pin assignments.
Write the Code: Write Arduino code to control the servo motor. This
involves sending appropriate signals to the motor driver shield to set
the motor speed and direction You may also need to implement
feedback control if your servo motor requires position or velocity
feedback.
Test and Debug: Upload the code to your Arduino board and test the
motor. Verify that it operates as expected, and make any necessary
adjustments to the code or wiring.
Safety Considerations: When working with high-power devices like
AC motors, always prioritize safety. Use appropriate wiring and
connectors, insulate exposed connections, and take precautions to
prevent electrical shock or fire hazards.
By following these steps, you can use an Arduino shield with an
external power supply to control an AC servo motor effectively.
Remember to consult the documentation provided with your motor
driver shield and servo motor for specific wiring and operational
requirements.
4.3 TCS 3200 COLOR SENSOR
The TCS3200 is a color sensor module capable of detecting and
measuring the intensity of light across different wavelengths, allowing
it to determine the color of an object. Here are its main functions and
a description:
Color Sensing: The primary function of the TCS3200 color sensor is
to detect and measure the color of objects placed in front of it. It can
differentiate between a wide range of colors by analyzing the intensity
of red, green, blue, and clear (no filter) light.
Integrated RGB Filters: The TCS3200 includes built-in red, green,
blue, and clear filters that allow it to selectively measure the intensity
of light in each color channel. By combining these measurements, the
sensor can determine the overall color of an object.
Frequency-to-Voltage Conversion: The sensor uses an array of
photodiodes to convert light intensity into electrical signals. These
signals are then converted into digital values through frequency-to-
voltage conversion circuits.
Selectable Color Sensing Modes: The TCS3200 offers different color
sensing modes, allowing users to adjust the sensitivity and range of
the sensor based on the application requirements. These modes
include full-color sensing and color filtering modes.
Programmable Gain and Integration Time: The sensor supports
programmable gain and integration time settings, which can be
adjusted to optimize performance in different lighting conditions and
for various color sensing tasks.
Digital Output Interface: The TCS3200 communicates with external
microcontrollers or systems through a digital output interface,
typically using protocols such as I2C or SPI. This allows the sensor to
integrate easily with Arduino, Raspberry Pi, and other platforms.
Applications: The TCS3200 color sensor finds applications in various
fields, including industrial color sorting, color recognition in robotics
and automation, color-based product authentication, ambient light
sensing for display brightness adjustment, and colorimetry in
scientific and educational projects.
                                             Fig3.Color sensor
In summary, the TCS3200 color sensor is a versatile module capable
of accurately detecting and measuring the color of objects by
analyzing the intensity of light across different wavelengths. Its
integrated RGB filters, frequency-to-voltage conversion circuits, and
programmable features make it a valuable tool for color sensing and
analysis in a wide range of applications.
4.5 SPECTICATIONS OF COLOR SENSOR MODULE
  ▪ Operating Voltage 3V-5V
  ▪ Put the needle- (2.54mm)
  ▪ Working temperature ( -40oC to 85oC)
  ▪ PIN Descriptions- S0 and S1(Select lines for output frequency
    scaling),
  ▪ S2 and S3(Select lines for photodiode type)
  ▪ Power down feature
  ▪ Communicate directly with micro controller\Arduino
  ▪ High-resolution conversation of light intensity to frequency.
  ▪ Programmable color and full scale Output Frequency.
Fig4
The TCS3200 color sensor is a programmable device that can detect
and measure the intensity of light across different color channels. It
comes equipped with an array of photodiodes, each covered by a
specific color filter: red, green, blue, and clear. The clear photodiode
captures ambient light and is used to calculate the overall intensity.
The sensor has two main operating modes: frequency and analog
output. In frequency mode, the sensor outputs a square wave with a
frequency proportional to the intensity of light detected. In analog
output mode, the sensor provides a voltage output proportional to the
intensity.
To achieve accurate color sensing, the TCS3200 library employs both
frequency and analog output modes to calibrate and interpret color
data. Additionally, the library allows users to customize the
integration time and frequency scaling of the sensor to optimize
performance for specific applications.
Fig5
5.SOFTWARE DESIGN
5.1 Arduino Ide
The Arduino Integrated Development Environment - or Arduino
Software (IDE) - contains a text editor for writing code, a message
area, a text console, a toolbar with buttons for common functions and
a series of menus. It connects to the Arduino and Genuino hardware
to upload programs and communicate with them.
WRITING SKETCHES:
Programs written using Arduino Software (IDE) are called sketches.
These sketches are written in the text editor and are saved with the file
extension .ino. The editor has features for cutting/pasting and for
searching/replacing text. The message area gives feedback while
saving and exporting and also displays errors. The console displays
text output by the Arduino Software (IDE), including complete error
messages and other information. The bottom righthand corner of the
window displays the configured board and serial port. The toolbar
buttons allow you to verify and upload programs, create, open, and
save sketches, and open the serial monitor.
6.FLOW CHART
                            START
                            START
                   SEARCH FOR WI-FI NETWORK
                 SEARCH FOR WI-FI NETWORK
                     CONNECT
                       CONNECTTO
                               TO WI-FI
                                  WI-FI
               FETCH COMMAND
             CONNECT         FROM SERVERTHE
                      SERVER THROUGH     BY GET
                                             API
       FETCH COMMANDS    FROM SERVER
               COMPARE COMMANDDS       BY GET REQUEST
                                 WITH REFRENCE
                            DELAY
                            DELAY
6.PROGRAM
// pins
const int s0Pin = 2; // S0 pin
const int s1Pin = 3; // S1 pin
const int s2Pin = 4; // S2 pin
const int s3Pin = 5; // S3 pin
const int outPin = 6; // OUT pin
Define
// Threshold value
const int threshold = 170;
// Variables to store RGB values
int redValue, greenValue, blueValue;
#include <Servo.h>
Servo Servo9;
Servo Servo10;
void setup() {
    // Set pins as inputs or outputs
    pinMode(s0Pin, OUTPUT);
    pinMode(s1Pin, OUTPUT);
    pinMode(s2Pin, OUTPUT);
    pinMode(s3Pin, OUTPUT);
    pinMode(outPin, INPUT);
    // Set frequency scaling to 20%
    digitalWrite(s0Pin, HIGH);
    digitalWrite(s1Pin, LOW);
    // Start serial communication
    Serial.begin(9600);
    Servo9.attach(9);
Servo10.attach(10);
    Servo9.write(0);
    Servo10.write(90);
void loop() {
// Read red value
digitalWrite(s2Pin, LOW);
digitalWrite(s3Pin, LOW);
redValue = pulseIn(outPin, LOW);
// Read green value
digitalWrite(s2Pin, HIGH);
digitalWrite(s3Pin, HIGH);
greenValue = pulseIn(outPin, LOW);
// Read blue value
digitalWrite(s2Pin, LOW);
digitalWrite(s3Pin, HIGH);
blueValue = pulseIn(outPin, LOW);
// Output RGB values to serial monitor
Serial.print("Red: ");
Serial.print(redValue);
Serial.print(" Green: ");
Serial.print(greenValue);
Serial.print(" Blue: ");
Serial.println(blueValue);
 // Check if red is less than the other two colors
 if (redValue < greenValue && redValue < blueValue && redValue
< threshold) {
     Serial.print("Red");
     delay(3*1000);
Servo10.write(150);
delay(1*1000);
Servo9.write(0);
delay(0.3*1000);
Servo9.write(90);
delay(0.3*1000);
Servo9.write(0);
delay(3*1000);
 }
 // Check if green is less than the other two colors
 else if (greenValue < redValue && greenValue < blueValue &&
greenValue < threshold) {
Serial.print("Green");
     delay(3*1000);
Servo10.write(90);
delay(1*1000);
Servo9.write(0);
delay(0.3*1000);
Servo9.write(90);
delay(0.3*1000);
Servo9.write(0);
delay(3*1000);
 }
 // Check if blue is less than the other two colors
 else if (blueValue < redValue && blueValue < greenValue &&
blueValue < threshold) {
     Serial.print("Blue");
      delay(3*1000);
Servo10.write(30);
delay(1*1000);
Servo9.write(0);
delay(0.3*1000);
Servo9.write(90);
delay(0.3*1000);
Servo9.write(0);
delay(3*1000);
 }
 // Check if no color is detected above the threshold
 else if (redValue > threshold && greenValue > threshold &&
blueValue > threshold) {
        Serial.println("No color detected");
        Servo9.write(0);
Servo10.write(90);
delay(3*1000);
    }
    delay(1000); // Delay for readability
}
7.PROJECT PHOTOCOPY
8.CONCLUSION
The suggested framework will be a demo rendition which
gives expense effective, taking less time and technically the
easiest way for differentiating objects. This framework
utilizes Arduino Uno which makes this model simple to utilize
which is more additional effective. The main failure will be
caused if the sensing of object according to color is not done.
Therefore, it is very important to have proper and checked
sensors. Further, making desirable changes it can be used in
small scale and large scale industries as well.
8.FUTURE SCOPE
  Velocity of the gadget can be
improved accounting to the speed of
manufacturing.
  The system can be used as a best
controller via adding more sensors.
  The sensor can be modified consistent
with the type of product.
  It's miles very useful in wide kinds of
industries along with the assist of PLC
and Scada, specially inside the
packaging section. Automated sorting
machine complements performance,
practicality, and protection of
operators. It ensures notable processing
Ability in addition to peerless
performance such as coloration
detection. Of course, we want to add
excessive speed dc vehicles and
sensors with considerable reaction to
hurry up the system for industrial Utlity
9.REFRENCES
1. C. Zhang and adequate. S. Suslick, "Colorimetric sensor
cluster for soda pop research", J. Agric food Chem, vol fifty 5,
pp 237-242, 2007.
2. P. D. Oram and J. Strine, "Shading estimation of a strong
dynamic pharmaceutical fixing as a guide to spotting key
gadget Parameters", J. Pharm Biomed Anal, vol forty, pp
1021-1024, 2006.
3. M. Candid, Nobert Kaiser, Wolfgang Buss, Ramona
Eberhardt, "speedy mechanical shading and characteristic
sensors, digital Imaging", pp 50-fifty seven, 1999.
4. A. Pacquit, J. Frisby, Danny Diamond, King Tong Lau, Alan
Farrell, Brid Quilty, Dermot Diamond, "improvement of a
smart bundling for the checking of fish waste", meals Chem,
vol 102, pp 466-470, 2007.
5. E. J. Cadieux Jr, "Framework and strategy for outwardly
analyzing a cigarette bundling gadget", ed: Google Patents,
2002.
6. D.J. Lee and R. S. Anbalagan, "fast robotized colorsorting
imaginative and prescient device?, in Optical Engineering
Midwest", pp 573-579, 1995.
7. J. V. Popov-Ralji, et al, "Examinations of bread introduction
with deferred staling applying instrumental estimations of
bread scrap shading", Sensors, vol nine, pp 8613-8623, 2009.
8. J. V. Popov-Ralji and J. G. Lalii-Petronijevi, "Tangible houses
and shading estimations of dietary candies with numerous
corporations at some point of ability for so long as 360 days",
Sensors, vol nine, pp 1996-2016, 2009.
9. R. Bogue, "Optical compound sensors for cutting-edge
applications", Sensor overview, vol 27, pp 86-ninety, 2007.
10. R. Baribeau, "Shading reflectance displaying making use of a
polychromatic laser expand sensor", IEEE T pattern. Butt-
centric., vol. 14, pp. 263-269, 1992.
11. H. Escid, et al., "zero.35 mm CMOS optical sensor for an
integrated transimpedance circuit", the global mag on clever
Sensing and clever systems, vol. four, no. three, pp. 467481,
September 2011.
12. Norfazlinda Binti Daud, "Use of colours sensor in a automatic
framework", Technical college Malaysia, may 2007.
13. Bickman, Josh, "Mechanized coloration-Sorting makes use
ofoptical innovation", vol. thirteen, 1996.