TL;DR
This project documents the engineering and development of an Automated Vending Machine designed to overcome the limitations of traditional, non-interactive systems. By integrating a Programmable Logic Controller (PLC) with a suite of sensors and motor-driven actuators, the system provides real-time inventory tracking, automated payment validation, and a robust user interface. The final prototype utilizes industrial-grade logic to ensure reliable operation in high-demand environments.
Problem
Conventional vending machines often lack real-time data integration, leading to degraded user experiences—such as out-of-stock notifications appearing only at the point of sale. From an engineering perspective, these systems frequently rely on rudimentary mechanical linkages or basic microcontrollers that lack the robustness, processing speed, and I/O capacity required for industrial reliability. The primary engineering challenge was to develop a system capable of:
- Providing accurate, real-time inventory management.
- Ensuring reliable product dispensing through high-torque actuation.
- Maintaining a robust control architecture capable of handling complex logic, such as payment validation and safety overrides.
Product Design Iterations
The design evolved from a conceptual “smart” system into a heavy-duty industrial prototype. While initial designs explored pneumatic systems for product movement, these were discarded during the feasibility phase due to the excessive weight of the required valves and cylinders, which would have compromised the unit’s portability.
In response, the team pivoted to a motor-driven spiral coil system. This approach allowed for a more compact footprint while providing sufficient torque to move products through the dispensing path reliably. Furthermore, the transition from microcontrollers (such as Arduino) to an industrial PLC (Allen Bradley Logix 5000) was a critical pivot; it ensured the system could handle complex subroutines—including multi-step inventory updates and safety timeouts—with high-level reliability.
Technical Details
Architecture Overview
This project involved designing, programming, and integrating an industrial-grade automated vending machine powered by an Allen-Bradley PLC programmed via RSLogix 500. The system handles real-time payment processing, product selection validation, precise motor-driven dispensing, optical item detection, and administrative stock control.
+------------------+ +--------------------+ +--------------------+
| Coin Acceptor | ---> | PLC (Micrologix) | ---> | Actuators & Motors |
| & Pushbuttons | | Ladder Logic Core | | (12V DC Coils) |
+------------------+ +---------+----------+ +--------------------+
|
v
+--------------------+
| IR Drop Sensors |
| Feedback Loop |
+--------------------+
Design Logic
The PLC system was programmed in RSLogix 500, utilizing structured ladder logic to execute real-time state control, payment tracking, and safety interlocking.
The program relies on four core operational routines:
-
Price Allocation Routine: System initialization populates registers B3:1 through B3:4 with predefined pricing values for each of the four product slots.
-
Payment & Selection Validation: Coin insertions trigger an infrared pulse sensor (I:0/0) that increments accumulator counter C5:0. When a user presses a product button (I:0/1 to I:0/4), a Greater-Than-or-Equal (GEQ) instruction compares C5:0.ACC against the selected item’s price register.
-
Dispensing & Inventory Decrement: Once funding conditions are met, the corresponding motor output (O:0/1 to O:0/4) latches. Simultaneously, a subtraction block (SUB) decrements the item’s live inventory register (B3:5 to B3:8) by one unit.
-
Admin Override Mode: Entering a specific key sequence (* -> # -> 4-digit PIN) latches the administrative authorization flag B3:12/15. Administrators can directly overwrite stock quantities in memory registers B3:5 through B3:8.
Safety Interlocks & Safeguards
To protect internal mechanisms and prevent false dispenses, several hard-coded safeguards were implemented:
-
Watchdog Timeout: A 20-second timer monitors continuous motor operation. If a motor remains energized beyond this threshold (due to a mechanical jam or sensor fault), the MOTOR_EMERGENCY bit (B3:11/0) triggers, instantly killing motor power and sounding an audible alarm buzzer.
-
Mutual Exclusion Interlocking: Normally closed (NC) contacts are wired across all motor output rungs, making it logically impossible for two motor coils to energize simultaneously.
-
Feedback Verification Loop: Motors do not rely on fixed timers to turn off; instead, an active low signal from the drop-chute IR sensor unlatches the motor output, ensuring the coil stops rotating as soon as the item clears the shelf.
Hardware Challenges
Numpad Integration
The numpad was a critical component for user interaction, enabling PIN-based authentication and product selection. However, integrating the numpad with the PLC presented challenges due to signal compatibility and debouncing requirements. The team replaced the numpad with push buttons, which provided more reliable input signals and simplified the ladder logic required for debouncing.
Coin Acceptor Failure
The coin acceptor module initially selected for the prototype had a mechanical failure during testing, which led to inconsistent coin validation. We integrated it with an proximity sensor to detect coins falling into the storage after the acceptor, ensuring that the system could still track payments even if the acceptor failed to validate a coin. This redundancy improved the reliability of the payment system.
Chute Dynamics & Sensor Dead-Zones
Friction between packaging and the internal wooden ramp prevented items from sliding reliably past a single central sensor. This was corrected by integrating dual IR sensors positioned directly under each individual shelf drop path.