Você está na página 1de 10

Vending Machine Report

ECE 2220 – Digital Logic (Fall 2013)

Introduction
Our team set out to design a vending machine for company X and monopolize the
vending machine market. This document includes a brief summary of our design and
the contribution by its creators. It will include a detailed list of features, the
inputs/outputs used, and a breakdown of key components.

Team Members
 Mark Rabena
 Jafer Mohamed
 Abdulaziz Aden
 Alexander Lee
Summary of Features
Our design functions quite similar to a real life vending machine. For one, our design is
able to take 3 different types of coins; quarters, loonies and toonies. Second, we have
included a number of indicators to show the user’s input (which include but are not
limited to: LEDs, SSDs, push buttons, etc. We called this system the “light checker”).
Our design currently supports up to 8 unique products.

We have also implemented a number of “smart” systems such as a refill system where
inventory is tracked and is able to be replenished. Our design can detect when the user
has deposited more than the required amount for our products -- we call this the
“overflow checker.” Our design also includes a “soft” security system to avoid theft by
restricting the user from making selections until full payment is made. Lastly, we
implemented a coin return function for occasions in which the user makes a mistake or
changes their mind about using the machine.

Summary of Inputs and Outputs


Our design works like a cyclical finite state machine (FSM). Initially, there is a preset
value for the price of each item being served by the vending machine.

For example, let us say that the preset price is $2.00. If the price is $2.00, there are a
number of ways to make payments:
1. $2.00 = 1 coin
2. $1.00 + 4 x 0.25 = 5 coins
3. $1.00 + $1.00 = 2 coins
4. 8 x 0.25 = 8 coins
Our design uses push buttons to model the different coins. We used 3 push buttons for
different monetary values; namely quarters, loonies and toonies. Also, we used 3 green
light emitting diodes (LEDs) to indicate that the inputs from the push buttons are being
received. As the user is inputting values, 3 seven segment displays (SSDs) show
numerically how much change still needs to be deposited. Once the required amount is
paid, the user can now choose from a selection of products. We modeled the selection
process using an array of switches and corresponding red LEDs on the Altera Quartus
board. For simplicity, we used 8 switches and 8 LEDs. After a selection is made, the
machine returns to its initial preset state.

There are a number of additional features that we have implemented in our design, one
of them is a refill system. For the refill system, as products are selected, a down-counter
(preset at 3) simulates their depletion. When the counter reaches zero, the LED for that
product will always be off and that selection will be invalid. An additional switch acts as
a refill mechanism which, when active, replenishes the inventory.

Another feature of our design is the coin return system. For the coin return system, the
user simply needs to press the same push button as the “Enter/OK” and everything
(including the upcoming cash overflow display) will return to the original preset state.

Another feature of our design is the cash overflow indicator. For the cash overflow
indicator, 3 SSDs have preset values of zero. When payment is made, the overflow
checker checks whether the payment was over the amount required. If it was over, it is
displayed (up to $1.75 overflow).

FSM
For our design we incorporated a 9 state finite state machine (FSM) to check and display
user input. To help us understand the process, we drew a finite state diagram (figures
shown below). Truth tables were derived from this finite state diagram and from the truth
tables, we made custom SSD outputs using a number of multiplexers to account for the
many state combinations. We stored data for the change using t-flip flops with quarters,
loonies, and toonies corresponding to binary values: 0001, 0100, and 1000 respectively. We
then used 2 full adders to obtain the desired value in terms of quarters only (1 Loonie
corresponds to 4 quarters, etc.). A comparator was used to check whether this value was
greater than 1000 (or 8 quarters). If the sum totaled to 8, a signal would be sent to the light
checker.
FSM Truth Tables

Light Checker
Initially all the selector LEDs are on; indicating that there are products available for
selection. If a LED is off during the selection process, this means that the product is out of
stock. If two products are being selected at the same time (two switches active), all the
LEDs will turn off and no selections can be made. In this way, the light checker makes sure
only one selection (or only one switch) may be active at any point in time.

Refill
For our refill system, we have a down counter that starts at count 3. We achieve this count
using 2 T-flip flops which gives us a maximum count of 3. Additional T-flip flops may be
added to increase the maximum count. The T-flip flops will count how many times the a
particular switch has been turned on and how many times the enter/clear/coin return button
has been pressed for each individual switch. Once a product is depleted, the light will not be
displayed until the refill switch is activated.
Currency Block
Total Currency

Refill
Cash-back
Counter Block (for Refill)
Coin Back Truth Tables

Yassin:Reset and Coin back

In our vending machine, we incorporated a reset function to return to the preset state. If the
user were to make an error, he could press the reset button on the vending machine to get
back his money.
For the coin return function, we used a comparator to check if our required value of $2.00
has been paid. The comparator determines what the output should be (less or greater than
the binary number 8). If it is greater, the cash overflow will be displayed. Otherwise the the
seven segment display will show zeros. We were able to implement this by using a
multiplexer and a BCD to display the output on a two seven segment display. From Figure
X, we see that each of the outputs are similar to the inputs. Therefore! you get your cash
back. To cut the story short we are lucky we have a better coin return system than winnipeg
transit……..

further advancements we could have made?

INSERT EXPLANATION FOR THE COMPONENTS


display for the price (multiplexers)
display for the overflow (Yassin)
reset/coin back (inprogress)
Editing & Formatting

Você também pode gostar