coffee vending machine
We want to create a control system for a coffee vending machine. The machine consists in the following
1. Coin acceptor module
2. Module that serves the coffee
Coin acceptor module
The coin acceptor module is responsible for accepting and counting the coins inserted by the client, in
order to ensure that the inserted amount is enough to buy a coffee. This module consists of:
● a mechanism (M): where the customer inserts the coins;
● a 7 segment display (D): indicates the amount of money inserted by the customer;
● a lamp (L): indicates that the amount inserted is enough to take a coffee;
The mechanism where the customer inserts coins only accepts 0.10€ or 0.20€ coins. The mechanism
has two buttons (M1, M2), one to identify each of the coins inserted by the customer:
● When a 0.10€ coin is inserted, button M1 is activated.
● When a 0.20€ coin is inserted, button M2 is activated.
● Any other coins are ignored by the system
The price of each coffee is 0.30€. Once the client inserts 0.30€ or more in the machine, lamp L should be
turned on and the customer is allowed can take its coffee.
The 7 segment display indicates the total amount of money inserted by the client, up the maximum of
0.30€. When a client inserts a coin, the display should be updated. If the total amount inserted exceeds
0.30€, the machine ignores it and the display only shows 0.30€. The 7 segment display shows the total
amount of money inserted by the client, according to the following table:
Total inserted Display
0 € 0
0.10 € 1
0.20 € 2
0.30 € or more 3
The coin acceptor module is connected to the module that serves the coffee. After the coffee served, the
coin acceptor must be reset and, display the value 0 in the 7 segment display and turn off lamp L.
Module that serves the coffee
The module that serves the is responsible for preparing the coffee and consists of the following
1. a button to start preparing the coffee;
2. a coffee dispenser;
3. a sugar dispenser;
4. a water pump;
5. a lamp that indicates when the coffee is ready;
This module should be connected to the coin acceptor module, and should only allow the client to take a
coffee after the amount of money inserted is greater or equal than the price of a coffee. After enough
money has been inserted in the machine, if the button to prepare the coffee is pushed, the machine
should start to prepare the coffee, performing the following tasks in order:
1. Actuate the coffee dispenser for 1 clock cycles
2. Actuate the water pump for 2 clock cycles
3. Actuate the sugar dispenser for 1 clock cycle
After the coffee is served, the module should turn on the lamp that indicates the coffee is ready and
inform the coin acceptor that the coffee has been served, so that it can reset the amount of money
inserted by the customer.
Implement the coin acceptor module and the module to serve coffee separately. For each module, follow
the usual procedure to synthesize sequential circuits:
1. Clearly define the inputs and the outputs of the circuit.
2. Draw the ASM model. Do not forget to include the mnemonics, the coding of the states, boolean
expressions associated with the decision boxes and the value to select the next state.
3. Draw the state transition and output tables; make sure the tables are consistent with the coding
used in the ASM model.
4. Choose the type of flip-flop you wish to use (D, JK, T).
5. Find the expressions for the flip-flops and for outputs; use the excitation tables of chosen
flip-flops to draw the Karnaugh maps and extract the simplified expressions.
6. Project the simplified circuit in Logisim simulator and test it.
After implementing both modules, combine them in Logisim in order to implement the coffee machine