Вы находитесь на странице: 1из 25


Color sorting is a recurrent problem in the food industry. Such machines are necessary for
sorting grains, seeds or coffee. This project, entitled “M&M’s® Color Sorter”, develops a
proof of concept for color sorting by using candies. Given a random assortment of
M&M’s® candies, consisting of up to 8 different colors, the device will be able to sort
them by color in a reasonable time (maximum of 10 seconds per candy) and with accuracy
higher than 80% (4 candies out of 5 sorted correctly).
I know that there a few student don’t feel interested on some document project that we
usually learn at university. Some of them couldn’t be used at the true reality nowadays
when every industry partnership who care about skill to work which define every student
on their study process
This is the small project that could let you simply understand the way how to manufacturing
a machine to classify the candy. By the way separate it into small part, my team solve the
problem in each type of side and somehow we find the solution by the help of arduino with
sensor connect with them. The prototype below will show how does it work and the process
how could we make it to become possible
Having passed a long history with different kind of unlimited dynamic change, we could
see a huge million time in snack, a small fast sweet invention in the world that could affect
everyone since they were a child. Snack could be attractive and one of the most wonderful
things in the huge library is chocolate. Since the time it was created, there are so many
formal copy types of them. Many mixed complex that was standing in many place in the
world from the small packed in some convenient store to the grand pieces of packed in the
supermarket. Chocolate is a usually sweet, brown food preparation of roasted and
ground cacao seeds. It is made in the form of a liquid, paste, or in a block, or used as a
interested ingredient in other foods and could be shaped with many form and mixed with a
huge range of color. One the most chocolate brand which was popular nowadays is M&M
chocolate. It was a company which was named with the word “colorful chocolate “by
making an ocean of chocolate colors. We are fabricated a machine which can help M&M
separate chocolate in color to serve in many type of purposes that was a hard thing to solve
when that problem happen. For serving in M&M world signature

3.1 Block Diagram

3.1.1 Block Listing
3.1.2 Connection
Figure1: Block Diagram
3.2 Operational Description
The non‐sorted M&M’s® are introduced though a feeder tube (11). The rotor (14) then
moves one candy under the color sensor board, mounted at color sensor (10). The color
sensor determines the color of the candy, and then the rotor moves the candy into the
channel (17) corresponding to the determined color. By simply reversing the rotor’s
direction, the candy is pushed down the channel and into the container (18) below.
3.3 Mechanical Design
3.3.1 Draft drawing:
- The machine consists of runner, distributor and separator. These part will be arranged like
the draft drawing below:
Figure 2: Draft Drawing
- The runner is used for guiding a candy to the separator. It is made from a plastic straw. It
will go through from outside to the top of the machine and enter to the separator.
- The separator is combined of the color sensor, the servo and the box which will act like
the dark box to help the servo in sorting candies color.
- The distributor is made from the servo and 3 formex. The distributor will delivery the
candy to the right position after scanning.

Runner Separator Distributor

Figure 3:Part Drawing
3.3.2 CAD drawing

Figure 4: 2D Drawing
- The material for making frame is formex with 3mm in thickness.
- All parts assembly together by screw and glue.
Figure 5: 3D View
Figure 6: Explosion View
a. Separator design
- Position: The separator is put at the top of the machine.
- Uses: It will consider the color of candies and sent the information to the Arduino.
- Principle: When the candy enter the top of the machine via the Runner. It will be moved
to the scanning area by the distributor formex. Then, the sensor will scan, take information
from the candy and sent it to the Arduino.
Figure 7: Separator
- Components: It consist of 4 small parts:
+ Sensor Box: The sensor box is the dark department where the color sensor can scan and
take information with the higher accuracy. All the side face inside the box is painted by
back so that it can reduce the perturbation.
Figure 8: Sensor Box
+ Distributor Formex: This formex will delivery the candy to the scanning area after it met
the top of the machine. The candy will lie on the ∅16 grave and move along when it rotate.
Figure 9: Distributor Formex
+ Supporting: is used for connecting the separator to the machine.
+ Color Sensor: is used for scanning the color of candy.

b. Distributor design
- Position: At the top of the machine and under the sensor box.
- Uses: It deliveries the color to the right container.
- Principle: After scanning the candy will slide on the lower formex under the press force
of distributor formex. When it reach the right groove of the upper formex the distributor
will reverse the direction and the long hand of it will put the candy fall down to the
container which stay at the end of the groove.
Figure 10: Distributor
- Components: It consists of 5 small part:
+ Servo motor: Although the distribution of 6 containers is around 100 degree. The angle
between the first container to the scanning area is 40 degree so the servo motor have to
rotate atleast 140 degree. The motor will be programmed on Arduino Uno R3. The
specification of the motor will be calculated and chose for productivity optimization and
saving money. This work will be done in the Calculation and Selection part.
Figure 11: Working area
+ Upper Formex: It will create rail for the candy slide to the right position under the
press force of distributor formex.

Figure 12: Upper Formex

+ Servo motor link: is used for connecting rotary platform and the motor by screw or
+ Lower Formex. It act like a base for candy can slide on it to move to the right positon
when the distributor rotate.
+ Distributor Formex: The long hand of distributor formex will draft the candy slide
along the length of the groove and fall down to the container.
c. Runner
- Position: It goes from outside to the top of the machine.
- Uses: It provides candy to the separator and contain the unscanned candy.
- Principle: Candy will go through the Runner to meet the Separator.
- Component: It is made from the plastic straw:
+ The plastic straw should have the inner diameter greater than the candy diameter so that
the candy can go smoothly and can not cause the jam in the Runner.
+ The length of it is as long as possible to contain more candies.

Figure 13: Runner

3.3.3 Calculation and Selection
a. Frame material
- There are a lot of type of material we can use to make machine’s frame such as mica,
cardboard paper, wood and so on. We decide to use formex for making the cover because
it have some advantages:
+ It is very easy to manufacture, cut by hand.
+ Easy to find in the market with the suitable price.
b. The distributor servo motor

Figure 14: Distributor servo motor

- The servo motor of the distributor is sujected two force. One is the weight of the candy
and the weight of the Rotary platform at its Center of Gravity.
- The torque of the servo motor = sum of moment at the center of the candy and Center of
Gravity of the Rotary platform. However, the weight of the candy go through the center of
distributor formex => Moment of it = 0:
Moment of Candy = Lever arm * weight of candy
= 0 (mm) * (kg) * 10

= 0 (Nmm)
Moment of Distributor Formex = Lever arm*weight of Distributor Formex
= 17.41 (mm) * 0.05 (kg) * 10
= 8.705 (Nmm)
 Torque for separator servo motor = T1 = 0+8.705= 8.705 (Nmm)
 Rotational speed of the servo motor = n1 = 3 (rpm)
 The needed power = P1 = = 2.7*10−6 (kW) (1)

We choose the micro servo SG90 9g with these specification:

+ Torque: 1.8 kg/cm
+ Weight: 9 g
+ Operating Speed: 0.1s/60degree.
+ Power: 2 W > P1
- The drawing of servo motor SG90 9g

Figure 15: Servo SG90

3.4.4 Part list

Name Quanity Picture
1 Base 1
2 Supporting 1 2

3 Arduino Uno R3 1

4 Column 6

5 Supporting 2 1

6 Supporting 3 2

7 Hole Supporting 1

8 Sensor Box 1

9 Candy 1
10 Color Sensor 11

11 Runner 1

12 Servo Supporting 1

13 Distributor Formex 1

14 Upper Formex 1

15 Servo Motor Link 1

16 Servo Motor 2
17 Lower Formex 1

18 Container 2

Table 1: Part List

3.4 Electric Design

3.4.1Block Diagram

Figure 16: Electric block diagram

Color Sensor
Here’s the sensor specifications:
Power: 2.7V to 5.5V
Size: 28.4 x 28.4mm (1.12 x 1.12″)
Interface: digital TTL
High-resolution conversion of light intensity to frequency
Programmable color and full-scale output frequency
Communicates directly to microcontroller

Figure 17: TCS3200

The color sensor which is used for detecting the color of the candies is the TCS230 sensor
module from TAOS®. It combines configurable silicon photodiodes and a current‐to‐
frequency converter on single monolithic CMOS integrated circuit, as shown on the Figure
6 (below).
Figure 18:Functional block Diagram TCS3200
In the TCS3200, the light-to-frequency converter reads an 8 x 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.
The inputs to the device can be chosen so that the sensor detects one of these colors, and
in response the device outputs a square wave (50% duty cycle) with frequency directly
proportional to light intensity (irradiance) of the chosen color.

Figure 19: Working principle TCS3200

Arduino Uno
The Arduino Uno is a microcontroller board based on the ATmega328. Arduino is an
open-source, prototyping platform and its simplicity makes it ideal for hobbyists to use as
well as professionals. The Arduino Uno has 14 digital input/output pins (of which 6 can be
used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a
power jack, an ICSP header, and a reset button. It contains everything needed to support
the microcontroller; simply connect it to a computer with a USB cable or power it with a
AC-to-DC adapter or battery to get started.

Specification Value
Main control Chip ATmega328
Loading and ATmega16U2
Communicating Chip
Power supply 5VDC
Digital pins/Analog pins 14(6 PWM
Maximum output on 40mA
Maximum output on the 150mA
power supply pin
Flash memory capacity 32kb
Table 2: Specification Arduino

Figure 20: Arduino

Servo Motor SG90
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 a 3 horns (arms) and hardware

Figure 21: Specification of Servo SG90

The PWM Generator
The PWM Generator is used to generate a PWM signal to drive the servo. The position of
the servo is defined by the width of a pulse (in range 0.5ms to 2.5ms). For instance, sending
a 1.5ms pulse to the servo, tells the servo that the desired position is 90 degrees. In order
for the servo to hold this position, the command must be sent at about 50Hz, or every 20ms
(Figure 14).

Figure 22: PWM Value

3.4.2 Schematic
Figure 23: Schematic
3.4.3 Wiring

Figure 24: Wiring

3.5 Control Design
3.5.1 Flow Chart

Figure 25: Flowchart

Results & Conclusions
In order to confirm the results of the project, experiments have been conducted a relatively
large quantity of M&M’s. Each color of M&M’s has been tested 50 times. The results of
these experiments are shown in the chart below (Figure 14):

Some conclusions can be drawn from these experiments. First, the little inaccuracy
between the red and the orange M&M’s is due to an error of detection. Sometimes the
M&M’s are not well positioned under the color sensor and, since these colors are quite
similar, the color is not well detected (red M&M’s become orange and orange M&M’s
become red). This issue could maybe be solve by using another parameter, the luminance,
to distinguish the difference between the red and the orange color, or by improving the
positioning of the M&M’s under the color sensor. The others inaccuracy are explained by
the fact that, sometimes, the M&M’s are “jumping” to the next channel. This phenomenon
is due to the rotor, which is a little twisted. This problem could be solved by using another
material for the rotor, more rigid.Beside these little inaccuracies, the project is a success.
The system meets its specifications (at least 4 M&M’s out of 5 well sorted) and the final
aspect of the prototype is a success. Since the device is working on batteries, one possible
improvement will be to optimize the power consumption by, for instance, entered the
microcontroller in sleep mode when the feeder tube is empty.
For the huge effect that could bring possible to this project is colour sensor which were the
main thing control this solution. With the lack of knowledge and technique, we could
conclude this is the short plane for us to finish this project in high advantage learning
method how to fix the problem by using the mind solution to deep learning from own
project which was the fabrication to core of the machine and the fundamental deviation to
reduce the tolerance as small as possible for the best re-present it in high effective way. For
a long journey that we deep learn together to analysis the form , the base , the core,… and
make the fully whole machine in the prototype as reality as possible. To be honest that
sometime the speed of the machine should be improved to adapt the social need and
increase the effectiveness