Arduino Vending Machine - https://wokwi.com/projects/438885775961384961
Author: sayush
Bring the vending machine experience to life on your desk! This interactive simulation uses the Arduino platform with a keypad interface, an LCD display, and servo-driven dispensers to replicate a miniature vending machine.
Key Features:
Product Selection via Keypad:
A 4×4 keypad lets users choose from four tasty treats: CHIPS, WATER, COKE, or COOKIE.
On-Screen Interface:
A 20x4 I²C LCD clearly displays products alongside their corresponding number keys, making selections intuitive.
Servo Dispensing Animation:
Each product is linked to a dedicated servo motor. When a selection is made, the LCD updates with a message like “CHIPS dispensing…”, and the servo animates to simulate the release of the item—thanks to Servo.write() commands creating a dynamic motion.
Error Handling:
If an invalid key is pressed, the display responds with a courteous “No such product!”, ensuring clarity for the user.
How It Works – At a Glance:
The loop() function continuously refreshes the product menu.
When a key press is detected, the code checks if it matches one of the valid commands (1, 2, 3, or 4).
If it does, the corresponding product is dispensed; if not, an error message appears.
The servo swings to "dispense" the item, then resets to its resting position.
Let me know if you'd like help enhancing the user experience—like adding sound effects, LED indicators, timed selections, or making it adaptable for expanding your product lineup.
0 Replies