Connect a Raspberry Pi 3 via RS485 to a vending machine

Hi @Bill.Thomson,
I was looking for some sort of solution to connect Raspberry Pi 3 to a vending machine via a multi drop bus (available in most new machines).
Can I use a standard RS485 adapter for Raspberry to do that?
Can you help me with more info, please?
(I am more into software development than electronics so, please, be kind with specific terms :slight_smile: )

Thank you,

Hi Daniel,

I don’t see why not. RS485 supports multi-drop, so the USB to RS485 adapters commonly available at places like Amazon or eBay should do the job.
No, you’ll need an MDB to USB or MDB to serial converter, (see post #4 in this thread)

Sure, be happy to. Can you be a bit more specific about the info you’re seeking?
Unfortunately, as I’m not familiar with the MDB spec and protocol, I won’t be of much help.

Thank you, Bill,

I’m just starting a new Raspberry Pi project, involving a connection to a vending machine using a multi-drop bus.
I will use a RS485 adapter for RPi but that is all what I know for now…
I’m a bit worried by the protocol part of the communication, since MDB protocol uses 9 bit frames and not the usual 8 bit ones.
I will ask for your kind help as soon as I am closer to the matter.

Thank you again,

It turns out the “multi drop bus” that vending machines use isn’t RS485.
RS485 does indeed support multi-drop connections on an RS485 bus, but RS485 and MDB are very different from each other.

You need an MDB to serial or an MDB to USB converter.

I won’t be able to help much, as I’m not familiar with the MDB protocol.
You might find this thread helpful, though.

I think that is easy to select a MDB adapter board. that can mount on the top of the raspberry board and use the serial port to communicate with the raspberry, and that MDB adapter will do all MDB communication for you . and then raspberry will only need to send some simple command to add credit value and confirm to dispense the goods.
I think you can check the web side link:
this must be helpful for you

I think you can check the web side link:
this must be helpful for you
If you want to test the adapter box
you also can order the samples from

Hi, we make commercial interfaces for that, both in a Pi Hat form factor as well as an external USB device:

Extensive documentation is available …

and you can buy those simply online:

Made in Europe and well supported.


1 Like

DIY MAB-UART converter

[Edited by PB so that link destination is visible rather than a hidden link in a very short post.]