Introduction: TIVA Controlled Conveyer Belt Based Color Sorter

About: Electrical Engineer from University of Engineering and Technology Lahore. Science enthusiast, aspirant to contribute to the world of science by publishing projects related to science and technology

Electronics field has vast application. Every application needs a different circuit and a different software as well as hardware configuration. Microcontroller is the integrated model embedded in a chip in which different application can be run within a single chip. Our project is based upon ARM processor, which is highly used in smartphone hardware. The basic purpose to design the color sorter because it has wide application in industries e.g. in rice sorting. The interfacing of color sensor TCS3200, Obstacle Sensor, relays, Conveyer belt and TIVA C series ARM based microcontroller is the key factor to make this project unique and excellent. The project is working in such a way that object is placed on running conveyer belt which is stopped after passing from obstacle sensor. The purpose to stop the belt is to give time to color sensor to judge its color. After judging the color, the respective color arm will rotate at specific angle and allows object to fall in respective color bucket

Step 1: Introduction

Our project consists of excellent combination of hardware assembly and software configuration. A need of this idea where you have to separate the objects in the industries. A microcontroller based color sorter is designed and made for the Microcontroller processing system course which has been taught in the fourth semester of Electrical Engineering department in University of Engineering and Technology. The software configuration is used to sense the three primary colors. Which are separated by the arm connected with servomotors on the conveyer machine.

Step 2: Hardware

The components, which are used in making projects with their brief description, is given below

a) ARM Processor based TIVA C series TM4C1233H6PM microcontroller

b) IR Infrared Obstacle sensor

c) TCS3200 Color sensor

d) Relays (30V / 10A)

e) Gear motor (12V, 1A)

f) H-52 conveyer belt

g) 56.25mm diameter gear

h) servo motors

Step 3: Components Details

Following is a brief detail of main components:

1) TM4C1233H6PM Microcontroller:

It is the ARM processor based microcontroller, which has been used in this project. The benefit of using this microcontroller that it allows you to configure the pin separately according to the task. In addition, it allows you to understand the working of the code in depth. We have used Interrupt based programming in our project to make it more efficient and reliable. Texas Instrument's Stellaris® family of microcontrollers provide designers a high-performance ARM® Cortex™-M-based architecture with a broad set of integration capabilities and a strong ecosystem of software and development tools.

Targeting performance and flexibility, the Stellaris architecture offers a 80 MHz CortexM with FPU, a variety of integrated memories and multiple programmable GPIO. Stellaris devices offer consumers compelling cost-effective solutions by integrating applicationspecific peripherals and providing a comprehensive library of software tools which minimize board costs and design-cycle time. Offering quicker time-to-market and cost savings, the Stellaris family of microcontrollers is the leading choice in high-performance 32-bit applications.

2) IR Infrared Obstacle sensor:

We have used IR Infrared obstacle sensor in our project, which sense the obstacles by turning on the LED. The distance from the obstacle can be adjust by the variable resistor. The power LED will on in the response of IR Receiver. The working voltage is 3 – 5V DC and output type is digital switching. Board size is 3.2 x 1.4cm. An IR receiver that receives the signal transmitted by infrared emitter.

3) TCS3200 Color sensor:

The TCS3200 is programmable color light-to-frequency converters that combine configurable silicon photodiodes and a current-to-frequency converter on a single monolithic CMOS integrated circuit. The output is a square wave (50% duty cycle) with frequency directly proportional to light intensity (irradiance). One of three preset values via two control input pins can scale the full-scale output frequency. Digital inputs and digital output allow direct interface to a microcontroller or other logic circuitry. Output enable (OE) places the output in the high-impedance state for multiple-unit sharing of a microcontroller input line. In the TCS3200, the light-to-frequency converter reads an 8 × 8 array of photodiodes. Sixteen photodiodes have blue filters, 16 photodiodes have green filters, 16 photodiodes have red filters, and 16 photodiodes are clear with no filters. In the TCS3210, the light-to-frequency converter reads a 4 × 6 array of photodiodes.

Six photodiodes have blue filters, 6 photodiodes have green filters, 6 photodiodes have red Filters, and 6 photodiodes are clear with no filters. The four types (colors) of photodiodes are interdigitated to minimize the effect of non-uniformity of incident irradiance. All Photodiodes of the same color are connected in parallel. Pins S2 and S3 are used to select which group of photodiodes (red, green, blue, clear) are active. Photodiodes are 110μm × 110μm in size and are on 134μm centers.

4) Relays:

Relays have been used for safe use of TIVA board. The reason of using relays because we used 1A, 12V motor to drive the gears of conveyer belt where TIVA board gives only 3.3V DC. To derive the external circuit system, it is mandatory to use relays.

5) 52-H Conveyer belt :

A timing belt 52-H type is used to make the conveyer. It is rolled upon the two gears of Teflon.

6) 59.25mm diameter gears:

These gears are used to drive the conveyer belt. Gears are made of Teflon material. The number of teeth on both gears are 20, which is according the requirement of conveyer belt.

Step 4: Methodology

]The methodology used in our project is quite simple. Interrupt based programming is used in the coding area. An object will be placed on the running conveyer belt. An obstacle sensor is attached with color sensor. As the object arrives near the color sensor.

Obstacle sensor will generate the interrupt that allow passing the signal to array, which will stop the motor by switching off the external circuit. The color sensor will be given time by the software to judge the color by calculating its frequency. For example, a red object is placed and its frequency is detected.

The servomotor used for separating the red objects will rotate at specific angle and acts like an arm. Which allows the object to fall in the respective color bucket. Similarly, if different color is used then the servomotor according to object color will rotate and then object will fall in its respective bucket. Polling based interrupt is avoided to increase the efficiency of the code as well as the project hardware. In color sensor, the frequency of the object at the specific distance is calculated and entered in the code rather than turning on and checking the all filters for the easiness.

The speed of conveyer belt is kept slow because a clear observation is needed to visualize the working. The current rpm of the motor used is 40 without any moment of inertia. However, after putting the gears and conveyer belt. Due to increase in moment of inertia, the rotation become less than usual rpm of the motor. The rpm was reduced from 40 to 2 after putting the gears and conveyer belt. Pulse Width Modulation is used to drive the servomotors. Timers based are also introduced to run the project.

Relays are connected with external circuit as well as obstacle sensor as well. Although, a excellent combination of hardware and software can be observed in this project

Step 5: Code

Code has been developed in KEIL UVISION 4.

The code is simple and clear. Feel free to ask anything about the code

> The startup file has also been included

Step 6: Challenges and Problems

A Hardware:

Several problems arises during making of the project. Both hardware and software are complex and difficult to handle. The problem was the designing of conveyer belt. Firstly, we have designed our conveyer belt with simple motorcycle tire-tube with 4 wheels (2 wheels are hold together to increase the width). But this idea flopped because it was not running. After that, we have move toward the making of conveyer belt with timing belt and gears. The cost factor was on peak in its project because mechanical designing of components and preparation take both time and hard work with high precision. Still issue was present because we were not aware that only one motor is used which gear is called driver gear and all other gears are called driven gears. Also a powerful motor having less RPM should be used which can drive the conveyer belt. After resolving these issues. The hardware was succuesfully working.

B Software:

There were also challenges had to face with software part. The time in which the servomotor would rotate and go back for the specific object was the crucial part. Interrupt based programming had taken our lot of time for debugging and interfacing with hardware. There were 3 pins less in our TIVA board. We wanted to use different pins for every servomotor. However, due to less pins, we had to use same configuration for two servomotor. For example, Timer 1A and Timer 1B was configured for green and red servomotor and Timer 2A was configured for blue. So when we compiled the code. Both green and red motor rotated. Another problem arises when we have to configure the color sensor. Because we were configuring the color sensor, according the frequency rather than using the switches and checking for each color one by one. The frequencies of different colors has been calculated by using the oscilloscope at appropriate distance and then recorded which is later implemented in the code. The most challenging thing is to compile PAGE 6 all code in one. It leads to many errors and requires lots of debugging. However, we had successful to eradicate many bugs as possible.

Step 7: Conclusion and Project Video

Finally, we have achieved our goal and become successful to make a conveyer belt base color sorter.

After changing the parameters of delay functions of servomotors to organize them according to the hardware requirements. It was running smoothly without any hinderers.

The project video is available in the link.

Step 8: Special Thanks

Special thanks to Ahmad Khalid for sharing the Project and supporting the cause

Hope you like this one as well.


Tahir Ul Haq