TECHNOLOGICAL UNIVERSITY OF PERU
Faculty of Electronic Engineering and Mechatronics
Course : Algorithm and Data Structure II
Professor : Drago Jimenez
Report : PROJECT PROGRESS
Members : Case Garcia, Carlos
Luis Miguel Hinostroza Auqui
Lopez Berrocal, Kevin
Ramos Reyna, Maricarmen
Hour : 1:00 to 2:40
Delivery Date: Thursday, September 6, 2013
of the report
INTRODUCTION
The purpose of this project is to save people's time; this machine is referred to as
you can insert a certain amount of money, whether in bills or coins, then
you select the product you want and if the price of the product is lower than the first
The amount entered will give you the corresponding change.
This machine will be very helpful because it will reduce physical labor and
will replace warehouse workers, is designed to perform all tasks for the
sale of products.
Also, it can be said that there is a lower chance of making a mistake when giving the
returned. So its usefulness will be made more effective.
Statement of the Problem
To create a vending machine for products that gives you the option to choose,
entering code on a screen and with another button giving you the option to choose
when it asks for the amount (a bill and coin option), if more than the amount is entered
Once the machine has registered the change, it will release the product.
Advantages of the system
The main advantage of vending machines over traditional sales
their availability at any time of the day is located at:
In the private sector, in offices or factories, coffee machines are typical.
of food products.
In public places, such as airports, train stations, stations of
metro or included in the public way (like newspaper machines, by
example). In these places you can find everything from vendors of
bills to feeding machines.
Incommercial establishmentsat the door of thestores,as the
beverage machines, gift machines, candies or sweets for children.
Highlights the loss of personal contact with the seller (possibility of
making mistakes when giving the product or the change to the buyer) and saving time.
Pseudocode
Vending Machine Algorithm
Define Variables
Entero(i,j)
Real(n,a)
Inico
Machine_Class
Order number string
Candy chain
Real Price
Enter Data()
Start
Read(Order_number,Candy,Price)
End_method
Show Data()
Start
Write(Order_number,Candy,Price)
End_method
end_class
Machine: Mac(10)
Start
Write (Enter currency)
to read
m<-Sensor(n)
Write (Product)
For i<-1 to 10
Maq(i).Order_number
fin_Para
Maq(i).Order_number <- Maq(i).Price
While 50<n Do
EndWhile
a<-bill(n)
While 20<a Do
EndWhile
b <- bill1(a)
While 10<b Do
While
c <- bill2(b)
End
Function a<-bill(n)
DEFINE d, a AS INTEGER
d<-n/20
a<-n MOD 20
Write '20 dollar bills'
Finfunction
function b<-bill1(n)
DEFINE d, b AS INTEGER
d <- n / 10
b<-n MOD 10
Write 10 dollar bills
Finfunction
function c <- bill2(n)
DEFINE d,c AS INTEGER
d<-n/5
c <- n MOD 5
Write d,'currency 5 '
Finfunction
SubProcess m <-Sensor(n)
If m=mf Then
IT IS FALSE
Who
Write 'True bill'
Goodbye
End Subprocess
State Diagram
To identify the coins, the machine has a logical circuit of
recognition of coins and banknotes which activates signals A and B according to
as shown in the Table
As coins are introduced into the vending machine, the logical state of the
it must change to identify how many coins have been introduced.
consumer. These states can be defined using three bits, which are
identified in the following Table by Q1, Q2, and Q3.
The state signals must be generated by three Flip-Flops; where the
EMPTY state means there are no coins in the machine, the state BSF05
indicates that there are 0.5 BsF., the state BSF10 indicates that there is 1.0 BsF, the state
BSF15 has 1.5 BsF., the state BSF20 has 2.0 BsF. and the final state of
process is represented by OUTPUT, which indicates that the payment condition has been
fulfilled executing the product output and restarted the machine to the EMPTY state.
Boolean Equations and Logic Circuit.
The state diagram yields the state transition table of the table.
previously where the outputs D1, D2, and D3 of the three D-type Flip-Flops are specified and
the output S for the different input combinations. The shaded rows in
the table represents the points at which the machine supplies the product and
return to the empty state.
First, the coin is inserted.
In the pseudocode, a combinational circuit is included which consists of 2 variables a and b.
which are represented as an if-else (yes-no) allowing to recognize if the coin is
false, in the case of the mentioned one a volume sensor is used which is distinguished
If a coin is fake or genuine based on its volume. To simulate a fake coin.
we write the number plus a letter example: 12f to show that it is false.
Once the currency is recognized, the selection of the product that will be made out of it proceeds.
The classes and methods will be quickly selected with their respective price. Which
It will subtract with the bill or coin entered at the beginning.
Also, the operations to give change are a series of Half adders (subtraction circuit)
that are left from the amount according to the change that should be given to the customer.
For the delivery of the product, a combinational circuit is to be implemented.
automated with flip-flops that shows us according to Hooke's law how it can be
deliver the products.
Conclusion
After completing this work, we have seen how algorithms are a
a very important tool regarding the advancement of technology at the moment of
recognize if the coin is fake or real.
A critical and systematic analysis of an object was learned in all.
its physical, morphological and structural aspects.