Talking to a Vending Machine MDB With Two Arduinos

by aggrav8d in Circuits > Arduino

47590 Views, 45 Favorites, 0 Comments

Talking to a Vending Machine MDB With Two Arduinos

vending machine.jpg
Vending machine parts all talk to each other on a computer bus known as MDB.  I've written some code to help you plug in and listen to their conversation in real time.  You will need physical access to the vending machine.

Why bother?  Many hackspaces have vending machines now.  With this I hope that more hackspaces can start to poke their machines to do interesting things - take bitcoin, give a discount for a secret knock.... whatever you want.

Grab everything on github

You'll need to build the circuit described in the github project, two arduinos, a USB cable, and your PC with Arduino software.

Build the Circuit

c959611ac5ed11e383660002c9c7c4aa_8.jpg
The MDB 4.2 spec details the safe way to connect and listen/talk to the vending machine.

The github project has a schematic created by the members of the Nottingham Hackspace.  It's really helpful that they added a way to power the arduinos from the 34 volt rail in the vending machine.  They also figured out a lot of the original low level trickery.  Mad props to them.

Follow these references and build yourself a circuit like you see here.  Since this photo was taken I've secured the second arduino to the board.

The black 30 pin connector is part of the MDB cable.  Two optoisolators prevent either side of the sytem from damaging the other.

Install the Code

github-logo.png
Grab the firmware on github, if you didn't already.

Upload "near_MDB" to the arduino next to the circuit board.

Upload "near PC" to the arduino near your computer.

Run!

10254299_659819484073208_444480339_n.jpg
Connect near MDB pin 10 to near PC pin 11.

Connect near MDB pin 11 to near PC pin 10.

Connect near PC to your computer with the USB cable.

Open Arduino and connect to the near PC machine.  It should say "Hello from near PC".

Turn on your vending machine (if it isn't already).  Messages should begin to flow.  Read, learn, and enjoy!

Final Thoughts

gold-star3.jpg
If you liked this tutorial please visit my blog and share with your friends.