Introduction: Talking to a Vending Machine MDB With Two Arduinos

Picture of Talking to a Vending Machine MDB With Two Arduinos

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.

Step 1: Build the Circuit

Picture of Build the Circuit

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.

Step 2: Install the Code

Picture of Install the Code

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.

Step 3: Run!

Picture of Run!

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!

Step 4: Final Thoughts

Picture of Final Thoughts

If you liked this tutorial please visit my blog and share with your friends.

Comments

mdebono (author)2015-05-14

Hi I am trying to do this project but when i went through the schematic diagram there are two capacitors with a ? next to it and no values can you give the values of the capacitor needed please.

Thanks for your help

zemag14 (author)mdebono2017-02-18

Did you ever find out the value for those two capacitors? Thanks for your help!

rogduarte (author)2015-03-25

Hi aggrav8d,

Congratulations for this post, I am very interested to do this project, I am starting to use arduino and I think I can do it, just looking for the circuit diagram and I can´t find it, how can I download it?

АндрейМ2 (author)2015-03-10

Hi, may be here it works...

I try to use your files from github, but have some problems.
First of all, am I to connect To_Nanode_Rx to NearMDB Arduino Rx (D0) and To_Nanode_Tx to NearMDB Arduino Tx (D1) &
Should there be answer from NearMDB Arduino (A1) on serial port monitor of NearPC Arduino (A2) even when MDB is not connected?

Sorry for dumb questions, I just neeed a kick to start)

jasit (author)2014-08-26

is it possible that you could supply a component list for the parts you used. I switched our drink machine to rfid, and everyone wants me to switch over the vending machine

dgomez19 (author)2014-06-02

the coin machine is one of these(pictures), i want comunicate one whit a pc.

dgomez19 (author)2014-06-02

Hi, I want to connect a coin changer mdb to pc, can i try whit your code whit the two arduinos or i need change some lines??

thanks for your time and your help

About This Instructable

25,063views

32favorites

License:

Bio: I want to build my moon base with remote controlled robots and solar sintering.
More by aggrav8d:Aduino I²C 2-Way CommunicationArduino Starter Kit 2: Use Buttons for LED ControlArduino Starter Kit 1: First circuit and program to control an LED
Add instructable to: