Difference between revisions of "Equipment/Vending machine"

From London Hackspace Wiki
Jump to: navigation, search
(Motor Controller: add links to pics of the old board)
(needs an appropriate location)
 
(68 intermediate revisions by 14 users not shown)
Line 1: Line 1:
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.
+
{{EquipmentInfobox
 +
|name=Vending machine <!-- Name of the item. -->
 +
|image=VendingMachine.jpg <!-- Image of the item. Leave with placeholder image if none exists. -->
 +
|model=Unknown <!-- Model -->
 +
|category=Equipment <!-- Main category. Please leave alone to keep item in this category -->
 +
|subcat=General<!-- Sub-category if one exists. Please check main listing to see other categories contained within the main one -->
 +
|status=Under construction<!-- Set to one of; Good working order, Faulty, Out of order, Under construction, Out of consumables, Scrapped, or Unknown -->
 +
|consumables=Unknown <!-- Any items used up in normal operation, such as; ink, paper, saw-blades, cutting disks, oil, etc.. -->
 +
|accessories=Unknown <!-- Any items associated with the equipment but not consumable, such as; drill bits, safety gloves, goggles, etc.. -->
 +
|reqtraining=<!-- Is training required to use this equipment? Yes or no. -->
 +
|trainlink=Unknown <!-- If training is required, provide a link to training signup or contact page. Otherwise leave blank. -->
 +
|acnode=<!-- Is the equipment ACnode locked? -->
 +
|owner=Unknown <!-- Provide a link to owners members page if other than LHS -->
 +
|origin=Unknown <!-- If via pledge, please link to the completed pledge page on the wiki -->
 +
|location=Ground floor, middle room<!-- Floor, room/zone and location within that area -->
 +
|maintainers=<!-- NO LINKS PLEASE; it currently breaks the template. If someone is nominated as managing the upkeep of this item, please list them here. -->
 +
|template_ver=1.1 <!-- Please do not change. Used for tracking out-of-date templates -->
 +
}}
 +
==Vending machine - restarted==
  
She is called "[http://en.wikipedia.org/wiki/Grace_Hopper Hopper]"
+
After months/years the the LHS vending machine is being worked on again! We want to use it to sell small stuff like 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
 +
 
 +
*Sugru
 +
*FTDI cables or similar
 +
*Cheap microcontroller boards such as arduino, Minimus etc.
 +
*Blank printed circuit board stock (only fairly small pieces will fit)
 +
*Jeenodes/1-wire sensors/etc
 +
*RFID modules
 +
 
 +
==Updates==
 +
* 15-JUN-2014: Updated (routed) motor control board is at https://github.com/londonhackspace/vend
 +
<S>* 16-DEC-2014: Switching to use the connected launchpads (like the new ACnode), Paddy nearly making the KiCad footprints</S>
 +
<S>* 18-JAN-2015: Routing's been done. Presumably just needs etching and assembling now</S>
 +
<S>* 25-NOV-2015: Boards ordered and on their way from China</S>
 +
<S>* 8-MAR-2016: Board is built, rails are good. Checked internal wiring is good. Taken 2 motors as test subjects to do initial comparator setup etc.. - Paddy </S>
 +
* 5-JUL-2016: Board now working, drivers drive motors, comparators correctly detect motor off, run + jam conditions - Paddy
 +
* 25-AUG-2018 : Now in 1st floor kitchen at Wembley. Cleaned outside of years' worth of dust.
 +
* 21-DEC-2018: Given Notice-of-Disposal by tgreer, expires 11-JAN-2019
 +
* 24-dec-2018: notice of disposal removed and machine adopted by dawidziaja
 +
* 06-FEB-2019: The vending machine now has a working coin mech and can vend things. The software needs some work before the machine can be used.
 +
 
 +
== To do ==
 +
 
 +
<S>* Create board to drive motors (24V)</S>
 +
<S>** Schematic done. pcb layout proceeding. docs in [https://github.com/artag/vend github], help welcome (artag)</S>
 +
* Write firmware
 +
* Fit board + psu (psu ordered 6-7-16 Paddy)
 +
 
 +
 
 +
* <s>Soldering for connector</s>
 +
 
 +
* Replace locks (it's hard to find locks of the right shape - some have been acquired, but need bending)
 +
**Side lock is 30mm. A new one is ordered. I have the cam I made for the old one.
 +
***Lock has arrived, but keying is such that the key can only be removed when the lock is in the open position. The cam is being remade to suit. parts with mentar.
 +
**What is the state of front locks ? We should still have the cams from the old ones
 +
 
 +
<S>* Set up first minimal operation, using breadboard. All laid out - <s>just need values for the current sensing resistors.</s> just need the new driver board.</S>
 +
 
 +
Later:
 +
* Make break beam for successful vend detector
 +
* Interface with coin/note reader
 +
* Make a new pcb for interfacing with VDU ?
 +
* Make replacement keypad
 +
<S>* test interface with motors</S>
 +
* add in i2c rfid reader
 +
* shorten and remake coin validator cable
 +
 
 +
== Name==
 +
She is called "[http://en.wikipedia.org/wiki/Grace_Hopper Hopper]".
 +
 
 +
See also: [[System naming]]
 +
 
 +
==People==
 +
* [[User:ms7821|ms7821]]
 +
* [[User:Artag|Artag]]
 +
* [[User:Mentar|Mentar]]
 +
* [[User:padski|Padski]]
 +
* Matt Rutter
 +
 
 +
* Previously:
 +
** [[User:JasperWallace|JasperWallace]]
 +
** [[User:Solexious|Solexious]]
 +
** [[User:Lauren|Lauren]]
  
 
==Specs==
 
==Specs==
Line 18: Line 102:
  
 
==Plans==
 
==Plans==
 +
 +
===System diagram===
 +
 +
<graphviz border='frame' format='svg' >
 +
digraph rfboard{
 +
  rankdir=TD;
 +
  size="8,5!";
 +
 +
  motors [label="Vend motors (16)",shape=box];
 +
  psu [label="PSU",shape=box];
 +
  vdu [label="Video display unit",shape=box];
 +
  keypad [label="Keypad",shape=box];
 +
  launchpad [label="Launchpad",shape=box];
 +
  internet [label="The internets",shape=box];
 +
 
 +
  internet -> launchpad [label="Ethernet"];
 +
  launchpad -> motors;
 +
  psu -> motors [label="24v",color="red"];
 +
  psu -> launchpad [label="5v",color="red"];
 +
  launchpad -> vdu [label="Serial"];
 +
  launchpad -> keypad [label="?"];
 +
}
 +
 +
</graphviz>
 +
 
===Motor Controller===
 
===Motor Controller===
 
Is being organised by [[User:Artag|Artag]]
 
Is being organised by [[User:Artag|Artag]]
Line 31: Line 140:
 
* http://pointless.net/photos/id/4031/
 
* http://pointless.net/photos/id/4031/
  
===Electronic Payment===
+
Dump of Jasper's state and datasheets for bits on the old board [http://pointless.net/hg/lhs-vending-machine/file/ here]
Is being organised by [[User:Jonty|Jonty]]
+
 
 +
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.
  
===Physical Payment===
+
The sink drivers (5842a and 2003) are grounded via a 1.5R resistor, near R69. Voltage across it is measured on the lm2903 comparator U13, which can give current sensing. The reference voltage is 29mV, making a threshold of 20mA as specified. Motors take about 120mA with no load. Jam detection at higher current may be done by the other comparator - it has a reference of 640mV which would give a max of 420mA.
Is being organised by [[User:Solexious|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)
 
  
* [http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=140466981614&ssPageName=STRK:MEWAX:IT Coin Mech] - Arrived
 
* [http://cgi.ebay.co.uk/NV7-Fruit-machine-note-acceptor-stacker-Refurb-/320598025755?pt=UK_Video_Games_Coin_Operated_MJ&hash=item4aa521a61b Note Mech] - Arrived
 
  
===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
+
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.
  
'''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)
+
Power to the vending board is 25volts AC, the green wire from the PSU goes to chassis.
*CHECK.[item location]
 
  
'''Returns''':
+
Artag's Thyristors board works, the controller pins draw 4-5ma at 5V.
*OK
 
*ERROR.[error text]
 
  
 +
Update: i've got it working by reusing the existing board and twiddling the pins with an mbed. See the [http://pointless.net/hg/lhs-vending-machine/file/ 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.
  
'''Request cash vend of item''':
+
See also the [http://mbed.org/users/Jasper/programs/vending/llg8y6/docs/main_8cpp_source.html mbed code].
*VEND.[item location].[payment amount in p]
 
  
'''Returns''':
+
== Name ==
*OK
 
*ERROR.[error text]
 
  
 +
Named after [http://en.wikipedia.org/wiki/Rear_admiral_(United_States) Rear Admiral] [http://en.wikipedia.org/wiki/Grace_Hopper Grace Hopper].
  
'''Request paypal vend''': (paypal customers get a code, to insure they are getting their vend)
+
See also: [[System naming]]
*PVEND.[code]
 
  
'''Returns''':
+
[[Category:Equipment]]
*OK.[item location]
+
[[Category:Projects]]
*ERROR.[error text]
+
[[Category:Space_Infrastructure_Projects]]

Latest revision as of 13:26, 1 December 2019

Vending machine
VendingMachine.jpg
Model Unknown
Sub-category General
Status Under construction
Last updated 1 December 2019 13:26:57
Consumables Unknown
Accessories Unknown
Training link Unknown
Owner Unknown
Origin Unknown
Location Ground floor, middle room

Vending machine - restarted

After months/years the the LHS vending machine is being worked on again! We want to use it to sell small stuff like 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

  • Sugru
  • FTDI cables or similar
  • Cheap microcontroller boards such as arduino, Minimus etc.
  • Blank printed circuit board stock (only fairly small pieces will fit)
  • Jeenodes/1-wire sensors/etc
  • RFID modules

Updates

* 16-DEC-2014: Switching to use the connected launchpads (like the new ACnode), Paddy nearly making the KiCad footprints * 18-JAN-2015: Routing's been done. Presumably just needs etching and assembling now * 25-NOV-2015: Boards ordered and on their way from China * 8-MAR-2016: Board is built, rails are good. Checked internal wiring is good. Taken 2 motors as test subjects to do initial comparator setup etc.. - Paddy

  • 5-JUL-2016: Board now working, drivers drive motors, comparators correctly detect motor off, run + jam conditions - Paddy
  • 25-AUG-2018 : Now in 1st floor kitchen at Wembley. Cleaned outside of years' worth of dust.
  • 21-DEC-2018: Given Notice-of-Disposal by tgreer, expires 11-JAN-2019
  • 24-dec-2018: notice of disposal removed and machine adopted by dawidziaja
  • 06-FEB-2019: The vending machine now has a working coin mech and can vend things. The software needs some work before the machine can be used.

To do

* Create board to drive motors (24V) ** Schematic done. pcb layout proceeding. docs in github, help welcome (artag)

  • Write firmware
  • Fit board + psu (psu ordered 6-7-16 Paddy)


  • Soldering for connector
  • Replace locks (it's hard to find locks of the right shape - some have been acquired, but need bending)
    • Side lock is 30mm. A new one is ordered. I have the cam I made for the old one.
      • Lock has arrived, but keying is such that the key can only be removed when the lock is in the open position. The cam is being remade to suit. parts with mentar.
    • What is the state of front locks ? We should still have the cams from the old ones

* Set up first minimal operation, using breadboard. All laid out - <s>just need values for the current sensing resistors. just need the new driver board.</S>

Later:

  • 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

Name

She is called "Hopper".

See also: System naming

People

Specs

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.

Plans

System diagram

<graphviz border='frame' format='svg' >

digraph rfboard{
  rankdir=TD;
  size="8,5!";
  motors [label="Vend motors (16)",shape=box];
  psu [label="PSU",shape=box];
  vdu [label="Video display unit",shape=box];
  keypad [label="Keypad",shape=box];
  launchpad [label="Launchpad",shape=box];
  internet [label="The internets",shape=box];
  
  internet -> launchpad [label="Ethernet"];
  launchpad -> motors;
  psu -> motors [label="24v",color="red"];
  psu -> launchpad [label="5v",color="red"];
  launchpad -> vdu [label="Serial"];
  launchpad -> keypad [label="?"];

}

</graphviz>

Motor Controller

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.

The sink drivers (5842a and 2003) are grounded via a 1.5R resistor, near R69. Voltage across it is measured on the lm2903 comparator U13, which can give current sensing. The reference voltage is 29mV, making a threshold of 20mA as specified. Motors take about 120mA with no load. Jam detection at higher current may be done by the other comparator - it has a reference of 640mV which would give a max of 420mA.



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.

Power to the vending board is 25volts AC, the green wire from the PSU goes to chassis.

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.

Name

Named after Rear Admiral Grace Hopper.

See also: System naming