0% found this document useful (0 votes)
25 views

Coins Sortingand Counting Machine Project

Uploaded by

khartlowelle123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Coins Sortingand Counting Machine Project

Uploaded by

khartlowelle123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/370978184

Designing Prototype of Coins Separation and counting Machine using Arduino


UNO R3 Microcontroller.

Technical Report · May 2023


DOI: 10.13140/RG.2.2.19194.88006/1

CITATIONS READS

0 3,162

6 authors, including:

Mohammad Aboalfotouh
Helwan University
7 PUBLICATIONS 1 CITATION

SEE PROFILE

All content following this page was uploaded by Mohammad Aboalfotouh on 25 May 2023.

The user has requested enhancement of the downloaded file.


Technical Report
Coins Separation and counting Machine using Arduino.

By
Mohammad Abu-Alfotouh Ahmad Qandel
Muhammad Ashraf Hussein Shaaban
Muhammad Jamal Abdel Baset Ali
Mohamed Gamal Fawzy
Muhammad Khaled Imam Abdul Salam
Mohammed Al-Sayed Abdullah
Karim Mahmoud Hussein
Section (7) – Group (1)

Under Supervision of

Assoc. Prof. Osama Ismail


Eng. Naira Mustafa
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

ABSTRACT
In this dynamic era of new evolution of technology, the systems are moving
towards smart way to improve the utilization and effectiveness of the system. In
this work, an attempt is made to design and develop the coin sorting machine,
which can be extended to a variety of similar applications. Coins are circulated
enormously in public and private transportation sectors, temples and in Retail
shops, where sorting and counting is done manually, which increases the
monotony of the work, less precision and effectiveness. The objective in this
work is to reduce the fatigue faced by human, improving the effectiveness and
utilization of the sorting, and counting process. The first step is to develop the
framework of the coin sorting mechanism using the Lining mechanism, which
will separate the coins, followed by measurement of the coin specification such
as diameter, thickness and weight to identify the value of the coin. A
programmed coin checking and arranging machine model is created by utilizing
ARDUINO as the primary regulator. This work included the structure of the
basic showcase board to show the absolute amount of each coin. The coin
acceptor has been utilized as it goes about as a coin selector to decide the
division of coin and restrict any invalid or undesirable coins. Through the task,
this coordinated structure has superior for coin including and arranging as far as
easy to use and engaging quality.
This machine can be use also in canning and packaging machines and factories
not only in counting coins as it is considered as practical Application. [1]

Figure 1: Coins Sorting Machine Project

Page | ii
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

TABLE OF CONTENT

Abstract ........................................................................ ii
TABLE OF CONTENT ................................................. iii
TABLE OF FIGURES.................................................... v
1. INTRODUCTION ..................................................... vi
1.1 Objective .................................................................................... vi
1.2 Applications ............................................................................... vi
2. LITERATURE REVIEW ............................................ 1
2.1 Introduction .................................................................................1
2.2 Coin Discrimination ....................................................................1
2.3 Coin detection and recognition ..................................................1
2.4 Sensor-based coin counting machine ........................................2
3. PROBLEM IDENTIFICATION .................................. 2
3.1 Problem Analysis: .......................................................................2
3.2 Proposed System: ........................................................................2
3.3 Concept of the Project ................................................................2
4. SENSOR SELECTION ............................................. 4
4.1 Choosing criteria of selecting sensor .........................................4
4.2 Working idea ...............................................................................5
5. ACTUATOR SELECTION ........................................ 8
5.1 Servo motor Selection .................................................................8
5.1.1 Working Principle ............................................................................ 8
5.1.2 Motor selection parameters: ........................................................... 9
6. METHODOLOGY&TESTING ................................. 12
6.1 Working principle .....................................................................13
6.1.1 We came with a new Idea!............................................................. 13
6.2 Block diagram............................................................................14
6.3 Process ........................................................................................15

Page | iii
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

6.3.1 Counting .......................................................................................... 15


6.3.2 Feedback (flipping servo with 180 deg) ....................................... 16
6.4 Components used. .....................................................................16
6.5 Software......................................................................................16
6.6 Making Structure for Coin Sorter ..........................................16
6.7 Circuit Diagram ........................................................................18
6.8 Code ............................................................................................19
7. MODELING AND DESIGN ..................................... 23
8. MATHEMATICAL MODEL OF MACHINE ............. 26
8.1 Servo motor................................................................................26
8.2 Coin Sorter mechanism ............................................................28
8.3 IR sensor ....................................................................................29
9. PROBLEMS FACED .............................................. 30
10. RESULTS AND DISCUSSION ........................... 32
10.1 Implemented Solutions of Designing Problems: .................32
11. CONCLUSION ................................................... 33
12. FUTURE SCOPE................................................ 34
13. REFERENCES ................................................... 35

Page | iv
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

TABLE OF FIGURES
Figure 1: Coins Sorting Machine Project .............................................................ii
Figure 2: IR Sensor ............................................................................................... 4
Figure 3:IR Sensor Circuit .................................................................................... 7
Figure 4: Servo Motor Block diagram .................................................................. 8
Figure 5: Futaba S3003 Servo Motor ................................................................. 10
Figure 6: Futaba S3003 Standard Servo Design ................................................. 10
Figure 7: Servo Motor Controlling Using PWM ................................................ 11
Figure 8:Screenshots of Programming with Arduino ......................................... 11
Figure 9:Block Diagram of machine................................................................... 14
Figure 10: Circuit Diagram ................................................................................. 18
Figure 11:Screenshots of Programming with Arduino ....................................... 22
Figure 12: First Modeling Design we created .................................................... 23
Figure 13:Second Modeling Design ................................................................... 23
Figure 14:Working Drawing of final Design. ..................................................... 24
Figure 15: Working Drawing 2 of Final Design ................................................. 24
Figure 16: Assembly Drawing of Final Design .................................................. 25
Figure 17: Assembly Drawing of machine with hardware components ............ 25
Figure 18: Closed loop circuit diagram for servomotor ..................................... 26
Figure 19: Servo Motor modeling....................................................................... 27
Figure 20:Lag of LCD Proplem .......................................................................... 31
Figure 21: Making Delay in code to avoid over detecting ................................. 31

Page | v
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

1. INTRODUCTION
Coin sorting and counting machines are increasingly becoming popular due to
their ability to automate the process of sorting and counting coins with high
accuracy and efficiency. These machines are widely used in financial
institutions, casinos, and vending machine businesses. However, they can also
be adapted to other applications that require the sorting, counting, and
packaging of small objects.

This technical report presents the design and implementation of a coin sorting
and counting machine that is based on a ramp design with three holes of
different sizes for each coin. The machine uses IR sensors to detect each coin
and count it using an Arduino Uno microcontroller. The machine also has a tray
box under each slot to collect coins, and servo motors that are coupled to the
tray boxes to flip them 180 degrees to empty them once the IR sensor count
reaches 3 coins. The LCD 16*2 display with I2C module is used to display the
number of coins counted.

The purpose of this report is to provide a comprehensive overview of the design


and implementation of the coin sorting and counting machine. The report
includes details on the methodology used to build the machine, the results of the
project, and a discussion of its strengths and weaknesses, possible
improvements, and future applications.
1.1 Objective
The counting process can be done faster by using UNO. After the coin is
inserted into Ramp, it gets detected by IR sensor module and then it is sorted on
the basis of coin dimension. The coin count will be displayed on the LCD
display and when number of coins reach specific quantity Servo motors flip
boxes to separate a counted quantities of coins to user.
1.2 Applications
This type of machine can be adapted for sorting and counting other small
objects that have different sizes or shapes. Here are some examples:
[1] Sorting and counting small parts: You can modify the size and shape of
the holes in the ramp to accommodate different types of small parts, such as
screws, nuts, bolts, or electronic components. You can also use different
sensors, such as optical sensors or hall effect sensors, to detect the presence of
the parts.
[2] Sorting and counting candies: You can modify the size and shape of the
holes in the ramp to accommodate different types of candies, such as gumballs,
mints, or chocolates. You can also use different sensors, such as color sensors or
weight sensors, to detect the presence of the candies.
[3] Sorting and counting pills: You can modify the size and shape of the
holes in the ramp to accommodate different types of pills, such as tablets,

Page | vi
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

capsules, or pills of different shapes and sizes. You can also use different
sensors, such as optical sensors or weight sensors, to detect the presence of the
pills.
[4] Sorting and counting seeds: You can modify the size and shape of the
holes in the ramp to accommodate different types of seeds, such as flower seeds,
vegetable seeds, or fruit seeds. You can also use different sensors, such as color
sensors or weight sensors, to detect the presence of the seeds.
[5] Sorting and counting machine parts: Factories that produce small
machine parts, such as screws, bolts, or washers, can use coin sorting and
counting machines to sort and count these parts. This can save time and reduce
errors compared to manual counting.
[6] Sorting and counting electronic components: Factories that produce
electronic components, such as resistors, capacitors, or diodes, can use coin
sorting and counting machines to sort and
[7] count these components. This can improve accuracy and reduce waste
compared to manual counting.
[8] Sorting and counting food products: Factories that produce small food
products, such as candies, nuts, or seeds, can use coin sorting and counting
machines to sort and count these products. This can improve efficiency and
reduce the risk of contamination compared to manual sorting and counting.
[9] Sorting and counting pharmaceutical products: Factories that produce
small pharmaceutical products, such as pills or tablets, can use coin sorting and
counting machines to sort and count these products. This can improve accuracy
and reduce errors compared to manual counting.

Page | vii
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

2. LITERATURE REVIEW
2.1 Introduction
This chapter includes the development of the coin operated machine from its
early invention until the latest modern today. This chapter has also discussed the
concept and theories of the coin operated machine to do the coin counting and
sorting process. Analyzing and understanding from the literature review is
important because it acts as the guidance for the project.
2.2 Coin Discrimination
In the structure of coin discriminators, it contains the structure and part like a
sensor for distinguishing coin, coin entrance, anvil, coin tubes and electronic
circuit. For the method of activity, the coin is supplemented to the coin opening
and through the coin way at that point goes through the sensor which is situated
along the coin way to quantify the coin’s physical properties. The properties of
coins like measurements, weight, elasticity, conductivity, and dropping time are
estimated dependent on the sensor utilized in the coin discriminator. For most of
the part, sensors are used to improve the utilization, which are electromagnetic
sensor, attractive sensor, acoustic sensor, and optical sensor. The most
ordinarily sensor that can be found in the regular coin discriminator is the
Electromagnetic sensor. This sensor is normally the inductive sensor or Hall
Effect sensor. The lasting magnet is typically placed on the coin way and the
area of the attractive sensor is straightforwardly inverse to the perpetual magnet.
A consistent attractive transition and attractive field quality is produced over the
coin way. At the point, when the coin goes and experiences the way, the coin
will differ the attractive motion thickness so that the first type of the attractive
motion thickness in the space is changed. This subsequent determined
difference in the attractive sensor and immediately instigated the electromotive
power (emf). The incited emf’s greatness is impacted dependent on the
metallurgical property like thickness and breadth of the coin. To distinguish the
pinnacle estimation of actuated emf, the attractive sensor is associated with an
electronic sensor. Since various sorts of coin will deliver explicit pinnacle
voltage, it very well may be utilized to check the legitimacy of coin division. [1]
2.3 Coin detection and recognition
Various techniques can be used to recognize and detect the coins of different
denominations. Techniques such as Circular Hough Transform, Artificial neural
networks, heuristics approach have been used for the recognition of coins.
parameters such as size, weight, material have been used as the parameter to
analyze and recognize the denomination of coin. The steps of coin recognition
to detect and recognize the coin is described. First, start the process and make
the data capturing or also the data acquisition. Next, initialize the image
segmentation process after the image is captured. The cropping of the image is
done after the coin image has been segmented. The features of coin images, for
example texture and edge detection has been extracted. The calculation of the

Page | 1
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

threshold value of grey scale image is obtained from the segmentation. [2]
2.4 Sensor-based coin counting machine
The sensor-based coin counting machine is created with the capability of
accepting a number of coins, counting the coins and also displays the value and
result to the end user. The coin counting machine is consisting of a coin
discriminator sensor, a coin hopper with a container for receive numbers of
coins, and a feed for accept the coins in the container to the coin discriminator
sensor, and a controller for calculate the total value of the coins which is
responsive from the coin discriminator sensor [2]

3. PROBLEM IDENTIFICATION
3.1 Problem Analysis:
Existing coin sorting and counting machines are often expensive and may not be
affordable for small businesses or individuals. Additionally, many of these
machines may not be customizable to handle specific coin denominations,
which can limit their usefulness. Another issue is the lack of accuracy of some
existing machines, which can lead to errors in the counting and sorting process.
These issues can lead to delays, lost revenue, and errors in financial reporting.
3.2 Proposed System:
The proposed system is a cost-effective, customizable, and accurate coin sorting
and counting machine that can be used by small businesses or individuals. The
machine will be designed to sort and count multiple coin denominations, have a
intermediate level of accuracy, and be easy to use and maintain. The machine
will use IR sensors to detect each coin and count it using an Arduino Uno
microcontroller. The machine will have a tray box under each slot to collect
coins, and servo motors that are coupled to the tray boxes to flip them 180
degrees to empty them once the IR sensor count reaches n coins. The LCD 16*2
display with I2C module will be used to display the number of coins counted.
3.3 Concept of the Project

The concept of the project is to develop a coin sorting and counting machine
that is affordable, customizable, and accurate. The machine will be designed to

Page | 2
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

automate the process of sorting and counting coins, which will reduce the
likelihood of errors and improve the efficiency of the process. The machine will
be easy to use and maintain and will be designed to handle multiple coin
denominations. The proposed machine will be a cost-effective solution for small
businesses or individuals who handle large volumes of coins on a daily basis.
By developing this machine, the project aims to improve the accuracy and
efficiency of coin sorting and counting processes and reduce the likelihood of
errors.

Page | 3
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

4. SENSOR SELECTION
4.1 Choosing criteria of selecting sensor
Sensor Requirements:
The sensors used in this machine must meet the following requirements:

• Detect coins of different sizes accurately.


• Produce a signal that can be used to distinguish between small, medium,
and large coins.
• Have a fast response time to accurately count the coins.
• Be affordable and easily available.

IR (infrared) sensors can offer several advantages


in a coin sorting machine, including:

1. non-contact sensing: IR sensors can detect the


presence of coins without physical contact, which
can reduce wear and tear on both the sensor and
the coins. This can also improve the accuracy of
the sorting process by preventing coins from
getting stuck or jammed in the machine. Figure 2: IR Sensor

2. High-speed detection: IR sensors can detect coins at high speeds, which is


important in a coin sorting machine that needs to process a large volume of
coins quickly. This can help increase the throughput of the machine and reduce
processing time.

3. Versatility: IR sensors can detect a wide range of coin types and sizes, which
can make them suitable for use in a variety of coin sorting machines. This can
include machines that sort coins by denomination, weight, size, or other
characteristics.

4. Reliability: IR sensors are generally reliable and have a long lifespan, which
can reduce maintenance costs and downtime. They are also less likely to be
affected by environmental factors such as dust, dirt, or moisture.

5. Cost-effective: IR sensors are often more cost-effective than other types of


sensors, such as photoelectric sensors or ultrasonic sensors. This can make them
a more affordable option for small to medium-sized coin sorting machines.

Overall, IR sensors offer several advantages in a coin sorting machine,


including non-contact sensing, high-speed detection, versatility, reliability, and
cost-effectiveness. These benefits can help improve the accuracy, speed, and

Page | 4
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

efficiency of the coin sorting process, while also reducing maintenance costs
and downtime.
To detect the coin movement and count the number of times they pass throw
slots we had to choose a fast response sensor and we choose
IR Infrared Proximity and Object Detection Sensor. And here are the working
ideas and specifications of this Module.
4.2 Working idea
The IR Infrared object detection Sensor Module works by emitting infrared light
and then detecting the reflected light. When an object, such as a coin, passes in
front of the sensor, it reflects some of the infrared light back to the sensor. The
sensor detects this reflected light and sends a signal to the microcontroller to
count the coin. The sensor uses an onboard comparator to convert the analog
signal from the photodiode to a digital signal.
• Specifications
1. When the module detects an obstacle in front of the signal, the green
indicator lights on the board level, while the OUT port sustained low
signal output, the module detects the distance 2 ~ 30cm, detection angle
35 °, the distance can detect potential is adjusted clockwise adjustment
potentiometer, detects the distance increases; counterclockwise
adjustment potentiometer, reducing detection distance.
2. The sensor active infrared reflection detection, target reflectivity and
therefore the shape is critical detection distance. Where the minimum
detection distance black, white, maximum; small objects away from a
small area, a large area from the Grand.
3. The sensor module output port OUT port can be directly connected to the
microcontroller IO can also be directly drive a 5V relay; Connection:
VCC-VCC; GND-GND; OUT-IO
4. Comparators LM393, stable.
5. The module can be 3-5V DC power supply. When the power turned on,
the red power indicator lights.
6. With the screw holes 3mm, easy fixed installation.
7. Board size: 3.2CM * 1.4CM
8. Each module has been shipped threshold comparator voltage adjusted by
potentiometer good, non-special case, do not adjustable potentiometer.
• How it works
− The sensing component in this circuit is IR photo-diode. More the amount of
InfraRed light falling on the IR photodiode, more is the current flowing
through it. (Energy from IR waves is absorbed by electrons at p-n junction of
IR photodiode, which causes current to flow).
− This current when flows through the 10k resistor, causes potential difference
(voltage) to develop. The magnitude of this voltage is given by Ohm’s law,
V=IR. As the value of resistor is constant, the voltage across the resistor is

Page | 5
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

directly proportional to the magnitude of current flowing, which in turn is


directly proportional to the amount of Infra-Red waves incident on the IR
photodiode.

− So, when any object is brought nearer to the IR LED, Photo-Diode pair, the
amount of IR rays from IR LED which reflects and falls on the IR
photodiode increases and therefore voltage at the resistor increases (from the
deduction in previous para).

− We compare this voltage change (nearer the object, more is the voltage at
10K resistor / IR photodiode) with a fixed reference voltage (Created using a
potentiometer).

− Here, LM393 IC (A comparator/OpAmp) is used for comparing the sensor


and reference voltages. The positive terminal of photodiode (This is the point
where the voltage changes proportion to object distance) is connected to non-
inverting input of OpAmp and the reference voltage is connected to inverting
input of OpAmp.

− When any object approaches the IR proximity sensor, the voltage at


photodiode increases and at some point the voltage at non-inverting input
becomes more than inverting input, which causes OpAmp to turn on the
LED.

− In the same manner, when the object moves farther from the IR proximity
sensor, the voltage at non-inverting input reduces and at some point becomes
less than inverting input, which causes OpAmp to turn off the LED.

− The OpAmp functions in a way that whenever the voltage at non-inverting


input is more than the voltage at inverting input, the output turns ON.

− When no object is near the IR proximity sensor, we need LED to be turned


off. So we adjust the potentiometer so as to make the voltage at inverting
input more than non-inverting.

Simple code to count coins pass by the sensor to explain


const int IRsensor = 6; // define the pin for the IR sensor
int objectCount = 0; // initialize the count to zero
void setup() {
pinMode(IRsensor, INPUT); // set the IR sensor pin as an input
Serial.begin(9600); // initialize serial communication at 9600 bits per
second

Page | 6
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

}
void loop() {
int sensorValue = digitalRead(IRsensor); // read the value of the IR sensor
if (sensorValue == LOW) { // if the sensor detects an object
objectCount++; // increment the count
Serial.println(objectCount); // print the current count to the serial
monitor
if (objectCount == 25) { // if 25 objects have been counted
while (true) {} // enter an infinite loop to stop counting
}
delay(500); // wait for half a second to avoid counting the
same object twice
}
}

Figure 3:IR Sensor Circuit

Page | 7
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

5. ACTUATOR SELECTION
5.1 Servo motor Selection
5.1.1 Working Principle
There are four main components inside of a hobby servo, a DC motor, a
gearbox, a potentiometer and a control circuit. The DC motor is high speed and
low torque, but the gearbox reduces the speed to around 60 RPM and at the
same time increases the torque. The potentiometer is attached on the final gear
or the output shaft, so as the motor rotates the potentiometer rotates as well, thus
producing a voltage that is related to the absolute angle of the output shaft. In
the control circuit, this potentiometer voltage is compared to the voltage.
coming from the signal line. If needed, the controller activates an integrated H-
Bridge which enables the motor to rotate in either direction until the two signals
reach a difference of zero.
A servo motor is controlled by sending a series of pulses through the signal line.

Figure 4: Servo Motor Block diagram

The frequency of the control signal should be 50Hz or a pulse should occur
every 20ms. The width of pulse determines the angular position of the servo and
these types of servos can usually rotate 180 degrees (they have a physical limits
of travel).

Choosing a motor with torque greater than the calculated value can provide
several benefits:

1. Safety Margin: By selecting a motor with a higher torque rating, you create a
safety margin, which can help prevent the motor from stalling or overheating
during operation. This can help ensure the longevity of the motor while
reducing the risk of damage or failure.

2. Load Variations: In real-world applications, the load may vary from the

Page | 8
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

expected value, which can cause the motor to stall or operate inefficiently. By
selecting a motor with a higher torque rating, you can account for load
variations and ensure that the motor can handle unexpected changes in the load.

3. Future Upgrades: If you plan to upgrade your system or add additional


components, a motor with a higher torque rating can provide the necessary
power to accommodate these changes without requiring a new motor.

4. Efficiency: A motor that is operating at or near its maximum torque rating


may be less efficient and generate more heat, reducing the overall efficiency of
the system. By selecting a motor with a higher
torque rating, you can operate the motor at a lower percentage of its maximum
torque, which can result in improved efficiency and lower operating costs over
the long term.
Overall, selecting a motor with a higher torque rating than the calculated value
can provide added safety, flexibility, and efficiency to your system. However, it
is important to ensure that the motor is compatible with the rest of your system
and that the higher torque rating does not cause any unintended consequences.
5.1.2 Motor selection parameters:
− Inertia matching
− Torque requirement
− Power requirement
To understand inertia calculation first we should know function of motor in out
project, Motor function is to turn boxes 180 degree when boxes carry it’s
maximum capacity identified depending on application and range of counting.
Now ready for starting inertia explanation we choose motor suit to.
on basis of “newton’s second law” ͢ ∑M= I*Ö
Calculating polar moment of inertia:
Maximum capacity of biggest box = 6 coins
Each coin =10gm
Total mass of coins =10*6= 60gm
Box mass =30gm each side = 6gm

Page | 9
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

For 4 vertical plates


𝐼𝑡’𝑠 𝑑𝑖𝑚𝑒𝑛𝑠𝑖𝑜𝑛𝑠 (7 ∗ 5),2(6 ∗ 5), (7 ∗ 2.5)𝑐𝑚
𝐼 = 𝑚 ∗ (𝑎2 /12), 𝐼 = 2 ∗ 6 ∗ (72 /∗ 12) + 2 ∗ 6 ∗ (62 /12) = 85𝑔𝑚. 𝑐𝑚2
𝐹𝑜𝑟 ℎ𝑜𝑟𝑖𝑧𝑜𝑛𝑡𝑎𝑙 𝑝𝑙𝑎𝑡𝑒 𝑎𝑛𝑑 𝑐𝑜𝑖𝑛𝑠 𝑡𝑜𝑡𝑎𝑙 𝑚𝑎𝑠𝑠 = 65𝑔𝑚
𝐼 = 𝑚 ∗ (𝑎2 + 𝑏 2 )/12
𝐼 = 65 ∗ (72 + 62 )/12 = 460.41𝑔𝑚. 𝑐𝑚2
∑ 𝐼 = 460.41 + 85 = 545.41𝑔𝑚. 𝑐𝑚2

Our motor S3003 provide 3,2 kg.cm we would like


that motor turn box fast to didn’t shut off counting
for long time.

Futaba S3003 Standard Servo Specifications


− Weight: 38g. Rotation Angle: 180°
− Torque: 3,2 kg.cm (31 N.cm) (at 4,8 V). Figure 5: Futaba S3003 Servo
− Torque: 4,1 kg.cm (40 N.cm) (at 6 V). Motor
− Speed: 0,23 sec/60° (at 4,8 V).
− Speed: 0,19 sec/60° (at 6 V).
− Current idle: 7.2mA at 4.8 V, 8 mA at 6 V.
− Current max: 700 mA.

Figure 6: Futaba S3003 Standard Servo Design

Page | 10
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

Futaba S3003 Standard Servo Controlling Method

Figure 7: Servo Motor Controlling Using PWM

− PWM (Pulse Width Modulation


− PulseFigure
Frequency / Duty cycle:
8:Screenshots 50 Hz / 20 mswith
of Programming square wave
Arduino

Page | 11
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

6. METHODOLOGY&TESTING
Means way of implementing of idea and working principle of project. Project
starts with throwing coins which different in size across ramp which makes
angle of 30 degree and have three slots different in size by the way of coins.
Coins continue in moving under effect of gravity falling in the slot suit to, IR
sensor like a man wait and monitor falling coins to send signal to Arduino
which will count coins until reaching maximum number that we programmed to
move servo motor to empty boxes from coins and start a new cycle from
counting.
• We begin with designing the structure of machine considering the
dimensions of each component and areas which the components can work
throw it such as servo motor.
• We make a brainstorming as team members suggest different designs to
apply.
• At the end we had chosen the principled design.
• The body of the machine is made of cardboard as an initial design
because of its low coefficient of friction.
• Coins are CNC printed with dimensions of 17, 23, 30 mm form Acrylic to
be light to reduce Torque Required by servo then in future we can use
stronger servo to carry metal (real) coins.
• The Ramp was handmade and consists of three holes measuring 18, 24
and 32 mm.
• We follow trial and error method to choose angle of coin sorter (Ramp).
• After choosing the considered angle we begin to specify the heights of
slots and other dimensions.
• We started to write Arduino Code.
• We test the code working with sensors and servos without mechanism.
• The servo motor was connected to the boxes by interlocking the arm of
the motor with the box with wires.
• We finish the mechanical Design and start to test it.
• The sensors were placed on different dimensions of the slope due to the
angle of the slope, considering they are not in the trajectory of the boxes'
flips so as not to interfere with them to calibrate and perform the best
position for detecting coin we use trial-and-error method.
• An electric box was made to put all the electrical components inside, so
that the machine would be closed on itself without any user control over
the connections.
• This electrical box helps to give support for IR sensors and dimensions of
it depending on the height of sensors.
• We begin the test by testing how the mechanism works with hardware
and software components.

Page | 12
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

• Then we test the slot of smaller size which will have the biggest error of
detecting by IR sensors and how Servo motor will perform.
• We decided to use dual IR sensors in each slot to reduce errors.
• We tested the final design of the machine with new additions.
6.1 Working principle
− The working principle of the coin sorting and counting machine involves a
series of steps to accurately sort and count coins. Here's a breakdown of how
the machine works:

− Coins are fed into the machine through a ramp that has three holes of
different sizes. The coins fall through these holes and into designated slots
based on their sizes.

− Each slot has an IR sensor placed under it. When a coin passes over the
sensor, it sends a low signal to the Arduino Uno microcontroller, which
registers the coin and adds it to the count, the code continuously reads the
state of the IR sensors for each coin and increments the corresponding coin
count if either or both sensors detect a coin.

− The count is displayed on the LCD 16*2 display with I2C module, which
shows the number of coins counted for each denomination.

− Under each slot, there is a tray box that collects the coins. Once the IR sensor
count reaches n coins, the servo motor coupled to the tray box flips it 180
degrees to empty the coins.

− Once the tray box is emptied, the counter is reset to zero, and the process
repeats itself for the next set of coins.

6.1.1 We came with a new Idea!


Our coin sorting machine boasts a unique and innovative feature that sets it
apart from other traditional coin sorting machines. It incorporates servo motors
that are used to flip boxes and allow users to divide each type of coin into
specific quantities, giving them greater flexibility and control over the sorting
process. This feature is particularly useful in industrial settings, where workers
can use it to sort coins into containers with predetermined quantities, thereby
streamlining the production process and reducing the risk of errors. By offering
a new level of efficiency and accuracy in coin sorting, our machine is poised to
revolutionize the way coins are sorted and counted in various industries.

Page | 13
Helwan University
Faculty of Engineering, Helwan
Mechatronics Lab

6.2 Block diagram

Figure 9:Block Diagram of machine

Page | 14
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

6.3 Process
In this block diagram:
❖ Coin Ramp: This is the entrance of the machine where coins are fed into the
system. The ramp has three holes of different sizes that allow the coins to pass
through and be sorted according to their sizes.

❖ IR Sensors: There are Six IR sensors located under each hole on the ramp (2
under each Slot). Six sensors detect the presence of coins and send signals to
the microcontroller.

❖ Microcontroller: This is the brain of the machine; Arduino Uno is a


microcontroller board based on the ATmega328P which receives signals from
the IR sensors and registers each coin according to its denomination. The
microcontroller also sends signals to the servo motors to activate the tray
boxes once the IR sensors count n coins.

❖ Servo Motors: There are three servo motors attached to each tray box, which
flip the boxes 180 degrees once they are full of coins. The servo motors are
activated by signals sent from the microcontroller.

❖ Tray Boxes: There are three tray boxes located under each slot on the ramp.
These boxes collect the sorted coins, and once the IR sensors count 10 coins,
the servo motor flips the box 180 degrees, and the coins fall into a container.

❖ LCD Display: The LCD 16*2 display with I2C module displays the number of
coins counted for each denomination. The microcontroller sends signals to the
display to show the current count.

❖ All the operation perfume by microcontroller and their special prepose


firmware which is written in embedded ‘C’ code by using Arduino IDE.

6.3.1 Counting
When a coin is inserted into this Arduino coin counter, it enters the dedicated path
as per the mechanical design and the respective IR sensor senses the coin and
gives LOW output value to the Arduino which can be read by the Digital pins of
Arduino. The IR sensors, which give LOW value, decide the coin value.
We are using 2 IR Sensors for each Slot to reduce error. If one of them or both
detects coin.
Here a 16x2 Alphanumeric LCD is interfaced with Arduino using an I2C module,
to display the number of coins inserted into the box.
After the complete setup and uploading the code, switch ON the DC power
supply. First, a welcome message will be displayed on the LCD and after a few
seconds, a screen with the number of all the available coins will be displayed on
Page | 15
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

LCD. In the beginning, it will show zero as we haven’t inserted any coins yet.
Next, insert any coin at the top of the machine. Now you will see the value of the
coin count must be updated on LCD. Then Insert multiple coins of different
values and check the count of the respective coins on LCD.

6.3.2 Feedback (flipping servo with 180 deg)


When the container reaches the storage of a certain number of coins, the IR sensor
will give a signal back to the Arduino Uno in order to control the angle of the
servo motor in order to unload the container into a larger container.

6.4 Components used.


ITEM PRICE
Arduino Uno + USB Cable --
Breadboard*2 60
Servo Motor S3003 '3 pcs ' 450
IR Sensors 270
LCD (Character LCD 2×16) Blue 55
Serial I2C LCD Daughter Board Module 45
Jumper wires male to male 35
Jumper wires female to male 35
Jumper wires female to female 35
Adapter 5V – 2A for Servos +Female jack 70
Glue Gun + Glue 30
Structure (Cardboard) 150
Total 1215

6.5 Software
• Arduino IDE.
• AutoCAD.
• SolidWorks.
• PROTEUS.
• TinkerCAD.
6.6 Making Structure for Coin Sorter
Step 1: Taking a cardboard sheet and marking for different coin sizes as shown in
the below figure. Then carefully cut the marked portions. Cutting of these
portions must be done accurately; otherwise, the project may not work perfectly.
Step 2: Place the above arrangement in a slope structure. After making the
arrangement, we check it by inserting different coins on the slope to ensure that
the arrangement is perfectly working. If the coin is not inserting properly, then
slightly increase the size of the hole according to coin and recheck until
successful operation.
Step 3: Place the IR sensors near the output path of individual coin Here, IR

Page | 16
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

sensors are placed at different output paths of the coin sorting machine to sense
the coins. When a coin is inserted into this Arduino coin counter, it enters the
dedicated path as per the mechanical design and the respective IR sensor senses
the coin and gives LOW output value to the Arduino which can be read by the
Digital pins of Arduino. The IR sensor, which is giving LOW value, decides the
coin value. Here a 16x2 Alphanumeric LCD is interfaced with Arduino using an
I2C module, to display the number of coins inserted into the box. This LCD can
also be connected to Arduino directly without using the I2C module, but this
requires a greater number of connections. So to make it simpler, an I2C module is
used along with LCD, which only uses 2 pins, i.e. SCL, SDA for connecting LCD
with Arduino. For powering the Servos, a 5VDC, 2 AMP AC-DC adapter is used,
which can be directly connected to the power jack of Arduino.

Page | 17
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

6.7 Circuit Diagram

Figure 10: Circuit Diagram

Page | 18
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

6.8 Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>

// Define the pins for the IR sensors


const int IR1A_PIN = 2;
const int IR1B_PIN = 3;
const int IR2A_PIN = 4;
const int IR2B_PIN = 5;
const int IR3A_PIN = 6;
const int IR3B_PIN = 7;

// Define the pins for the servo motors (PWM pins)


const int SERVO1_PIN = 11;
const int SERVO2_PIN = 10;
const int SERVO3_PIN = 9;

// Define the number of IR sensors per coin


const int SENSORS_PER_COIN = 2;

// Define the number of coins needed to trigger the servo motors


const int COINS_PER_TRAY = 3;

// Define variables for counting the coins


int coinCount1 = 0;
int coinCount2 = 0;
int coinCount3 = 0;

// Define variables for the servo motors


Servo servo1;
Servo servo2;
Servo servo3;

// Define variables for the LCD display


LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
// Initialize the IR sensors
pinMode(IR1A_PIN, INPUT);
pinMode(IR1B_PIN, INPUT);
pinMode(IR2A_PIN, INPUT);
pinMode(IR2B_PIN, INPUT);
pinMode(IR3A_PIN, INPUT);
pinMode(IR3B_PIN, INPUT);

// Initialize the servo motors (PWM pins)


servo1.attach(SERVO1_PIN, 500, 2400);
servo2.attach(SERVO2_PIN, 500, 2400);
servo3.attach(SERVO3_PIN, 500, 2400);
servo1.write(0);
servo2.write(0);
servo3.write(0);

// Initialize the LCD display


lcd.init();
lcd.backlight();

// Display welcome message and title on LCD


lcd.setCursor(0, 0);

Page | 19
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab
lcd.print("Welcome to the");
lcd.setCursor(0, 1);
lcd.print("Coin Sorting Machine");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Sorting elements:");

// Add titles for each coin


lcd.setCursor(0, 1);
lcd.print("C1: ");
lcd.setCursor(4, 1);
lcd.print("C2: ");
lcd.setCursor(8, 1);
lcd.print("C3: ");

// Initialize serial communication


Serial.begin(9600);
}

void loop() {
// Read the state of the IR sensors for coin 1
int ir1AState = digitalRead(IR1A_PIN);
int ir1BState = digitalRead(IR1B_PIN);
// Increment the coin count if either or both sensors detect a coin
if (ir1AState == LOW || ir1BState == LOW) {
coinCount1++;
Serial.print("Coin count for tray 1: ");
Serial.println(coinCount1);
// Update the LCD display with the current coin count for coin 1
lcd.setCursor(3, 1);
lcd.print(" "); // clear previous count
lcd.setCursor(3, 1);
lcd.print(coinCount1);
// Print the current coin count for tray 1 in the serial monitor
Serial.print("Coin count for tray 1: ");
Serial.println(coinCount1);
// Delay to prevent multiple counts for the same coin
delay(500);
}

// Read the state of the IR sensors for coin 2


int ir2AState = digitalRead(IR2A_PIN);
int ir2BState = digitalRead(IR2B_PIN);
// Increment the coin count if either or both sensors detect a coin
if (ir2AState == LOW || ir2BState == LOW) {
coinCount2++;
// Update the LCD display with the current coin count for coin 2
lcd.setCursor(7, 1);
lcd.print(" "); // clear previous count
lcd.setCursor(7, 1);
lcd.print(coinCount2);
// Print the current coin count for tray 2 in the serial monitor
Serial.print("Coin count for tray 2: ");
Serial.println(coinCount2);
// Delay to prevent multiple counts for the same coin
delay(500);
}

Page | 20
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab
// Read the state of the IR sensors for coin 3
int ir3AState = digitalRead(IR3A_PIN);
int ir3BState = digitalRead(IR3B_PIN);
// Increment the coin count if either or both sensors detect a coin
if (ir3AState == LOW) {
coinCount3++;
// Update the LCD display with the current coin count for coin 3
lcd.setCursor(11, 1);
lcd.print(" "); // clear previous count
lcd.setCursor(11, 1);
lcd.print(coinCount3);
// Print the current coin count for tray 3 in the serial monitor
Serial.print("Coin count for tray 3: ");
Serial.println(coinCount3);
// Delay to prevent multiple counts for the same coin
delay(500);
}

// Check if the coin count for any tray has reached the threshold
if (coinCount1 >= COINS_PER_TRAY) {
// Flip the tray and reset the coin count
servo1.write(180);
delay(1000);
servo1.write(0);
coinCount1 = 0;
// Update the LCD display to clear the coin count for coin 1
lcd.setCursor(3, 1);
lcd.print(coinCount1);
}

if (coinCount2 >= COINS_PER_TRAY) {


// Flip the tray and reset the coin count
servo2.write(180);
delay(1000);
servo2.write(0);
coinCount2 = 0;
// Update the LCD display to clear the coin count for coin 2
lcd.setCursor(7, 1);
lcd.print(coinCount2);
}

if (coinCount3 >= COINS_PER_TRAY) {


// Flip the tray and reset the coin count
servo3.write(180);
delay(1000);
servo3.write(0);
coinCount3 = 0;
// Update the LCD display to clear the coin count for coin 3
lcd.setCursor(11, 1);
lcd.print(coinCount3);
}
}

Page | 21
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

Figure 11:Screenshots of Programming with Arduino

Page | 22
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

7. MODELING AND DESIGN


In the Modeling and Design section, we used a trial and error method to
implement our design. Since we did not use any pre-existing designs from the
internet, we had to create three different designs before we were able to reach
the proposed design. The first design was created based on our initial ideas and
sketches, and we used it to identify some of the issues that we needed to
address.
The second design was an improvement over the first design, and we used it to
test some of our new ideas. However, we still encountered some issues with this
design that needed to be addressed.
Finally, we created the proposed design, which addressed all of the issues we
had encountered in the previous designs. We used computer-aided design
(CAD) software to create a 3D model of the proposed design and conducted
simulations to ensure that it would work as intended.
Overall, the trial and error method allowed us to refine our design and address
any issues that arose during the design process. This approach helped us to
create a more robust and effective design for our coin sorting machine.

Figure 12: First Modeling Design we created Figure 13:Second Modeling Design

Page | 23
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

Figure 14:Working Drawing of final Design.

Figure 15: Working Drawing 2 of Final Design

Page | 24
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

Figure 16: Assembly Drawing of Final Design

Figure 17: Assembly Drawing of machine with hardware components

Page | 25
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

8. MATHEMATICAL MODEL OF MACHINE


8.1 Servo motor
The mathematical model of the servo motor can be represented using a transfer
function that relates the input PWM signal to the output position of the motor
shaft.
The construction of the DC servo motor mechanism is significant to EWC for
dynamic response. Besides, the system has to model with load, sensor, and
controlling unit. The voltage-based amplifier is considered for the DC
servomotor system. The sensor output will be assigned as digital data.

Figure 18: Closed loop circuit diagram for servomotor

To find the transfer function of the proposed system, consider


𝑈 = 𝐾𝑣 𝑉
𝑑𝜃
𝑉𝑏 (𝑡) = 𝐾𝑒 ∗
𝑑𝑡
𝑉𝑏 (𝑠) = 𝐾𝑒 ∗ 𝑠𝜃(𝑠) (1)
𝑑𝑖
𝑣(𝑡) = 𝑅𝑖(𝑡) + 𝐿. + 𝑣𝑏 (𝑡) (2)
𝑑𝑡
𝑉(𝑠) = 𝑅𝐼 + 𝐿𝑠𝐼 + 𝐾𝜔
𝑇𝑜𝑟𝑞𝑢𝑒 𝑇𝑔 = 𝐾𝑡 𝐼 (2), 𝑤ℎ𝑒𝑟𝑒 𝐾𝑡 𝑖𝑠 𝑇𝑜𝑟𝑞𝑢𝑒 𝑐𝑜𝑛𝑠𝑡𝑎𝑡𝑛𝑡
𝑀𝑜𝑚𝑒𝑛𝑡 𝑜𝑓 𝐼𝑛𝑒𝑟𝑡𝑖𝑎 𝑜𝑓 𝐿𝑜𝑎𝑑:
𝑚𝑟 2
𝐽=
2
𝑇𝑜𝑟𝑞𝑢𝑒 = 𝐹𝑜𝑟𝑐𝑒 ∗ 𝐴𝑟𝑚
𝑇 =𝐹∗𝑟

𝐼𝑓 𝐽 𝑖𝑠 𝑡𝑜𝑡𝑎𝑙 𝑚𝑜𝑚𝑒𝑛𝑡 𝑜𝑓 𝑖𝑛𝑒𝑟𝑡𝑖𝑎 𝑜𝑓 𝑙𝑜𝑎𝑑 & 𝑚𝑜𝑡𝑜𝑟, 𝑇𝑓 𝑖𝑠


𝑜𝑝𝑝𝑜𝑠𝑖𝑛𝑔 𝑓𝑟𝑖𝑐𝑡𝑖𝑜𝑛, −𝑇𝑓 + 𝑇𝑔 = 𝐽𝛼 (3)
𝑊ℎ𝑒𝑟𝑒 𝛼 𝑖𝑠 𝑎𝑐𝑐𝑒𝑙𝑒𝑟𝑎𝑡𝑖𝑜𝑛,
𝑑𝜔
𝛼= , 𝑊ℎ𝑒𝑟𝑒 𝜔 𝑖𝑠 𝑡ℎ𝑒 𝑅𝑜𝑡𝑎𝑡𝑖𝑛𝑔 𝑆𝑝𝑒𝑒𝑑
𝑑𝑡
1
𝜔(𝑡) = ∫ 𝛼 𝑑𝑡 , 𝜔(𝑠) = 𝛼 (4)
𝑠
Page | 26
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

𝑑𝜃 1
𝜔(𝑡) = , 𝜃 = ∫ 𝜔 𝑑𝑡 , 𝜃(𝑠) = 𝜔 (5)
𝑑𝑡 𝑠
𝐽𝑠𝜔 + 𝑇𝑓 = 𝑇𝑔
𝑁𝑒𝑔𝑙𝑒𝑐𝑡𝑖𝑛𝑔 𝑇𝑓 , 𝑇𝑔 = 𝐽𝑠𝜔
𝐽𝑠𝜔 = 𝐾𝑡 ∗ 𝐼 = 𝑇𝑔
1
𝐼 = 𝐽𝑠𝜔
𝐾𝑡

1 2
𝐹𝑟𝑜𝑚 𝑒𝑞. 2 U = (s J𝜔L + sJr𝜔 + K e K t 𝜔)
Kt
Now factoring ω
𝜔
𝑀(𝑠) = = 𝐾𝑡 (𝑠 2 𝐽𝐿 + 𝑆𝐽𝑟 + 𝐾𝑒 𝐾𝑡 )
𝑈
1 𝜃 𝐾𝑣
𝑀(𝑠) = , =
(𝐾𝑒 (𝑠𝑇𝑚 + 1)(𝑠𝑇𝑒 + 1)) 𝑉 (𝐾𝑒 𝑆(𝑠𝑇𝑚 + 1)(𝑠𝑇𝑒 + 1))
𝐽𝑟 𝐿
𝑊ℎ𝑒𝑟𝑒, 𝑇𝑚 = 𝑎𝑛𝑑 𝑇𝑒 =
𝐾𝑒 𝐾𝑡 𝑟

Figure 19: Servo Motor modeling

The transfer function can be used to analyze the dynamics of the servo motor
system and design appropriate control strategies to achieve the desired
performance. For example, a proportional controller can be used to adjust the
PWM signal based on the difference between the desired position of the traybox
Page | 27
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

and the actual position measured by a feedback sensor (such as a


potentiometer). A derivative controller and integral controller can also be added
to improve the performance of the system and reduce steady-state error.
8.2 Coin Sorter mechanism
To create a mathematical model of our coin sorting and counting machine, we
can start by defining the variables involved in the process. Here are some
possible variables:
𝑡: 𝑡𝑖𝑚𝑒 (𝑖𝑛 𝑠𝑒𝑐𝑜𝑛𝑑𝑠)
ℎ: ℎ𝑒𝑖𝑔ℎ𝑡 𝑜𝑓 𝑡ℎ𝑒 𝑟𝑎𝑚𝑝 (𝑖𝑛 𝑚𝑒𝑡𝑒𝑟𝑠)
𝐿: 𝑙𝑒𝑛𝑔𝑡ℎ 𝑜𝑓 𝑡ℎ𝑒 𝑟𝑎𝑚𝑝 (𝑖𝑛 𝑚𝑒𝑡𝑒𝑟𝑠)
𝑚𝑖 : 𝑚𝑎𝑠𝑠 𝑜𝑓 𝑎 𝑠𝑖𝑛𝑔𝑙𝑒 𝑐𝑜𝑖𝑛 𝑜𝑓 𝑡𝑦𝑝𝑒 𝑖 (𝑖𝑛 𝑘𝑖𝑙𝑜𝑔𝑟𝑎𝑚𝑠)
𝑑𝑖 : 𝑑𝑖𝑎𝑚𝑒𝑡𝑒𝑟 𝑜𝑓 𝑎 𝑠𝑖𝑛𝑔𝑙𝑒 𝑐𝑜𝑖𝑛 𝑜𝑓 𝑡𝑦𝑝𝑒 𝑖 (𝑖𝑛 𝑚𝑒𝑡𝑒𝑟𝑠)
𝐴𝑖 : 𝑎𝑟𝑒𝑎 𝑜𝑓 𝑡ℎ𝑒 ℎ𝑜𝑙𝑒 𝑓𝑜𝑟 𝑡𝑦𝑝𝑒 𝑖 𝑐𝑜𝑖𝑛𝑠 (𝑖𝑛 𝑠𝑞𝑢𝑎𝑟𝑒 𝑚𝑒𝑡𝑒𝑟𝑠)
𝑣𝑖 : 𝑣𝑒𝑙𝑜𝑐𝑖𝑡𝑦 𝑜𝑓 𝑎 𝑠𝑖𝑛𝑔𝑙𝑒 𝑐𝑜𝑖𝑛 𝑜𝑓 𝑡𝑦𝑝𝑒 𝑖 𝑎𝑠 𝑖𝑡 𝑟𝑜𝑙𝑙𝑠 𝑑𝑜𝑤𝑛
𝑡ℎ𝑒 𝑟𝑎𝑚𝑝 (𝑖𝑛 𝑚𝑒𝑡𝑒𝑟𝑠 𝑝𝑒𝑟 𝑠𝑒𝑐𝑜𝑛𝑑)
𝑛𝑖 : 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑐𝑜𝑖𝑛𝑠 𝑜𝑓 𝑡𝑦𝑝𝑒 𝑖 𝑡ℎ𝑎𝑡 ℎ𝑎𝑣𝑒 𝑝𝑎𝑠𝑠𝑒𝑑 𝑡ℎ𝑟𝑜𝑢𝑔ℎ
𝑡ℎ𝑒 𝑠𝑒𝑛𝑠𝑜𝑟
𝑐𝑖 : 𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦 𝑜𝑓 𝑡ℎ𝑒 𝑡𝑟𝑎𝑦 𝑏𝑜𝑥 𝑓𝑜𝑟 𝑡𝑦𝑝𝑒 𝑖 𝑐𝑜𝑖𝑛𝑠 (𝑖𝑛 𝑛𝑢𝑚𝑏𝑒𝑟
𝑜𝑓 𝑐𝑜𝑖𝑛𝑠)
𝑠_𝑖: 𝑠𝑒𝑟𝑣𝑜 𝑎𝑛𝑔𝑙𝑒 𝑓𝑜𝑟 𝑡ℎ𝑒 𝑡𝑟𝑎𝑦 𝑏𝑜𝑥 𝑓𝑜𝑟 𝑡𝑦𝑝𝑒 𝑖 𝑐𝑜𝑖𝑛𝑠 (𝑖𝑛 𝑑𝑒𝑔𝑟𝑒𝑒𝑠)
𝑘𝑖 : 𝑐𝑜𝑛𝑣𝑒𝑟𝑠𝑖𝑜𝑛 𝑓𝑎𝑐𝑡𝑜𝑟 𝑓𝑟𝑜𝑚 𝑠𝑒𝑟𝑣𝑜 𝑎𝑛𝑔𝑙𝑒 𝑡𝑜 𝑡𝑟𝑎𝑦 𝑏𝑜𝑥
𝑎𝑛𝑔𝑙𝑒 𝑓𝑜𝑟 𝑡𝑦𝑝𝑒 𝑖 𝑐𝑜𝑖𝑛𝑠 (𝑖𝑛 𝑑𝑒𝑔𝑟𝑒𝑒𝑠 𝑝𝑒𝑟 𝑐𝑜𝑢𝑛𝑡)
Using these variables, we can derive equations that describe the behavior of the
machine. Here are some possible equations:
Using these variables, you can derive equations that describe the behavior of the
machine. Here are some possible equations:

𝑣𝑖 = √2𝑔ℎ𝑖 , where g is the acceleration due to gravity (approximately


9.81 𝑚/𝑠 2 ) and ℎ𝑖 is the height of the hole for type i coins (measured from the
bottom of the ramp).

𝐴𝑖 = 0.05 ∗ 𝑑𝑖 , assuming the holes are Rectangular.


The angle of the servo for the tray box for type i coins is given by:
𝑠𝑖 = 𝑘𝑖 ∗ 𝑛𝑖
When the number of coins of type i reaches the capacity of the tray box (𝑐𝑖 ), the
servo for that tray box flips it 180 degrees to empty it, and the counter for that
coin type is reset to zero.
Determination of Sliding Velocity and free-Falling Velocity of Coins
The free-falling velocity of coin is expressed as
𝑣𝑖2 = 2𝑎ℎ (1)
Where 𝑣𝑖 is the free-falling velocity in m/s, a is the acceleration in 𝑚/𝑠 2 , ℎ
vertical distance travelled by the coin in mm.
Page | 28
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

The sliding velocity is determined using the following equations.


𝐹 = 𝜇𝑚𝑔 ∗ 𝑠𝑖𝑛 𝜃 (2)
From the Newton second law of motion
𝐹 = 𝑚𝑎 (3)
Equation 2 states the force exerted by an object over a sliding surface having a
coefficient of friction (μ) cardboard is 0.5. The angle of the slider is θ = 30 .̊
From equation (2) and (3) the acceleration is derived as
𝑎 = 𝜇𝑔 ∗ 𝑠𝑖𝑛 𝜃 (4)
Since the relationship between acceleration and velocity is expressed as
Acceleration = (Final velocity – Initial velocity)/Time.
When the coin falls, its initial velocity is zero, acceleration = final velocity /
time Therefore the final velocity = acceleration * time.

Now let's move on to the coin counting stage. We can use IR sensors to detect
the presence of each coin in its respective slot. Assuming that the IR sensors are
positioned x cm below the ramp, we can calculate the time it takes for each coin
to reach the sensor as follows:
𝑡 = 𝑠/𝑣𝑖

8.3 IR sensor
Let's assume that you are using a phototransistor as the IR sensor. The
phototransistor is reverse-biased and connected in series with a resistor, and the
voltage across the resistor is measured to detect the presence of a coin. When a
coin is present, it reflects the infrared light emitted by the IR LED and causes
the current through the phototransistor to increase, which in turn causes the
voltage across the resistor to increase. This voltage can be measured and used to
detect the presence of a coin.

The mathematical model of the IR sensor can be represented using the


following circuit:
The voltage across the resistor can be modeled as:

𝑉𝑜𝑢𝑡 = 𝑉𝑐𝑐 – 𝐼𝑝ℎ𝑜𝑡𝑜 ∗ 𝑅

where Vout is the output voltage of the sensor, Vcc is the supply voltage, Iphoto
is the current through the phototransistor, and R is the value of the resistor.

Page | 29
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

9. PROBLEMS FACED
One of the biggest problems we faced is the problem of designing the project
structure Where we encountered.
• The problem of determining the slope angle of the ramp.
• The problem of locating the sensor.
• The problem of determining the path of coins from the ramp to the box.
• The design was not fully compatible in the first and second time, so we used
the method of trial and error until we reached a suitable design to reduce the
speed of the coins when they pass through the sensor and make a way for
them to reach the boxes and also to hide all connections and electrical
components.
• The servo motor consumes a lot of current, while the Arduino Uno does not
provide more than 40 mA, so we needed to connect the 3 servo motors to an
external power source.
• We discovered after research that if servo is connected to external power
supply and we need to control it using Arduino we should connect GND of
supply to GND of Arduino
• Occasionally the IR sensor doesn’t read coin falling put 2 IR sensor to cover
all displacement that coin across to.
• Finishing of collecting edges and parts thus poor look: make a new model
and covered parts which join to other by wax by welding tape.
• Some parts are separated from its joining: add a second layer to strength
joining edges.
• In Coding LCD was having Fastest Response as IR detect Coin So LCD
code Should have inserted into if condition of Counting to avoid delay.
• The IR sensor Very fast time response so to avoid multiply counting of
single coin we used function delay with delay of output signal with 500ms
(0.5 s).

Page | 30
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

Before

After

Figure 20:Lag of LCD Proplem

Before
After

Figure 21: Making Delay in code to avoid over detecting

Page | 31
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

10. RESULTS AND DISCUSSION


During the testing phase of the coin sorting machine, we observed that the
machine worked well in sorting the coins according to their type. However,
there were a few errors that occurred during the testing phase. These errors
included coins not falling into their designated boxes and IR sensors not
detecting one of the coins.
We identified that the issue with coins not falling into their designated boxes
was due to the boxes being full. As a result, we adjusted the servo motors to
ensure that the boxes were emptied before the next coin was sorted.
Additionally, we also noticed that some coins were not being sorted due to the
IR sensor not detecting them. This issue was resolved by adjusting the
placement of the IR sensor to ensure that it had a clear view of the coins.
Overall, despite these minor errors, the coin sorting machine was able to
successfully sort the coins into their designated boxes. The use of servo motors
to empty boxes allowed for greater flexibility in dividing the coins into specific
quantities, making the machine suitable for use in factories where workers need
to sort coins into specific containers with predetermined quantities.
Furthermore, our approach of using the trial-and-error method for the design
allowed us to come up with a unique and effective design that met the
requirements of the project. This approach was essential as we did not use any
pre-existing designs from the internet, but instead relied on our own knowledge
and creativity to develop the final design.
In conclusion, the coin sorting machine we designed and implemented proved to
be a successful project, with minor errors that were resolved through
adjustments in the machine and its code. This machine is suitable for use in
factories where workers need to sort coins into specific containers with
predetermined quantities, and our approach of using the trial-and-error method
for design proved to be effective in developing a unique and functional design.
10.1 Implemented Solutions of Designing Problems:
1- The placement and inclination of the angle of the ramp are one of the
most important parts of the structure, so the location and angle of the
ramp were stabilized by:
Experimenting with more than one angle with the use of some
calculations to calculate the length of the ramp, the mass of the coin, and
the speed of its fall on the ramp. With the experiment, we discovered the
best value for the angle of inclination of the ramp.
2- The sensor must be placed in a suitable place to sense the falling coin
from the ramp, and it has been settled on the appropriate place through
some experiments to:
- Testing more than one place where the sensor can be placed

Page | 32
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

- Knowing the places through which coins may pass, and thus
placing the sensor in front of it.
- And with experience stability is achieved in the place shown in
the system
3- The problem of coins falling out of the box allocated to them is one of the
most difficult problems that we faced in building the final structure of the
system, so we tried as much as possible to reduce the percentage of this
error by:
- Determine the path of the coin from its fall from the slot
designated for it through the sensor to pick it up to its box by
placing many small pieces and edges to force the coin to follow
this path and reduce its speed, which reduces the reasons for its
exit from the box.

11. CONCLUSION
The coin sorter objective is to save time where huge collections of coins are
stored and periodically valued. The proposed model can be extended to any
type and size of coin to value the time value of the individual. The proposed
system improves accuracy and effectiveness. The proposed coin sorting
methodology and model results with exactness in determining the value of the
coin and sorting the same. The fundamental challenging issues are in identifying
and sorting various small size coins universally. This can be addressed with
the help of picture sensor in the start of the slide and having servo engines that
are constrained by Arduino, so the coins don't blend out and out. Further this
work can be expanded by developing automated system by using huge data of
the coins at various position to improve the sorting efficiency and effectiveness
using machine learning algorithm to make the coin sorting system smart
enough.

Page | 33
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

12. FUTURE SCOPE


Here are some additional expensive components that can be added to a coin
sorting machine:

1. Using mechanism to Count a bigger number of Coins: Using vibratory


conveyor which consist of a box which connected to dc motor which is
coupling to a nut fixed with the box and dc motor is connected to a battery
and a potentiometer which control the speed of motor and coins of course.
2. 3D Printed of Mechanical Design to assure high Quality and reduce Errors
which come up with design like when coin get out of box.
3. Use higher quality IR sensors to reduce error in detecting coins.

4. Under each tray box we can use Load cell to detect the weight of coins as
additional counting mechanism of empty process.

5. Coin authentication technology: Adding coin authentication technology can


help prevent counterfeit coins from being sorted and can improve the
accuracy of the machine. This can include technologies like electromagnetic
signature detection, optical scanning, and x-ray imaging.

6. Multi-currency capability: If the coin sorting machine will be used to sort


coins from multiple currencies, adding multi-currency capability can make
the machine more versatile. This can include the ability to sort and count
coins from different countries, as well as the ability to recognize different
denominations within each currency.

7. Connectivity options: Adding connectivity options to the coin sorting


machine can allow it to integrate with other systems and devices. This can
include the ability to connect to a computer or network for data transfer, as
well as the ability to connect to a printer for printing reports or receipts.
8. Sorting capacity: Increasing the sorting capacity of the machine can allow it
to sort more coins at once, which can improve efficiency and productivity.
This can be achieved through the addition of extra sorting trays or by
increasing the speed of the sorting mechanism.

9. User interface: Improving the user interface of the coin sorting machine can
make it easier to use and reduce the likelihood of errors. This can include the
addition of a touch screen display, intuitive software, and user-friendly
controls.

Page | 34
Helwan University
Faculty of Engineering, Mataria
Mechatronics Lab

13. REFERENCES
[1] Annamalai, Paramasivam & Vidhushini, Prabhu & Arunprakash, N &
Srinivasan, S & Kakulapati, Vijayalakshmi & Subramanian,
Panneerselvan. (2021). Design and Modelling of Coin Sorting Machine.
8202-8208.

[2] Goh Chın Guan (2015) Desıgn And Implementatıon Of An Automatıc


Coın Sortıng And Countıng Machıne, Under Graduate Thesis, University
of Malaysia Pahang.

[3] Prashanna Rangan R (2018), Machine Vision Based Coin separator and
Counter, Recent trendsin Sensor research and Technology, 5(1), 24-30.

[4] Tesfamikael, Hadish & Fray, Adam & Mengsteab, Israel & Semere,
Adonay & Amanuel, Zebib. (2021). Construction of Mathematical Model
of DC Servo Motor Mechanism with PID controller for Electric Wheel
Chair Arrangement. Journal of Electronics and Informatics. 3. 49-60.
10.36548/jei.2021.1.005.

[5] AUTOMATIC COIN SORTING AND COUNTING SYSTEM. (2021,


March). International Research Journal of Engineering and Technology
(IRJET). https://www.irjet.net/archives/V8/i3/IRJET-V8I3235.pdf

Page | 35

View publication stats

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy