|Last updated||1 December 2019 13:26:57|
We've got a vending machine. We want to use it to sell Arduinos, lockpicks, and similar items of non-trivial value. We probably want to link it to the membership database (selling stuff to non-members is a tax issue), and let people pay by PayPal.
Stuff to sell
List of stuff that would be useful
- FTDI cables or similar
- Cheap microcontroller boards such as arduino, Minimus etc.
- Blank printed circuit board stock (only fairly small pieces will fit)
- Move machine so front door can be opened
- Check motors still run
- Motors currently connected to the original board. Needs testing with some suitable pin driving
- Test position sensing again
- If the initial scheme (switch breaks motor circuit) doesn't easily work, simply rewire the switches for direct sensing. It isn't worth the hassle of the original scheme to save 8 wires.
- Replace locks (it's hard to find locks of the right shape - some have been acquired, but need bending)
- Set up first minimal operation
- Make break beam for successful vend detector
- Interface with coin/note reader
- Make a new pcb for interfacing with VDU
- Make replacement keypad
- test interface with motors
- add in i2c rfid reader
- shorten and remake coin validator cable
She is called "Hopper".
See also: System naming
The vending machine is a Stack Snack made by Slimline Vending of Canada. It used to sell SIM cards at Coventry Airport. It came to us with no coin or note acceptors.
The controller is an LF80 from Coin Acceptors, Inc. We have a manual for it, but it doesn't seem to work. It just displays "----" after outputting version and manufacture date. At any rate, it's probably going to be hard to make it do what we want.
There are 16 motors which are arranged in a grid with two common wires. The black, common wires are positive (!).
The tricky part is the way the vending motors sense their home positions. They have a microswitch on a cam with both NO and NC poles connected to the motor, and the common connected to the power supply. The short blip in current (two per revolution) caused by the switch being triggered is used to sense when the motor has hit its home position. The manual says:
"An interruption in current is defined as a current value of under 20mA for more than 600us. When an interruption is detected within the first 500ms of the vend, it is interpreted as the cam leaving the home position. At this point a 900ms blanking period is started (for multiple interruptions here, use the last one). If no interruption is detected within the first 500ms, the blanking period is the following 400ms, for a total minimum vend of 900ms. During the blanking period all interruptions in current are ignored. The first interruption in current after the blanking period has expired is interpreted as the cam returning to the home position and the motor is turned off. If a valid home signal is not detected within 6 seconds, the motor will be shutdown and considered as bad."
This company writes about how much of a fiddle this is, and how they solved it with an ATMega64.
Is being organised by Artag
Pictures of the old controller board:
Dump of Jasper's state and datasheets for bits on the old board here
motor connectors pinouts:
a b 1 a1 b1 2 a2 b2 3 a3 b3 4 a4 b4 5 a5 b5 6 a6 b6 7 a7 n/a 8 a8 n/a 9 a9 n/a 10 a0 n/a
a & b are the two black common +ve's, a is the one on the end. 1-10 are the rest on the longer connector. I've labeled the connectors but can't find a permenant pen!
The connectors on the end of the board opposite the big caps are the motor connectors, with the connectors on the right the 10 pins at the top are the motor grounds, and the 8 at the bottom are the sources.
The 2003A controls the top 2 motor sinks (pins 1 and 2 on the 2003A), the 5842A controls the rest, and the 5890A controls the sources.
serial data mcu -> 5890 -> 5842A common clock common OE strobes on both 58 chips to 10k pullups.
so clock out 16 bits fiddle the 2 darlington pins and then hit OE...
I've marked the underside of the board which pins on the MCU do what.
I've not seen any sign of current detection on the controller board, but i may be being stupid.
Power to the vending board is 25volts AC, the green wire appears to be redundant.
Artag's Thyristors board works, the controller pins draw 4-5ma at 5V.
Update: i've got it working by reusing the existing board and twiddling the pins with an mbed. See the bits here. The motors.py script spits out some c code that has the right bit pattern in it. notes as been updated as well with some more useful info.
See also the mbed code.
See also: System naming