Jump to content

Vending machine

From /dev/hack

We have a vending machine now! It's in the kitchen.

Specs

Automated Products Snackshop 6600

CoinCo 9300-L series coin exchanger

MagPro MAG50B and MAG50SA bill acceptor

What can we vend???? HELP WANTED

There are 4 "gum" slots which will dispense anything that is sufficiently stiff and gum-sized, like flash drives. Items must not have loose parts or otherwise.

  • [Tara] Calorie Mate
  • PlusLife COVID PCR tests
  • Thai Tom cash
  • Pedialyte packets
  • Earbuds/Headphones
  • Nespresso pods
  • Orbic Rayhunters (if we have more)
  • Condoms????
  • HRT supplies
  • Hard drives (on the top shelf)
  • NFC tags (*we* pay *you* to take them)

Size constraints

A previous version of the page indicated that an item can be up to 5x5x2in, but there are multiple sizes of corkscrew and it's not clear which row has this dimension. Additionally, the gum slots need to be measured.

Future plans

It would be pretty cool to get this integrated into a devhack monopoly money economy. If a snack costs 20 hackbucks hypha thinks we should give people 10 hackbucks every time they tap in to the space and 20 hackbucks if they do a chore (honor system, triggered by tapping your cardkey on an NFC reader?)

NFC Reader

At a glance it seems like the PN532 might be appropriate if we're driving the whole machine with a Pi Pico W 2 which would be hypha's first choice. If we use a SBC we can use a normal NFC reader.

Accepting actual money credit cards???

I don't think we should do this.

Reverse-engineering

The thing is ancient so pretty much every connector in there is as parallel as it could possibly be. They probably made it work using shift registers or something painful. Getting it working will require some sort of serial->parallel situation, hypha wants to use I/O expanders, possibly PCAL6524 because they have hella pins and you can put 4 of them on the same I2C peripheral by tying ADDR to different pins.

Buttons

This appears to be a button matrix. To be reversed. Should be reasonably straightforward with a multimeter. We think they actually separated out each axis of the matrix into separate connectors, which would be very kind of them. It's not clear to me whether the buttons work? There's no action, maybe they somehow sense force.

Display

It uses a 7 segment display with 8 digits. According to Noobu it has some decimal points and status LEDs. We think the top 8 rows of the display header on the original logic board correspond to the display, which implies there may be a common pin per digit and then segment pins are shared across multiple digits. So 8x7 matrix. It might also be 8x8 which could include decimals and possibly also status LEDs?

Cash handling

It can accept bills and coins, but the bill handler seems to be busted because there's a torn up dollar bill taped to the glass on the machine.

Bill handler

TBD how it works. Also unclear where it even is. Maybe someone took it home? We'll likely be putting a mag stripe reader in the slot where it used to be, anyway.

Coin handler

Unknown status.

Motors

Motors are attached to trays, and connect to the controller board via a backplane and a wiring harness. The motor wiring harness is an 18 pin connector (with one pin unpopulated, serving as a key) that goes to the shared 18 pin backplane. The harness is labeled with rows and columns.

Main motor modules

The motor modules are composed of a gear motor, a shaft, a cam/microswitch to help the system home, and a controller board with some diodes on it (a series diode to allow the motors to be controlled in a matrix, and a flyback diode). The motor modules connect to a backplane via some contacts on the back of the vending tray/shelf/thing. Each shelf has a different common pin (let's call it ground? could be power) and one pin per actuator. Looking at the labels on the wiring harness, the matrix seems to be 10x7, but we think there are only 8 actuators on the widest row so there may be 2 dead column pins and 1 pin not connected to anything at all, corresponding to the key on the wiring harness's connector.

The microswitches seem to switch in/out a parallel capacitor across the motor leads. We can detect this reactivity if we PWM the motor by looking at the current draw over the course of the PWM cycle.

Relevant patents

Older (1983): https://patents.google.com/patent/US4458187A/en

Improved (1987): https://patents.google.com/patent/US4785927A/en

The 1987 patent seems to be the one to follow.

Gum dispenser motor modules

The motor modules seem to be similar. Pulling out the drawer all the way is difficult so this was determined by physical touch. We have also confirmed that these motors are addressed using the same wiring harness as the corkscrew motors. It is not clear whether they are homed using the same technique.

Wiring harness

The backplane powering the motor modules is connected to the controller board via a wiring harness. The purpose of the 5 pin connector (1 NP/key) is unclear, but it comes out of the same bundle as the wires going to the backplane.

The 18 pin connector (1 NP/key) goes directly to the backplane (verified with multimeter, it's also labeled).

There's another connector with some heavier-gauge wire that goes into a daughter board and then seems to go from there to the cash handling system. It might be power? Power for what? Where does it go? Maybe the light?