
Digital Electronics
Design and Implementation of an FSM-Based Vending Machine Controller
Abstract:
This project focuses on designing a vending machine controller using a Finite State Machine (FSM). The controller accepts coin inputs, tracks the accumulated amount, and dispenses a selected product when the required price is reached. It also supports change return when the inserted amount exceeds the product price. The design demonstrates sequential logic, state transitions, and digital controller implementation.
Project Description:
The project develops an FSM-based vending machine controller using digital logic circuits or Verilog HDL. The example system accepts ₹5 and ₹10 coin inputs and provides a product-selection input.
For demonstration, the product price is configured as ₹15. The controller tracks the inserted amount through different states:
- S0 – Idle: No money has been inserted.
- S1 – ₹5: The accumulated amount is ₹5.
- S2 – ₹10: The accumulated amount is ₹10.
- S3 – Dispense: The required amount of ₹15 has been reached.
The controller generates output signals to activate the product dispenser, return change when applicable, and indicate the current machine status.
Working Principle:
1. The controller initializes in the Idle state after reset.
2. The user inserts a ₹5 or ₹10 coin.
3. The input logic identifies the inserted coin value.
4. The FSM updates its current state according to the accumulated amount.
5. The product-selection input confirms the requested product.
6. When the accumulated amount reaches or exceeds ₹15, the controller activates the dispensing output.
7. If the inserted amount exceeds the product price, the change-return output is activated.
8. The controller returns to the Idle state after completing the transaction.
Notes:
- Use a clearly defined FSM with state registers, next-state logic, and output logic.
- The example product price is ₹15 and can be changed through the controller logic.
- Use separate inputs for ₹5 coins, ₹10 coins, product selection, and reset.
- Include input debouncing or pulse conditioning for physical coin buttons.
- Ensure simultaneous or invalid coin inputs are handled safely.
- Use D flip-flops for state storage in a hardware implementation.
- Use logic gates, counters, or HDL-based logic for amount tracking.
- Test exact payment, insufficient payment, and excess payment conditions.
- Define how the machine handles cancellation and change return.
- Simulation tools include Logisim, CircuitVerse, Proteus, ModelSim, and Vivado.
- Optional upgrades include multiple products, different prices, coin validation, stock detection, and digital payment interfaces.
- This is an educational controller prototype; a practical vending machine requires reliable coin validation and secure dispensing hardware.
Expected Outcome:
The expected outcome is a functional FSM-based vending machine controller that accepts coin inputs, tracks the inserted amount, and dispenses a selected product when the required price is reached. It can also activate a change-return mechanism for excess payment. The project demonstrates state-machine design, sequential logic, input processing, output control, and digital automation for vending machines and self-service systems.
All Projects




