Vegetable Vending machine
- A finite state machine or finite state automaton FSA, finite automaton, or simply a state machine, is a mathematical model of computation.
- An FSM is Defined by a list of its States, its initial state, and the conditions for each transition.
- As shown in the figure, the main process starts when the coin is inserted, else there is a continuous checking of the coin been inserted or not. once the coin is inserted, the same is sorted to check its authenticity and the value the value is added to the sum and the sum is compared with the cost of vegetable.
- In case if the sum has not yet reached the cost of vegetable, the control is again transferred to the state waiting for the coin.
- In case of the coins entered sum up to the cost of vegetable or more than its cost, the control is transferred to to the states shown on the right hand side of the figure In case if the sum is equal to the exact cost of the vegetable, the vegetable is dispensed out using a solenoid valve and the system returns back to start.
- In case if the amount entered is more, the extra amount is refunded and the vegetable is dispensed followed by again state transition to the beginning.
Hardware selection and challenges:
The hardware for coin sorter has to be very precise. It has to not only weigh the coin inserted but also compare its image with standard to provide the authenticity. This component has a lot of importance in the entire system. The vegetable dispensing can be done using a roller, that rolls the vegetables out of the machine. This roller should also provide perfect pressure so that the vegetable does not get damaged due to more pressure. The microcontrollers size and speed are not very important as the machine will have enough space for the microcontroller to be placed. The keypad and display system to select the vegetable and weight would be required. To make an advanced system we would keep camera to take the images of the vegetables for the consumer to understand if the vegetables are fresh or not, colour of the vegetable , etc. Also there is no constraint on power consumption as there will be mains power connected to the system, hence any simple microcontroller with all the required facilities can be selected. If the image processing part of the image comparison for coin recognition is to be implemented, then the microcontroller must be selected accordingly that has DSP (Digital Signal Processing) or IP (image processing) features