create an application for a vending machine ithat dispenses
create an application for a vending machine ithat dispenses items such as snacks ( 5 types) and beverages (at least 5types), to customers automatically, after the customer inserts currency the machine. The application should display the list of all items available to thecustomer and should return the balance money to the customer after dispensing the requested item. this is for java can the gui have pictures and buttons and stuff thanks. it has to look good thanks everyone
Solution
the proposed machine which can vend four products that is coffee, cold drink, candies and snacks. Four select (select1, select2, select3, select4) inputs are taken for selection of products. Select1 is used for the selection of snacks. Similarly select2, select3, select4 are used for coffee, cold drink and candies respectively. Rs_10 and rs_20 inputs represents rupees 10/- and 20/- notes respectively. A cancel input is also used when the user wants to withdraw his request and also the money will be returned through the return output. Return, product and change are the outputs. Return and change vectors are seven bits wide. Money is an in/out signal which can be updated with the total money of all products delivered at a time. Money signal is seven bits wide. Money_count is an internal signal which can be updated at every transition. This signal is also seven bits wide. If the inserted money is more than the total money of products then the change will be returned through the change output signal. The products with their prices are shown by table 1. There are also two input signal clk and reset. The machine will work on the positive edge of clock and will return to its initial state when reset button is pressed. The proposed vending machine is designed using FSM modelling and is coded in VHDL language. The detail of the entire signal with their direction and description .
DESIGN METHODOLOGY
The state diagram mainly consists of four states (User Selection, Waiting for the money insertion, product deliveryand servicing (when product_not_available=’1’)). Initially when the reset button is pressed, the machine will be ready for the users to select the product. This state is the initial state of the design. After this the user will select the product to be dispensed. This state can be one of the select1, select2, select3 and select 4. The machine can accept only two types of notes i.e. rupees 10/- and 20/-. Let us suppose that the user selects sel1 input. The machine will firstly check that whether the products are available in the machine or not. After this the control unit will move to the waiting state, where it will wait for the money to be inserted. Then if rupees 10/- note is inserted then the machine will go to state_1 and wait until the desired money is inserted. And if rupees 20/- note is inserted the machine will move to state_2 and then wait until 30/- rupees are inserted to the machine. When the desired amount is inserted the machine will go to the snacks state and snacks will be delivered at the product output. If products are not available in the machine then the control unit will demand for servicing and after service the machine will get reset. This methodology is explained using a flow diagram .
There is also an additional feature of withdrawing the request if the user doesn’t want to take the product. When cancel button is pressed then the money inserted will be returned to the user through the return output. A money_count signal is used for calculating the total money inserted in the machine. And if the money inserted is more than the money of the product then the extra change will be returned to the user. The total amount of the product taken at a time is shown by the money signal. Similarly the user can select and get the other products following the above procedure.
