You are on page 1of 32

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

BELGAUM 590 018

A REPORT ON MIN PROJECT WORK


COLOR BASED SORTING ROBOT
Submitted in partial fulfilment of the requirement for the award of degree of

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

Dr. G. S. Sunitha DR. H. B. Aravind


M.Tech. (DEAC), Ph.D., MISTE, FIETE., FIE. M.E., (Env. Engg.) Ph.D., FIE., MISTE.,FIEE
Program Coordinator Principal
________________________________________________________

Bapuji Educational Association

Bapuji Institute of Engineering and Technology


Davangere-577 004
Department of Electronics & Communication Engineering
2020-2021

1
BAPUJI INSTITUTE OF ENGINEERING AND TECHNOLOGY
DAVANGERE, KARNATAKA – 577004

DEPARTMENT OF ELECTRONICS & COMMUNICATION


ENGINEERING

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

Program Coordinator Principal

Internal Evaluation Name Signature with Date


1. Program Coordinator Dr. G.S. Sunitha ………………………..
2. Project Guide Dr. K. G. AVINASH ………………………..
3. Panel Member XXXXXXXXXXX ………………………..

External Evaluation Signature with Date


1. ……………………….
……………………
2. ……………………….
……………………

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”

Mission of the Institute


“BIET contributes to the growth and development of its students by
imparting a board based engineering education and empowering
them to be successful in their chosen field by including in team
positive approach, leadership qualities and ethical values”

Vision of the Department


To be in the forefront in providing quality technical education and
research in Electronics & Communication Engineering to produce
skilled professionals to cater to the challenges of the society.

Mission of the Department


M1. To facilitate the students with profound technical knowledge
through effective teaching learning process for a successful career.
M2. To impart quality education to strengthen students to meet the
industry standards and face confidently the challenges in the
program.
M3. To develop the essence of innovation and research among
students and faculty by providing infrastructure and a conducive
environment.
M4. To inculcate the student community with ethical values,
communication skills, leadership qualities, entrepreneurial skills
and lifelong learning to meet the societal

3
AKNOWLEDGEMENT

We would like to acknowledge the help and encouragement given by various


people during the course of this mini project.
We would like to express our sincere gratitude to Dr. G. S. Sunitha,
Professor and Head, Department of Electronics & Communication
Engineering, BIET, Davanagere, for her kind support, guidance and
encouragement throughout the course of this work.
We are deeply indebted and very grateful to the invaluable guidance given
by project guide, during this project work.
We would like to thank the co-ordinator Dr. Leela G.H. for her kind co-
operation and support during the course of the work.
We are thankful to our beloved principal Dr. H.B. Aravind for providing
excellent academic climate.
We would like to thank all the teaching and non-teaching staff of Dept. of
E&CE for their kind co-operation during the course of the work. The support
provided by the college and departmental library is greatly acknowledged.
Finally, we are thankful to our parents and friends, who helped us in one way
or the other throughout our mini project work.

ABHISHEK R S
MEETHA M BELLUDI
UDAYAKUMAR D
VINUTHA K L

4
ABSTRACT

There is a wide usage of many products in our day-to-day life, and


manufacturing of this products are done in many large scales and small-scale
industries. Arranging makes quality consistency issue. Nowadays the main
difficulty that is faced after the production is of sorting Arranging of items in
an industry is a dull modern process, which is by and large done physically.
Consistent manual the need of this type of machine in the industries will help
in sorting the machine according to their weight, size, color, shape, etc. This
paper gives a brief information about the sorting of objects according to their
color using TCS3200 color sensor, Arduino UNO and servo motors. The
identification of color is done frequency scaling of color detection.
Efficiency and automatization can be improved in several ways. The focus
in this report has been working with color identification and creating a smart
robot. A simple robotic arm is used to apply the color sorting to a physical
system. This model evaluates how well a robotic arm can sort different objects
using a predefined color identification algorithm. A demonstrator was built
to perform tests for sorting speed and color identification. The robotic arm
can sort a predefined shaped and sized object in 15,36 seconds. The color
identification is sensitive to external factors and does not necessarily return
the right RGB-value depending on lightning and brightness. The R-value often
has the largest error. To further improve the color sorting robot, another color
identification method could be tested, other motor types should be incorporated
and a more precise sensor should be implemented

5
LIST OF FIGURES

SI No. Figure Name Page No.

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

The importance of robotics in 21st century is increasing day by day to


reduce human mistakes in their daily tasks because of their ability to do much
difficult tasks; the automotive industry fully operates with robots completing
tasks on time without any mistake.The proposed system is an embedded system
which will increase the speed of color sorting procedure, provide the accurate
color sorting process, decrease the cost of color sorting process and optimize the
productivity of an industrial object. The system comprises of color sensor, servo
motors and microcontroller. Color sensor detects the specified color of the object
and microcontroller reads this from the data at its input ports. The microcontroller
conveysits decision to the station that been programmed. Since a microcontroller
is used as a heart of the system, it makes the set up low cost and effective
nevertheless. The significance of a project can be estimated from its current
utilization and future prospects of advancements. Industry utilization and
manufacturing also defined the significance of this project.

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 situations. This
prototype is built as a simple digital gadget like microcontroller for processing,
Servo motors for actions and coloration sensor for recognizing exclusive colored
devices.

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.

2.2 FLOW CHART

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

A brief description of the components used in the implementation of the design


is covered in this section. It includes the hardware components Color sensor
(TCS 3200), Arduino Nano, Servo Motor.

3.1.1 Color sensor (TCS 3200):

The Color sensor is a programmable light-to-frequency converter, it can filter


RGB (Red, Green, and Blue) data obtained from source light and convert it to a
square wave form having 50% duty cycle with frequency proportional to light
intensity. The full-scale output frequency can be measured by one of available
three present values with the help of two control input pins SO, S1 and pins S2,
S3 are used to control the RGB filter. Digital inputs and digital outputs allow
interfacing with a microcontroller directly. So color of the object’s light is
calculated by RGB values. TCS 3200 color sensor is chosen for this project due
to conversion of light intensity into frequency, programmable color ability and
giving full-scale output frequency, direct communication with a microcontroller,
power supply can be 2.7 V to 5.5 V, minimum error capability.

Figure 3.1.1: Color Sensor

11
3.1.2 Arduino Nano:

It is based on microcontroller like ATmega328P or ATmega628. This kind of


microcontroller board is very small in size, sustainable, flexible and reliable. It as
14 Digital I/O pins, 8 analog I/O pins, with Rx and Tx as serial communication
pins and I2C communication pins with in build LED which is at pin no.13 and
also 6 Pulse width modulation (PWM) pins.

Figure 3.1.2: Arduino Nano

3.1.3 Servo Motor:

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.

Figure 3.1.3: Servo Motor


12
3.2 SOFTWARE REQUIREMENTS

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.

How to get Arduino IDE


We can download the software from Arduino main website. As I said
earlier, the software is available for common operating systems like
Linux, Windows, and MAC OS, we select to download the correct
software version that is easily compatible with our operating system.
In our project this software is used to design the source code and upload
the code to Arduino UNO board.

13
3.3 CIRCUIT DIAGRAM AND CONNECTIONS

Figure 3.3: Electronic circuit of color based sorting Robot

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

1. Fill the colored items in the tube which is need to sort.


2. Switch on the power supply by plugging the USB cables provided for
Arduino nano and an external power supply.
3. Observe the colored item to get sorted according to their color.

15
CHAPTER 4

RESULTS AND DISCUSSIONS

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.

5.2 FUTURE SCOPE

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

• High-Resolution Conversion of Light


• Intensity to Frequency
• Programmable Color and Full-Scale Output
• Frequency
• Communicates Directly with a Microcontroller
• Single-Supply Operation (2.7 V to 5.5 V)
• Power Down Feature
• Nonlinearity Error Typically 0.2% at 50 kHz
• Stable 200 ppm/°C Temperature Coefficient
• Low-Profile Lead (Pb) Free and RoHS
• Compliant Surface-Mount Package

Description

The TCS3200 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). The full-scale output frequency can be scaled by one of three pre-set
values via two control input pins. 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.

APPLICATION INFORMATION

• Power supply considerations


Power-supply lines must be decoupled by a 0.01-μF to 0.1-μF capacitor
with short leads mounted close to the device package.
• Input interface
A low-impedance electrical connection between the device OE pin and
the device GND pin is required for improved noise immunity. All input
pins must be either driven by a logic signal or connected to VDD or GND
— they should not be left unconnected (floating).

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.

Measuring the frequency


The choice of interface and measurement technique depends on the desired
resolution and data acquisition rate. For maximum data-acquisition rate, period-
measurement techniques are used.
Output data can be collected at a rate of twice the output frequency or one data
point every microsecond for full-scale output. Period measurement requires the
use of a fast reference clock with available resolution directly related to
reference clock rate. Output scaling can be used to increase the resolution for a
given clock rate or to maximize resolution as the light input changes. Period
measurement is used to measure rapidly varying light levels or to make a very
fast measurement of a constant light source. Maximum resolution and accuracy
may be obtained using frequency-measurement, pulse-accumulation, or
integration techniques. Frequency measurements provide the added benefit of
averaging out random- or high-frequency variations (jitter) resulting from noise
in the light signal. Resolution is limited mainly by available counter registers
and allowable measurement time. Frequency measurement is well suited for
slowly varying or constant light levels and for reading average light levels over

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.

Table 1: Photodiode type (color) selection

SG90 9 g Micro Servo:

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

TowerPro SG90 - Micro Servo Basic Information


Modulation: Analog
Torque: 4.8V: 25.0 oz-in (1.80 kg-cm)
Speed: 4.8V: 0.10 sec/60°
Weight: 0.32 oz (9.0 g)
Dimensions:
Length: 0.91 in (23.1 mm)
Width: 0.48 in (12.2 mm)
Height:1.14 in (29.0 mm)
Motor Type: 3-pole
27
Gear Type: Plastic
Rotation/Support: Bushing
Additional Specifications
Rotational Range: 180°
Pulse Cycle: ca. 20 ms
Pulse Width: 500-2400 µs

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.

Figure: ATmega328P pin diagram.

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.

Table 2. Temperature Grade Identification for Automotive Products

Temperature Temperature Comments


Identifier
–40°C; +125°C Z Full automotive temperature
range

32

You might also like