Cash-Caching Automaton
Creator: |
Contents
Overview
The Cash-Caching Automaton, or "CasCA", is a machine designed to dispense coins to Makers for use with the drink, candy, and snack machines. Many people don't carry around cash or change, but the vending machines at the shop currently only accept coins or dollar bills. This machine will make use of personal accounts assigned to Makers that may be funded by PayPal, Bitcoin, and other manual forms of payment, like checks or cash. Below is the current list of desired features:
- The machine should be able to reliably dispense a user-selectable number of quarters (not too few, or too many)
- It should be able to offer multiple forms of user-authentication:
- Username + password
- Makers door-authentication thumbdrive (plus optional pin number/password)
- (Possible) Smartphone authentication via QR displayed on screen
- (Possible) Other smartphone authentication: NFC, Bluetooth, WiFi?
- (Possible) RFID tag
- (Possible) Google Authenticator
- Accounts should be automatically fund-able at the machine via PayPal or Bitcoin
- Accounts may be manually funded via check or cash
- Can show account balance on screen
- MUST have secure connection to a secure database for transactions
- Easy to physically refill with quarters
- Automatic email notification when low on quarters
- Display a message on a screen when low on quarters
- Able to dispense coins without an account when using PayPal or Bitcoin
- Physical and account-based intrusion detection and notification
v0.1 Requirements
- Only dispense $0.50
- Determine amount in machine
- Dispense change
- Don't charge if there isn't any money.
- USB Member Authentication
- Manual Deposit
- Red empty light
- Remove dollar acceptor
v0.2 Requirements
- Remove the need for the Dockstar+Arduino by switching to a Raspberry Pi
- Allow for non-member USB devices
- Cache LDAP results to dispense faster
- Allow for basic functionality without network access
- Paypal and Bitcoin deposits
- Webpage to view current balance
- Automatic database backups
- Management webpage to create accounts, manage cash deposits
Ideas
Dispenser
We've purchased a old change machine from a guy out in Trinity. It is a small, tabletop unit that should work quite well for the quarter dispenser, since it already handles giving out quarters and checking for low levels. It is also already lockable and theft-resistant. The machine's dollar acceptor did not work, so we will not be able to retain the bill-to-quarters functionality.
A previously proposed design for the dispenser was to use a tall 1" i.d. pipe (PVC) to store the quarters to be dispensed. The bottom of the pipe would have small slot where a single quarter may slide though and a sensor to detect whether there are any quarters remaining. A servo would move forward to push a quarter out of the slot, and move back to let the stack of quarters slide down.
Materials
TBA
Electronics
v0.1 Electronics
- Arduino Uno
- Controls the change machine (dispensing, activating the light)
- Keeps track of the number of coins remaining in the machine
- Raspberry Pi or Dockstar
- Runs the transaction DB to keep track of balances
- Runs host-software that listens for USB devices and instructs the machine to dispense coins
- Two-channel relay module
- Electronically handles turning on and off the dispenser solenoid and front light
Future Ideas
- NFC and RFID for authentication
- Tiny combined Bluetooth and WiFi USB card for connectivity
Cost Analysis
TBA
Progress Log
22:57, 5 November 2012 (CST): The small desktop change machine has been acquired and tinkered with. Jimshoe has hooked up a switch that will manually trigger the dispensing of up to four quarters at a time. This switch will be replaced by a transistor or relay that will be controlled electronically.
22:57, 21 November 2012 (CST): Code has been written that interprets commands over serial and calls different functions based on the commands and inputs. This code has been committed to the new CasCA git repository on GitHub.
23:17, 16 December 2012 (CST): Successfully tested relay board with some coin-dispensing Arduino code additions. Added some simple money-tracking to the Arduino code: it can now be refilled, quarters can be dispensed, coin levels checked, and no attempts to dispense coins will be made if not enough coins are in the machine.
00:21, 24 January 2013 (CST): Added basic support for the status light on the machine. When no money is available for withdrawal, the light will blink three times and then stay on. When the machine is refilled, the light will turn back off.
17:11, 10 February 2013 (CST): Separated the DEBUG messages and RETURN messages into different message-types so that the host program can interpret each message correctly. The Arduino code has a #define to compile out debug messages if needed. A Command Reference Guide (CRG) has also been started on the GitHub Wiki to provide information about interfacing with the Arduino from the host software over serial.
23:32, 13 February 2013 (CST): We're successfully dispensing coins and activating the light via serial commands on a laptop; check out the first test video. Coin counts are also now stored in the EEPROM of the Arduino, so that the count values are persisted across reboots of the Arduino, which occur any time a serial connection is established.
11:27, 19 February 2013 (CST): The machine has been connected to the preliminary host software on a laptop and dispenses two quarters when a member's flash drive is inserted into the USB port, if the user account has enough available funds. The host software successfully subtracts the amount from the user's account.
23:22, 20 February 2013 (CST): Arduino code has been updated to remove all money-tracking code, as that will now be done using a user-account on the host software. All commands now have return values, indicating success of the command. The "refill" and "check tube" commands have been removed, a "light" commands have been added. The Command Reference Guide has been updated to reflect this.
23:51, 23 March 2013 (CDT): The machine has been connected to a DockStar that is running the host software. As of this point, the project now satisfies all v0.1 requirements and will soon be ready for official use. The soda machine is currently out of order, however, so some code and hardware is being added to CasCA to regulate the temperature inside the soda machine to bring it back online for now. The Arduino code has been updated to allow for the querying of the current temperature as well as the ability to enable or disable debug mode at run-time.
12:57, 14 May 2013 (CDT): Vending machine temperature measurement works, but temperature control has been removed after a few destroyed relays. The machine has been modified to pull USB authentication from the Makers LDAP server. A few users have been added to the machine and a couple of bugs were ironed out. Version v0.1 is good to go!
12:21, 29 May 2013 (CDT): The machine now emails the user with his or her current balance each time they use the machine. Each night, a status update with remaining quarter levels and transactions from the day are sent to the administrators of the machine.
21:06, 21 May 2014 (CDT): Work has begun on version v0.2 of CasCA. The Dockstar and Arduino are being replaced by a Raspberry Pi, and the backend is being rewritten in Node.js, which will simplify a lot of the USB and web code.
Design
Database
- users
|id|username|email|usb_sn| create table users(id INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(255), email VARCHAR(255), usb_sn VARCHAR(255));
- transactions
|id|users_id|timestamp|usd| create table transactions(id INTEGER PRIMARY KEY AUTOINCREMENT, users_id INTEGER, timestamp INTEGER, usd FLOAT);
Source and Design Files
- The source code for the Arduino and for the backend host software can be found in this CasCA git repository on GitHub.
- The source code for the RaspberryPi and for the backend host software can be found in this CasCA git repository on GitHub.