# Vending machine project

Discussion in 'The Projects Forum' started by Lee Blanchard, Jan 5, 2015.

1. ### Lee Blanchard Thread Starter New Member

Jan 5, 2015
1
0
Hi Everyone,

I am currently studying electronics at college and have been tasked with designing a circuit to do the following;

A hot drink vending machine can give either tea or coffee with or without milk & with or without sugar. Produce the truth table and design a logic system, for a common element to all drinks i.e. the hot water valve, (use all the inputs and only NAND gates in the final diagram). Record the sequence of developing your solution.

Expand the system to show separate indicators for tea, coffee, milk and sugar. Ensuring that tea and coffee cannot be selected together

Has anyone done anything similar as apparently i can get it down to 6 gates and im really struggling

2. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
From saying to use a truth table, is it safe to assume you are to use a combinational logic approach?

The problem description is a bit lacking add it doesn't suggest what the setup is, e.g. what is the underage for the drink dispenser? Are there sugar and cream dispensers as well? Are you allowed to make those assumptions?

If that is not the original wording of the problem, I'd suggest you post that as well, as it may offer more insight for us.

All that said, we don't do your homework for you, you do some work and we'll point you in the right direction from there.

3. ### JDT Well-Known Member

Feb 12, 2009
658
85
You need to produce a state machine diagram.

But before you do this, identify all your inputs and outputs. For example, inputs would include buttons to select type of drink. Outputs might include valves to control hot water, tea, coffee, milk, etc. Also it would be good to have lights in each button to give the operator feedback that the button press has been recognised. In a real machine there would have to be some kind of timer to control the amount of water, etc. dispensed. You might be able to ignore this and just have an output "dispense hot water", for example.

Draw your state diagram (like this).

Once you have done that, you can progress to truth tables.
Logic will ensure for example tea and coffee cannot be selected together. Your state diagram will only advance to the next state with a valid combination of inputs.

Because the system has to step through the states, it has to have "memory" to hold the current state. This means flip-flops. The number of these depends on the number of states your system has. For example, if there are 8 states, you need a minimum of 3 flip-flops (2^3 = 8). 4 will give a maximum of 16 states, etc.

Hope this helps!

4. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
We don't know if the OP has even learned the things you've suggested he do.

The wording in the initial problem seems to suggest a combinational approach is desired.