thesis yeow khang yung b020710140 - welcome to universiti...

24
i COLOR SORTING SYSTEM WITH ROBOT ARM YEOW KHANG YUNG May 2011

Upload: buique

Post on 18-Mar-2019

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

i

COLOR SORTING SYSTEM WITH ROBOT ARM

YEOW KHANG YUNG

May 2011

Page 2: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

i

SMART COLOR SORTING ROBOT

YEOW KHANG YUNG

This report is submitted in partial fulfillment of the requirements for the award of the

Bachelor of Electronic Engineering (Wireless Communication)

Faculty of Electronic and Computer Engineering

University Technical Malaysia Melaka

May 2011

Page 3: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

ii

UNIVERSTI TEKNIKAL MALAYSIA MELAKA

FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

BORANG PENGESAHAN STATUS LAPORAN

PROJEK SARJANA MUDA II

Tajuk Projek : ………………………………………………………………………………

Sesi

Pengajian :

Saya …………………………………………………………………………………………………..

(HURUF BESAR)

mengaku membenarkan Laporan Projek Sarjana Muda ini disimpan di Perpustakaan dengan syarat-

syarat kegunaan seperti berikut:

1. Laporan adalah hakmilik Universiti Teknikal Malaysia Melaka.

2. Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja.

3. Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaran antara institusi

pengajian tinggi.

4. Sila tandakan ( √ ) :

SULIT*

*(Mengandungi maklumat yang berdarjah keselamatan atau

kepentingan Malaysia seperti yang termaktub di dalam AKTA

RAHSIA RASMI 1972)

TERHAD**

**(Mengandungi maklumat terhad yang telah ditentukan oleh

organisasi/badan di mana penyelidikan dijalankan)

TIDAK TERHAD

Disahkan oleh:

__________________________ ___________________________________

(TANDATANGAN PENULIS) (COP DAN TANDATANGAN PENYELIA)

Page 4: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

iii

“I hereby declare that this report is the result of my own except for quotes as cited in

the references”

Signature :

Author : Yeow Khang Yung

Date :

Page 5: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

iv

“I hereby declare that I have read this report and in my opinions this report is

sufficient in terms of the scope and quality for the award of Bachelor of Electronic

Engineering (Wireless Communication)”

Signature :

Author : Madam Nurmala Irdawaty Binti Hassan

Date :

Page 6: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

v

ACKNOWLEDGEMENT

First and foremost, I would like to express my most sincere gratitude to my

supervisor, Madam Nurmala Irdawaty Binti Hassan for her guidance, support and

encouragement throughout this project. Her vast experience and deep knowledge of the

subject proved to be immense help to me. Without her endless support and motivation,

this project definitely cannot be done.

Secondly, I would like to say thanks to my parents for their support and

understanding in allowing me to focus my attention to this project. They have always

been the driving force in pushing us to excel in everything that I do.

Besides that, many thanks are given to my fellow course mates and friends, who

have gave me support physically or mentally in which their assistance helped me along

the way. I am very grateful for their support, endurance, inspiring spirit and patience they

had given throughout my study.

Finally, I would also like to extend our utmost gratitude to all the lecturers of

University Technical Malaysia Malacca (UTeM) for their guidance and patience. Their

teachings have thought me that education and knowledge are vital in life if we wish to

succeed.

Page 7: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

vi

ABSTRACT

Color sorting system is one of the useful systems in Industrial. It can be used

to differentiate item based on the color of the item itself. This system is implemented

to improve the process of the industrial. Traditionally, the color sorting process is

done by the operator manually. However, this method has some shortage such as

increase the cost of the product, slow, and inaccuracy due to the human mistake.

“Color Sorting System with Robot Arm” is a solution to this problem. Color Sorting

System with Robot Arm will be operated using Programmable Interface Controller

(PIC). For the color detecting part, it will use the Light Dependent Resistor (LER) as

a sensor to detect the color of the object. The most significant part of this project is to

have a robot arm. This robot arm is function to pick and place, and its gripper can

move in a circular path. Since this system is mainly controlled by the PIC

microcontroller, the result of the sorting process will be more reliable and faster.

Page 8: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

vii

ABSTRAK

Sistem pembezaan warna merupakan satu sistem yang amat berguna dalam

industri. Sistem ini boleh digunakan untuk membezakan object berdasakan warna

object itu sendiri.Sistem ini digunakan untuk menambah baik proses industri.

Biasanaya, process pembezaan warna ini dijalankan oleh operator secara

bertangan.Namun, cara ini mempunyai keburukan seperti meningkatkan kos, lambat,

dan mudah salah disebabkan kecuaian manusia. "Color Sorting System With Robot

Arm" merupakan penyelesaian kepada masalah ini. Sistem ini beroperasi

menggunakan Programmable Interface Controller, atau yang lebih dikenali sebagai

PIC teknologi.Perintang bergantung cahaya akan digunakan untuk mengesan warna

sesuatu objek itu. Bahagian terpenting dalam sistem ini ialah sistem ini mempunyak

satu tangan jentera yang mampu mengutip dan melepas, dan tangan jentera ini mampu

bergerak dalam satu bulatan. Disebabkan sistem ini dikawal oleh PIC teknologi,

keputusan yang diberi oleh sistem ini adalah sangat tepat dan cepat.

Page 9: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

viii

TABLE OF CONTENTS

CHAPTER TITLE PAGE

TITLE OF PROJECT i

STATUS CONFIRMATION FORM ii

DECLARATION iii

ACKNOWLEDGEMENT iv

ABSTRACT v

ABSTRAK vi

TABLE OF CONTENTS viii

LIST OF FIGURES ix

LIST OF ABBREVIATION x

LIST OF APPENDICES xi

I INTRODUCTION 1

1.1 Project Background 1

1.2 Objectives 3

1.3 Scope of Work 3

1.4 Problem Statement 4

1.5 Significant of Project 5

1.6 Report Structure 6

II LITERATURE REVIEW 7

Page 10: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

ix

2.1 Programmable Interface Controller (PIC) 7

2.2 Infra Red Sensor 12

2.3 Servo motor 14

2.4 Transistor 18

2.5 Voltage Regulator 20

2.6 Color Sensor 21

2.7 C Programming Language 26

2.8 C Language Complier 27

III METHODOLOGY 28

3.1 Project Methodology 29

3.2 The flow chart of project 30

3.3 Apparatus used in the project 31

3.3.1 Enhanced 40 pins PIC start-up kit 31

3.3.2 Complier and Programmer 32

IV RESULT AND DISCUSSION 34

4.1 Result 35

4.1.1 The Overall Colour Sorting System 35

4.1.2 The PIC16F877A Circuit Board 36

4.1.3 The Robot Arm 39

4.1.4 The Control Panel 41

4.1.5 The Manual Controller 42

4.1.6 The C Programming of the System 44

4.2 Discussion 49

Page 11: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

x

V CONCLUSION AND RECOMMENDATION 52

5.1 Conclusion 52

5.2 Recommendation 53

REFERENCES 54

APPENDIX 55

Page 12: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

xi

LIST OF FIGURES

NO TITLE PAGE

Figure 1.1 The Overview of the Color Sorting System 2

Figure 2.1 The Different Shape, Size and Type of PIC Chip 8

Figure 2.2 The Basic Microcontroller Architecture Inside a PIC

Chip.

9

Figure 2.3 The Electronic Circuit Board for PIC Microcontroller. 9

Figure 2 4 PIC16F877A With Rectangular Shape and 40 DIP Type

Pin

10

Figure 2.5 The Function of Each 40 Pins of PIC16F877A 11

Figure 2.6 The Features of PIC16F877A. 11

Figure 2.2.1 The Frequency Spectrum 12

Figure 2.2.2 The Infrared Modulated at 36kHz. 13

Figure 2.2.3 The Modulated Infrared Demodulated At Receiver. 13

Figure 2.2.4 The Schematic Circuit for the Infrared Sensor 13

Figure 2.2.5 The Typical Example of Infrared Component 14

Figure 2.3.1 The Typical Servo Motor. 16

Figure 2.3.2 Servo Motor Part 16

Page 13: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

xii

Figure 2.3.3 The Block Diagram for Typical Servo Motor 17

Figure 2.3.4 Servo Motor postion and the control signal. 17

Figure 2.4.1 The schemetic for NPN and PNP transistor. 18

Figure 2.4.2 The Transistor Act As Electronic Switch. 19

Figure 2.4.3 The I-V Graph For A Transistor. 19

Figure 2.5.1 The LM7805 Voltage Regulator. 20

Figure 2.6.1 The Operation of Photoresistor 22

Figure 2.6.2 The Photoresistor 22

Figure 2.6.3 The Installation of the LED on the Breadboard 23

Figure 2.6.4 The Surface of the Object Reflect the Light Incident on it. 24

Figure 2.6.5 The Blue Surface Will Reflect More Blue Light 24

Figure 2.7.1 The Trademark Logo for CCS C Compiler 26

Figure 3.3.1.1 The SK40C Enhanced 40 Pins PIC Start-up Kit 31

Figure 3.3.1.2 The Solder SK40C on the breadboard 32

Figure 3.3.2.1 The screenshot of CCS C Compiler 33

Figure 3.3.2.2 The UIC00A USB ICSP PIC Programmer 33

Figure 4.1.1.1 The Overall Colour Sorting System with Robot Arm. 35

Figure 4.1.2.1 The Schematics of the Circuit 36

Figure 4.1.2.2 The PCB Layout Of the Circuit. 37

Figure 4.1.2.3 The 3D Visualization Of The PCB Circuit. 37

Figure 4.1.2.4 The Final Real Circuit Board. 38

Figure 4.1.3.1 The Robot Arm. 39

Page 14: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

xiii

Figure 4.1.3.2 The Robot Arm Moving Up And Down. 40

Figure 4.1.3.3 The Robot Gripper Open and Close. 40

Figure 4.1.4.1 The Control Panel. 41

Figure 4.1.5.1 The Manual Controller. 42

Figure 4.1.5.2 The Input Codes And The Description. 43

Figure 4.1.5.3 The Controller with input code of ‘110’. 43

Page 15: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

xiv

LIST OF TABLES

NO TITLE PAGE

Table 2.5.1 The LM Series Voltage Regulator And The Ouput

Voltage.

20

Table 4.1.2.1 The Basic Component In The Circuit. 35

Page 16: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

1

CHAPTER I

INTRODUCTION

This chapter will briefly discuss on the project overview. The objective, scope,

and thesis outline will be presented in this chapter.

1.1 Project Background

Color Sorting System with Robot Arm is based on the placing system with some

capability to decide the object according to their color. The object will be defined by

determining color of the object while the system will figure which location the object

should be located. This system use Programmable Interface Controller (PIC) to control

the whole system.

There are four main parts in this system:

� robot arm

� ball tower

� color sensor

� ball collection station

Firstly, a manually feed object will be determined by the robot. The gripper of the robot

will pick up the object and place it to a color differentiating station. The color

Page 17: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

2

differentiating station consists of a Light Dependent Resistor (LDR) which will detect the

light reflected by the object. By comparing the reflected light value with the calibrated

value stored in the PIC data base, the PIC controller will process the data and determine

the color of the object.

After determining the color of the object, the gripper of the system will pick up the

ball and move it to the desire color station. There are four three color station in this

system, there are red station, green station, and blue station. Depending on the color of

the object, the gripper will move the object to the correct destination and place the object

inside that station.

Figure 1.1: The Overview of the Color Sorting System

The operation of whole system is as below:

1. The ball tower detects the existence of the ball.

2. The robot arm move it gripper to that ball and pickup the ball.

3. The robot arm sends the ball to the color sensor station.

4. The color sensor station will determine the color of the ball.

5. The robot arm will move the ball to appropriate ball collection station based

on the result produce by color sensor station.

6. The robot arm returns to its original place, and repeat the whole process if

there is another ball in the ball-tower station.

Page 18: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

3

1.2 OBJECTIVE

This project is developed with the purposed to optimizing the productivity,

minimizing the cost of the project and make no human mistakes. The main thing of this

project is to study how to use the programming language to communicate with the PIC

controller. After determining the color of the object, the robot arm system will make its

own decision to the station that been programmed. The objective can be summarized as

below:

i. To sort the object according to their color.

ii. To sort the object to the station accordingly.

iii. To make the system run continuously with less rest.

iv. To make an interface between the programming of robot arm and the sensors.

v. To make the robot’s gripper has the function of pick and place.

vi. To make the robot capable to stop at the desire location accurately.

1.3 SCOPE OF PROJECT

This project is subjected to several scope and limitations that are narrowed down

to the study. There are a few scopes and guidelines listed to ensure the project is

conducted within its intended boundary. This is to ensure the project is heading in the

right direction to achieve its intended objectives. The objectives are:

i. Research and study on the Programmable Intelligence Computer,

PIC16F876A microcontroller and the control system of the circuit.

ii. Research and study on C programming language to communicate with the

microcontroller.

iii. Research and study on the Light Dependent Resistor for color sensor.

iv. Research and study on the Infra Red transmitter and receiver for proximity

sensor.

v. To design circuitry for the overall system.

Page 19: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

4

vi. To fabricate a PCB circuit board for the overall system.

vii. To develop the program that can integrate and control the overall system.

viii. To construct the model and test either the robot is function or not.

1.4 PROBLEM STATEMENT

The problems which often occurred in the industrial that can be solved by this project

are:

i. The speed of color sorting process by an operator is very slow. This is due to

the limitation of response time for a human eye. The eye will always take

some time to see an image and project this to the brain to initiate visual

sensation. After the brain has received the image, it will take some time for the

brain to determine the color of the object too. However, this limitation can be

covered by using a computer. In this project, a PIC microcontroller is used to

increase the speed of color sorting.

ii. The accuracy of color sorting process by an operator is very slow. This is

because an operator will need to handle hundred or thousand of object each

day, they will feel boring and their eyes are tired after a long day working. It

was a very common case for an operator to give wrong result. However, a

machine will not have this problem. A machine will give accurate result even

after it has repeated a process for billions of times. In this project, a PIC

microcontroller was used to substitute the operator and thus increase the

accuracy of color sorting

iii. The implementation cost for a color sorting process using the operator is very

high. This is because the work load for an operator is very low. If an industry

needs to sort a bulk quantity of product, they have to recruit many workers,

implement shift and overtime system for the workers. This will definitely

increase the cost of a product. In this project, a color sorting system was

designed so that to increase the process time, increase the process accuracy,

Page 20: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

5

and cut-down the cost of process of color sorting. This project should overall

optimize the productivity of an industrial

1.5 SIGNIFICATION OF THE PROJECT

i. This project will increase the speed of color sorting process.

ii. This project will increase the accuracy color sorting process.

iii. This project will cut-down the cost of color sorting process.

iv. This project will overall optimize the productivity of an industrial

v. This project will have a robot arm which can perform an action which is closer

to human action.

1.6 REPORT STRUCTURE

Chapter one briefly introduces he overall of the project title Smart Color

Sorting Robot. The introduction consists of overview, objective, problem statement,

scope of work, methodology and structure report.

Meanwhile chapter two discuss the literature review about the Color Sorting

System with Robot Arm. Literature review will produce overall structure of the

system which shows the relationship between project research and theoretical concept.

Chapter three will explain about the project methodology. Project

methodology give details about the method used to solve the problem to complete the

project. The method used such as collecting data method, process and analysis data

method, modeling and etc.

Chapter four consists of result and discussion of the project, finding and

analysis throughout the research and project development.

Page 21: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

6

Lastly, chapter five is the project conclusion. This chapter rounds up the

attained achievement of the whole project and reserves suggestions for possible future

researches.

Page 22: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

7

CHAPTER II

LITERATURE REVIEW

This chapter is to discuss some fundamental ideas of Color Sorting System

with Robot Arm. The features of this project are also included. All components using

for this project will be explain as well.

2.1 PROGRAMMABLE INTERFACE CONTROLLER (PIC)

Microcontrollers were introduced when the skills of the semiconductor

industry allowed several functions such as CPU, memory and I/) to be integrated onto

one piece of silicion [4].. The advantage of designing around a microcontroller is that

a large amount of electronics needed for certain applications can be eliminated. This

makes it the ideal device for use with mobile robots and other applications where

computing power is needed. The microcontroller is popular because the chip can be

reprogrammed easily to perform different functions, and is very inexpensive.

The microcontroller contains all the basic components that make up a

computer. It contains all the basic components that make up a computer. It contains a

central processing unit (CPU), read-only memory, random-access memory (RAM),

arithmetic logic unit, input and output lines, timers, serial and parallel ports, digital-

to-analog converters, and analog-to-digital converters. The name PIC denotes several

families of microcontrollers manufactured by Microchip Technology [6].

Page 23: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

8

PICs are popular with both industrial developers and hobbyists a like due to:

� low cost

� wide availability

� large user base

� extensive collection of application notes and diagrams

� availability of low cost or even free development tools

� serial programming capability

� reprogrammable with flash memory

Figure 2.1: The different shape, size and type of PIC chip

Page 24: thesis yeow khang yung b020710140 - Welcome to Universiti …eprints.utem.edu.my/5672/1/Smart_Color_Sorting_Robot_24_Pages.pdf · Bahagian terpenting dalam sistem ini ialah sistem

9

Figure 2.2: The Basic Microcontroller Architecture Inside a PIC Cchip.

Figure 2.3: The Electronic Ccircuit Board for PIC Microcontroller.

PIC16F877A is one of the PIC chip in PIC family. The package type of this

chip is DIP package. DIP stand for Dual Inline Package and it is an electronic device

package with a rectangular housing and two parallel rows of electrical connecting pins.