Professional Documents
Culture Documents
BACHELORS OF ENGINEERING
in
ELECTRONICS AND COMMUNICATION
PROJECT ASSOCIATES
Abhishek R S 4BD18EC002
Meetha M Belludi 4BD18EC056
Udayakumar D 4DB18EC116
Vinutha K L 4BD18EC120
Dr. K. G. Avinash
Ph.D., MIEEE., MIETE., MISTE., MIE.
Project Guide
1
BAPUJI INSTITUTE OF ENGINEERING AND TECHNOLOGY
DAVANGERE, KARNATAKA – 577004
Certificate
Certified that the Mini Project work entitled “COLORED BASED SORTING
ROBOT” carried out by, Mr. ABHISHEK R S, USN 4BD18EC002, Ms. MEETHA M
BELLUDI, UDB 4BD18EC056, Mr. UDAYAKUMAR D USN 4BD18EC116, Ms.
VINUTHA K L, USB 4BD18EC120, bonafide students of this institution in partial fulfilment
for the award of degree of Bachelor of Engineering in Electronics & Communication by
Visvesvaraya Technological University, Belgaum during the academic year 2020-21. It is
certified that all corrections / suggestions indicated for internal assessment have been
incorporated in the report.
____________________
Dr. K. G. Avinash
Ph.D., MIEEE., MIETE., MISTE., MIE.
Project Guide
________________________ ____________________________
Dr. G.S. Sunitha Dr. H.B. Aravind
M. Tech(DEAC), Ph.D., MISTE, FIETE, FIE M.E(Env), Ph.D(Env)., FIE, MISTE, FIEE
2
Vison of the Institute
“To be a center of excellence recognizing nationally and
internationally, in distinctive areas of engineering education and
research, based on a culture of innovation and excellence”
3
AKNOWLEDGEMENT
ABHISHEK R S
MEETHA M BELLUDI
UDAYAKUMAR D
VINUTHA K L
4
ABSTRACT
5
LIST OF FIGURES
1. Block Diagram 9
2. Flow chart 10
3. Arduino Nano 11
4. Color sensor 12
5. Servo motor 12
6. Circuit Diagram 14
7. Result of the system 16
9. Sensor Pinout 26
10. Servo motor Dimensions 29
11. Arduino nano Pinout 31
LIST OF TABLES
1 Photodiode type (color) selection 27
2 Temperature Grade Identification 32
6
TABLE OF CONTENT
ABSTRACT
1.INTRODUCTION
2.METHODOLOGY
2.1 BLOCK DIAGRAM
2.2 FLOW CHART
3.DESIGN
3.1HARDWARE REQUIREMENTS
3.2 SOFTWARE REQUIREMENTS
3.3 CIRCUIT DIAGRAMS AND CONNECTIONS
3.4 STEPS TO OPERATE SYSTEM
4.RESULT DISCUSSIONS
4.1 APPLICATIONS
4.2 ADVANTAGES
4.3 DISADVANTAGES
5. DISCUSSIONS
5.1 CONCLUSION
5.2 FUTURE SCOPE
5.3 REFRENCES
APPENDIX
• CODE
• DATA SHEET
CHAPTER 1
7
INTRODUCTION
8
CHAPTER 2
METHODOLOGY
2.1 BLOCK DIAGRAM
• All we need for this project is one color sensor and two hobbyist servo
motors, which makes this project quite simple but yet very fun to build it.
• In the first place, using the solid works 3D modeling software we made
the design of the color sorter and here’s its working principle.
• Initially, the colored skitters which are held in the charger drop into the
platform attached on the top servo motor.
• Then the servo motor rotates and brings the skittle to the color sensor
which detects its color.
9
• After that the bottom servo motor rotates to the particular position and
then the top servo motor rotates again till the skittle drop into the guide
rail.
In start robot will take its home position then color sensor detects the object’s
color with the help of microcontroller. If detected color is true means no specified
color object then robotic arm will remain its position. When color is false means
desired color is detected then robot will rotate from its position towards object
location, drop it to specified place and returns to its original position until other
color is detected.
10
CHAPTER 3
DESIGN
3.1 HARDWARE REQUIREMENTS
11
3.1.2 Arduino Nano:
Servo means to an error sensing feedback control that is used for correcting the
performance of any type of system. Basically, servo motors are DC motors as
shown in Figure 8 that are equipped with a servo mechanism for the purpose of
controlling precise angular position. These motors usually have a rotation limit
ranging from 90° to 180°. But the drawback is that servos do not rotate
continually to perform certain tasks. The rotation of these motors is restricted in
between the fixed angles. So, the Servos are also used for precision positioning.
There are most applications where servos are used such as in robotic arms and
legs, sensor scanners, RC airplanes etc.
Arduino IDE:
Arduino IDE is opensource software that is mainly used for writing and
compiling the code into the Arduino Module.
• It is an official Arduino software, making code compilation
too easy that even a common person with no prior technical
knowledge can get their feet wet with learning process.
• It is easily available for the operating systems like MAC
Windows, Linux and runs on the java platform that comes
within built commands and functions that play a vital role for
debugging, editing and compiling the code in the
environment.
• A range of Arduino modules available including Arduino
Uno, Arduino Mega, Arduino Leonardo, Arduino Micro and
many more.
• Each of them contains a microcontroller on the board that use
actually programmed and accepts the information in the form
of code.
• The main code, also known as a sketch, created on the IDE
platform will ultimately generate a Hex file which is then
transferred and uploaded in the controller on the board.
• The IDE environment mainly contains two basic parts: Editor
and compiler where former is used for writing the required
code and later is used for compiling and uploading the code
into the given Arduino module.
• This environment supports both C and C++ languages.
13
3.3 CIRCUIT DIAGRAM AND CONNECTIONS
Connections:
• Connect the sensor pin Vcc to +5v of Arduino nano and Ground made as
common including Servo motors also.
• Connect the input and output pins of color sensor S0, S1, S2, S3 to
Arduino nano’s digital input and output pins start from D2 to D5
respectively and OUT pin is connected to D6 of Arduino nano.
• Connect the +5v pin of each servo motor to Power supply of the external
USB cable and made ground as common to Arduino nano.
• The signal pin of top and bottom servo motor is connected to pin no. D7
and D8 respectively.
14
2.4 STEPS TO OPERATE THE SYSTEM
15
CHAPTER 4
According to the shading primarily based the gadgets are selected and hauled to
the predetermined field. Those which can be to be isolated can be reinforced into
the box. A shading sensor detects the subjects coming in its sight and code for the
equal is coded in Arduino in order that solitary the quality article colorings are
detected and accumulated within the times toward the give up making use of
servo engines. On the issue at the same time as any shading from red,
inexperienced or blue is saved for location earlier than the shading sensor then
the correct shading drove is have become on and the yield of the detecting of
shading is seen. Initially, we hold completed for the opportunity shading which
location is seemed in p the inexperienced shading paper over the shading sensor,
it acknowledges and turns the drove on and in addition, method is completed for
the opportunity shades.
Fig.4.1Result of system
16
4.1 APPLICATIONS
➢ Color sorters are machines that are used on the production lines in bulk
food processing and other industries. They separate items by their colors,
detecting the colors of things that pass before them, and using mechanical
or pneumatic ejection devices to divert items whose colors do not fall
within the acceptable range or which are desired to form a separate group
from the rest.
➢ Color sorters are mostly used in sorting grain (agricultural products). The
rice sorting industry is the first big market, the rice sorting technology is
according to the color differences of rice (husked paddy) materials, using
a high –resolution CCD or CMOS optical line sensors to separate different
stones, black rice, etc. Effectiveness of the system determines the time
consumed against volume and also need for resorting.
➢ The second sorting market is in use for coarse cereals, such as wheat, corn,
peanut, different kinds of beans, sesame seeds, etc. Sorting machines
improve product quality and add social benefits.
➢ Color sorters are used for food processing industry, such as coffee, nuts,
and oil crops. The goal is the separation of items that are discolored.
4.2 ADVANTAGES
Color Sorter machine is an automated technology which helps in achieving the
required uniform color and texture thereby imparting quality to the products. It
works by scanning a line of grains through a very high-speed camera and ejecting
t`he impurities and low-quality grains by pneumatic pressure. This process sorts
the grains into two parts i.e., accepted (which can be marketed) and rejected
(which can be used for other purposes like animal fodder). The befits of color
sorter machines can be summarized as follows:
• Quality: Color Sorter machines have revolutionized quality in Food products.
Manufacturers can easily monitor the quality of the products and easily launch
those in the market.
• Control: Manufacturers can easily decide and change the extent of color and
texture difference to reject. This gives them an added control over the
products, for example sorting the item into multiple categories.
• Speed: Color Sorter machine is automated and does treated the quality check
speed. In-fact it speeds-up the overall quality assurance process by removing
human effects such as fatigue and strike.
• Return on investment (ROI): Color Sorter machines have an excellent ROI
as they are near to one-time investment and require low maintenance.
17
• Labour: Automated machines reduce labour cost and management issues. Also
it shortens the accepted error margin to a large extent which mainly comprises
human errors.
4.3 DISADVANTAGES
18
CHAPTER 5
DISCUSSIONS
5.1 CONCLUSION
The system has been successfully designed and it has the capability to rotate
3600 and handle the required task. It can take specific colored object, hold it
and put it to a particular station even to some height using RGB color sensor.
Color sensing section performed two main tasks; object’s detection and color
recognition. System is fully remote controlled and can pick objects of 1kg
weight approximately. The cost-effective system was designed to perform the
continuous and reliable tasks without human errors using the simplest
concepts. The robotic sorting systems are useful in industries and different
household activities. Since this system is mainly controlled by the PIC
Microcontroller, the results obtained are more reliable and faster.
This Robotic model can be Modified with moveable arm which sort the items
just like a Human who can sort by seeing the items using their hands. Which
can be implemented by using some robotic machinery components like DC
motor, which is also include the series of joins, articulations and manipulators
that work together to closely resemble the motion and functionality of a human
arm (at least from a purely mechanical perception). A programable robotic arm
can be a complete machine in and of itself, or it can function as an individual
robot part of a large and more complex piece of equipment.
A great many smaller robotic arms are used in countless industries and
workplace applications to sort the food grains, remove the waste in it or separate
the items by their size.
19
5.3 REFRENCES
[1] LIM JIE SHEN*, IRDA HASSAN “Design and Development of Color
Sorting Robot” EURECA 2014 Special Issue January (2015).
[2] http://www.mouser.com/catalog/specsheets/TCS3200-E11.pdf
[3] Aji Joy “Object Sorting Robotic Arm Based on Color Sensing”
International Journal of Advanced Research in Electrical, Electronics and
Instrumentation Engineering Vol. 3, Issue 3, March 2014.
[4] Dhanoj M, Reshma K V, Sheeba V, Marymol P “Color Sensor Based
Object Sorting Robot Using Embedded System” International Journal of
Advanced Research in Computer and Communication Engineering vol. 4,
Issue 4, April 2015.
[5] Abhishek Kondhare, Garima Singh, Neha Hiralkar , M.S.Vanjale “Colour
And Shape Based Object Sorting” International Journal Of Scientific
Research And Education ||Volume||2||Issue|| 3 ||Pages|553-562||2014|| ISSN
(e): 2321-7545.
[6] Li qiaoyi “Study on Color Analyzer Based on the Multiplexing of
TCS3200 Color Sensor and Microcontroller” ijhit Vol 7, no 5 (2014).
20
CODE
#include <Servo.h>
#define S0 3
#define S1 2
#define S2 4
#define S3 5
#define sensorOut 6
Servo topServo;
Servo bottomServo;
int frequency = 0;
int color=0;
void setup() {
pinMode(S0, OUTPUT);
pinMode(S1, OUTPUT);
pinMode(S2, OUTPUT);
pinMode(S3, OUTPUT);
pinMode(sensorOut, INPUT);
// Setting frequency-scaling to 20%
digitalWrite(S0, HIGH);
digitalWrite(S1, LOW);
topServo.attach(7);
bottomServo.attach(9);
Serial.begin(9600);
}
void loop() {
topServo.write(140);// 130 - angel rotation
delay(500);
for(int i = 135; i > 90; i--) {
topServo.write(i);
21
delay(5);//between tube to sensor
}
delay(500);// reading delay
color = readColor();
delay(100);
switch (color) {
case 1:
bottomServo.write(50);
break;
case 2:
bottomServo.write(95);
break;
case 3:
bottomServo.write(145);
break;
case 0:
break;
}
delay(500);
for(int i = 45; i > 25; i--) {
topServo.write(i);
delay(10);
}
delay(500);//dropping delay
for(int i = 40; i < 10; i++) {
topServo.write(i);
delay(100);
}
color=0;
22
}
// Custom Function - readColor()
int readColor() {
// Setting red filtered photodiodes to be read
digitalWrite(S2, LOW);
digitalWrite(S3, LOW);
// Reading the output frequency
frequency = pulseIn(sensorOut, LOW);
int R = frequency;
// Printing the value on the serial monitor
Serial.print("R= ");//printing name
Serial.print(frequency);//printing RED color frequency
Serial.print(" ");
delay(100);
// Setting Green filtered photodiodes to be read
digitalWrite(S2, HIGH);
digitalWrite(S3, HIGH);
// Reading the output frequency
frequency = pulseIn(sensorOut, LOW);
int G = frequency;
// Printing the value on the serial monitor
Serial.print("G= ");//printing name
Serial.print(frequency);//printing RED color frequency
Serial.print(" ");
delay(100);
// Setting Blue filtered photodiodes to be read
digitalWrite(S2, LOW);
digitalWrite(S3, HIGH);
// Reading the output frequency
23
frequency = pulseIn(sensorOut, LOW);
int B = frequency;
// Printing the value on the serial monitor
Serial.print("B= ");//printing name
Serial.print(frequency);//printing RED color frequency
Serial.println(" ");
delay(500);// serial monitoring delay
if(R>67& R<70 & G>104 & G<115 & B>95&B<100)
{
color = 1; // Red
}
if(R>82 & R<84 & G>107 & G<114 & B>89 &B<90)
{
color = 2;//blue
}
if(R>52 & R<63 & G>69 & G<76 & B>78 &B<87)
{
color = 3;//yellow
}
return color;
}
24
DATA SHEET
TCS3200
Description
APPLICATION INFORMATION
25
• Output interface
The output of the device is designed to drive a standard TTL or CMOS
logic input over short distances. If lines greater than 12 inches are used on
the output, a buffer or line driver is recommended. A high state on Output
Enable (OE) places the output in a high-impedance state for multiple-unit
sharing of a microcontroller input line.
• Power down
Powering down the sensor using S0/S1 (L/L) will cause the output to be
held in a high-impedance state. This is similar to the behaviour of the
output enable pin, however powering down the sensor saves significantly
more power than disabling the sensor with the output enable pin.
• Photodiode type (color) selection
The type of photodiode (blue, green, red, or clear) used by the device is
controlled by two logic inputs, S2 and S3.
26
short periods of time. Integration (the accumulation of pulses over a very long
period of time) can be used to measure exposure, the amount of light present in
an area over a given time period.
Tiny and lightweight with high output power. Servo can rotate approximately
180 degrees (90 in each direction), and works just like the standard kinds but
smaller. You can use any servo code, hardware or library to control these
servos. Good for beginners who want to make stuff move without building a
motor controller with feedback & gear box, especially since it will fit in small
places. It comes with 3 horns (arms) and hardware.
Specifications
• Weight: 9 g
• Dimension: 22.2 x 11.8 x 31 mm approx.
• Stall torque: 1.8 kgf・cm
• Operating speed: 0.1 s/60 degree
• Operating voltage: 4.8 V (~5V)
• Dead band width: 10 μs
• Temperature range: 0 oC – 55 oC
The TP SG90 is similar in size and weight to the Hitec HS-55, and is a good
choice for most park flyers and helicopters. Hobbyists from around the world has
used the SG90 on famous planes like GWS Slow Stick, E-Flite Airplanes, Great
Planes, Thunder Tiger, Align, EDF jets and more. If you are looking for a servo
that won't break your arm or leg, this is the perfect choice for you!
The TP SG90 servo weighs 0.32 ounces (9.0 grams). Total weight with wire
and connector is 0.37 ounces (10.6 grams). The TP SG90 has the universal "S"
type connector that fits most receivers,
including Futaba, JR, GWS, Cirrus, Blue Bird, Blue Arrow, Corona, Berg
and Hitec. The wire colors are Red = Battery(+) Brown = Battery(-) Orange =
Signal
TP SG90 Specifications:
Dimensions (L x W x H) = 0.86 x 0.45 x 1.0 inch (22.0 x 11.5 x 27 mm)
Weight = 0.32 ounces (9 grams)
Weight with wire and connecter = 0.37 ounce (10.6 grams)
Stall Torque at 4.8 volts = 16.7 oz/in (1.2 kg/cm)
Operating Voltage = 4.0 to 7.2 volts
Operating Speed at 4.8 volts (no load) = 0.12 sec/ 60 degrees
Connector Wire Length = 9.75 inches (248 mm)
• DIMENSION: 26mm*13mm*24mm
• WEIGHT: 9G
• OPERATING SPEED: 0.12sec/60degree(4.8V);0.11sec/60degree(6V)
• STALL TORQUE: 1.2kg/cm or 17oz-in. (4.8V) 1.6kg/cm or 22oz-in.(6.0V)
• OPERATING VOLTAGE: 4.8V~6.0V
• FEATURE: 3 pole wire, all nylon gear, connector wire length: 15cm
Dimension: 23x12.2x29mm
Torque: 1.5kg/cm (4.8V)
Operating speed: 0.10sec/60 degree 0.09sec/60 degree (6.0V)
Operating voltage: 4.8V
Temperature range: 0-55C
Dead band-width: 7us
Lead Length: 260mm
28
Figure: Servo motor SG90 Dimensions.
ATmega328P Processor:
Features
● High performance, low power AVR® 8-bit microcontroller
● Advanced RISC architecture
● 131 powerful instructions – most single clock cycle execution
● 32 8 general purpose working registers
● Fully static operation
● Up to 16MIPS throughput at 16MHz
● On-chip 2-cycle multiplier
● High endurance non-volatile memory segments
● 32K bytes of in-system self-programmable flash program memory
● 1Kbytes EEPROM
● 2Kbytes internal SRAM
● Write/erase cycles: 10,000 flash/100,000 EEPROM
● Optional boot code section with independent lock bits
● In-system programming by on-chip boot program
● True read-while-write operation
● Programming lock for software security
● Peripheral features
● Two 8-bit Timer/Counters with separate prescaler and compare mode
● One 16-bit Timer/Counter with separate prescaler, compare mode, and
capture mode
● Real time counter with separate oscillator
● Six PWM channels
● 8-channel 10-bit ADC in TQFP and QFN/MLF package
29
● Temperature measurement
● Programmable serial USART
● Master/slave SPI serial interface
● Byte-oriented 2-wire serial interface (Phillips I2
C compatible)
● Programmable watchdog timer with separate on-chip oscillator
● On-chip analog comparator
● Interrupt and wake-up on pin change
● Special microcontroller features
● Power-on reset and programmable brown-out detection
● Internal calibrated oscillator
● External and internal interrupt sources
● 23 programmable I/O lines
● 32-lead TQFP, and 32-pad QFN/MLF
● Operating voltage:
● 2.7V to 5.5V for ATmega328P
● Temperature range:
● Automotive temperature range: –40°C to +125°C
● Speed grade:
● 0 to 8MHz at 2.7 to 5.5V (automotive temperature range: –40°C to +125°C)
● 0 to 16MHz at 4.5 to 5.5V (automotive temperature range: –40°C to +125°C)
● Low power consumption
● Active mode: 1.5mA at 3V - 4MHz
● Power-down mode: 1µA at 3V
Pin Descriptions
1.1.1 VCC
Digital supply voltage.
1.1.2 GND
Ground.
1.1.3 Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected
for each bit). The Port B output buffers have symmetrical drive characteristics
with both high sink and source capability. As inputs, port B pins that are
externally pulled low will source current if the pull-up resistors are activated.
The Port B pins are tri-stated when a reset condition becomes active, even if the
clock is not running.
Depending on the clock selection fuse settings, PB6 can be used as input to the
inverting oscillator amplifier and input to theinternal clock operating circuit.
Depending on the clock selection fuse settings, PB7 can be used as output from
the inverting oscillator amplifier.
30
If the internal calibrated RC oscillator is used as chip clock source, PB7.6 is
used as TOSC2.1 input for the asynchronous Timer/Counter2 if the AS2 bit in
ASSR is set.
1.1.4 Port C (PC5:0)
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected
for each bit). The PC5.0 output buffers have symmetrical drive characteristics
with both high sink and source capability. As inputs, Port C pins that are
externally pulled low will source current if the pull-up resistors are activated.
The port C pins are tri-stated when a reset condition becomes active, even if the
clock is not running.
1.1.5 PC6/RESET
If the RSTDISBL fuse is programmed, PC6 is used as an input pin. If the
RSTDISBL fuse is unprogrammed, PC6 is used as a reset input. A low level on
this pin for longer than the minimum pulse length will generate a reset, even if
the clock is not running. The minimum pulse length is given in Table 28-4 on
page 261. Shorter pulses are not guaranteed to generate a reset.
31
1.1.6 Port D (PD7:0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected
for each bit). The port D output buffers have symmetrical drive characteristics
with both high sink and source capability. As inputs, port D pins that are
externally pulled low will source current if the pull-up resistors are activated.
The port D pins are tri-stated when a reset condition becomes active, even if the
clock is not running.
1.1.7 AVCC
AVCC is the supply voltage pin for the A/D converter, PC3:0, and ADC7:6. It
should be externally connected to VCC, even if the ADC is not used. If the
ADC is used, it should be connected to VCC through a low-pass filter. Note that
PC6.4 use digital supply voltage, VCC.
1.1.8 AREF
AREF is the analog reference pin for the A/D converter.
1.1.9 ADC7:6 (TQFP and QFN/MLF Package Only)
In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D
converter. These pins are powered from the analog supply and serve as 10-bit
ADC channels.
1.2 Disclaimer
Typical values contained in this datasheet are based on simulations and
characterization of actual ATmega328P AVR microcontrollers manufactured on
the typical process technology. automotive min and max values are based on
characterization of actual ATmega328P AVR microcontrollers manufactured on
the whole process excursion (corner run).
1.3 Automotive Quality Grade
The ATmega328P have been developed and manufactured according to the
most stringent requirements of the international standard ISO-TS-16949. This
data sheet contains limit values extracted from the results of extensive
characterization (temperature and voltage). The quality and reliability of the
ATmega328P have been verified during regular product qualification as per
AEC-Q100 grade 1. As indicated in the ordering information paragraph, the
products are available in only one temperature.
32