Equipment/Vending machine

From London Hackspace Wiki
< Equipment
Revision as of 19:16, 8 January 2011 by JasperWallace (talk | contribs) (Motor Controller: add links to pics of the old board)
Jump to: navigation, search

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.

She is called "Hopper"


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.


Motor Controller

Is being organised by Artag

Pictures of the old controller board:

Electronic Payment

Is being organised by Jonty

Physical Payment

Is being organised by Solexious

The vending machine will take physical cash in the form of coins and notes, but will not give change. Any left over cash will be taken and marked as a donation to the space. (This will be clearly displayed before purchase)

Arduino serial protocol

The arduino will take input and physical payment, and make requests to its server (the server also takes the paypal payments). This is the proposed communication protocol.

All strings are terminated with \n

Request check item: (to check if an item is in stock/available, this reserves 1 of the item for 5 mins to allow for payment to be taken)

  • CHECK.[item location]


  • OK
  • ERROR.[error text]

Request cash vend of item:

  • VEND.[item location].[payment amount in p]


  • OK
  • ERROR.[error text]

Request paypal vend: (paypal customers get a code, to insure they are getting their vend)

  • PVEND.[code]


  • OK.[item location]
  • ERROR.[error text]