The Reaktor 23 state is:




  • Steckdosen: AUS
  • Server: AUS
last update:


Mate Dealer


Author:Bouni, Sannny
Fortschitt:80% completed
Rebuild and extend a vending machine with a payment system with database in the background and new cool features.

The MateDealer in its here described configuration is dead. The mechanical parts will be used in the MateDealer 2.0 project.

Possibly the translation is not complete, wrong or incomprehensible! If you have any questions, fell free to ask on the mailing list.
See Hackerspace page for info

The initial state

  • Manufacturer: Sanden Vendo
  • Model: VDI 100-5
  • 5 Product columns
  • Operating Voltage: 230VAC 50Hz
  • Power consumption: 450W
  • Weight: 200kg (~440 lbs)
  • Build year: 02/2003
  • Purchase price: ~400€
  • Coin Acceptor NRI G40.4000/4-0752 (EUR & GBP)

That's how the vending machine looked when we got it.

Vending machine documents

project history

December 2010

  • 04.12.2010: We have logged the communication from the VMC (Vending Machine Controller) to the coin acceptor the first time.

January 2011

  • 25.01.2011: After a while of reading the MDB Specification, we did some experiments with Optocouplers and a STK500 + AtMega644P, trying to read the communication between VMC and coin acceptor . Unfortunately we hadn't much luck. Possibly the type of optocoupler (PC814) is the problem.

February 2011

  • 19.02.2011: After we noticed in December, the log of the communication shows that no cashless device is addressed, we wrote an email to the manufacturer of the vending machine to get another EEPROM which hopefully will address this cashless device we want to simulate by the AtMega644P.

March 2011

  • 01.03.2011: After we replaced the optocoupler by an PC817 the receive of MDB Messages is still not working as expected. The following pictures show the rising/falling edges of the signal. As you can see the rising edge is much to slow. The first picture shows a 10k Ohm Pullup Resistor, the second a 1.5k Ohm.

  • 12.03.2011: Today we experimented with PC900 Fast Optocouplers to get a grip on the problem. The result is a blown up PC900 and a erased/damaged EPROM of the coin acceptor. After that, we did another test with the PC817 board again and changed the values of the pullup (470R) and pre-resistor (560R) and had success receiving MDB Commands!

Milestone The MDB RX is working well now.

  • 23.03.2011: Since today the MDB TX is working fine, too.

Milestone The MDB TX is working.

April 2011

  • 15.04.2011: The first lines of code are written. The MDB protocol is a little bit strange, but it precedes.
  • 20.04.2011: The first two commands (RESET, SETUP) are implemented and work fine. But its still not possible to vend a drink.
  • 21.04.2011: We draw the first drink from the machine. Still not working very well.
  • 22.04.2011: It looks like there is a monstrous bug in the code. Just if you hurry to do a vend after start up the machine, you will get a drink. Otherwise the whole communication collapses.
  • 30.04.2011: We found the problem! A poorly implemented FiFo Buffer caused the problems! Just if the vend was done before the FiFo gets full and fell over to the first position it worked well.After we corrected the problem now the whole vending process workes well. At the moment the control is done by two buttons. Button 1 authenticates the User with a credit of 23€, button 2 approves the vend and removes 2€ from balances.

Milestone A drink can be vended now.

August 2011

  • 01.08.2011: In the last few month the code got rewritten nearly complete. Both, the uplink and the MDB serial connection are now FiFo buffered in Rx and Tx direction and they are interrupt driven now. All the while loops of the old code are replaced now and much more time is now available for other things to do.
  • 02.08.2011: Today the interaction of the Single board PC which runs a python script and the AtMega were tested. From now a database on a server hosts a account for each member of the hackerspace. A member can deposit an amount at the treasurer. The the member can vend a drink and the machine debits the price directly from this account. Furthermore we are able to log how often which drinks were consumed. This happens without logging any relation to the persons

Milestone The backend is in a early alpha state, but works fine.

September 2011

  • 20.09.2011 Es wurde der Entschluss gefasst das Projekt auf ein Arduino Board zu portieren.

October 2011

  • the reewrite of the code is still in progress and takes longer than we thought. The idea of writing „Arduino code“ has been discarded because the Arduino serial lib doesn't support any other mode than 8,N,1. So the code will be c code.

November 2011

  • a lazy month ;)

Dezember 2011

  • another lazy month :(

Januar 2012

  • 10.01.2012: Today we did a few records with the oscilloscope to finde well working values for the pullup resistors and pre-resistor. the results are not pretty good but sufficent.

light blue is the LED side where the Arduino is connected, yellow is the phototransistor side. The baudrate was 9600Baud.

February 2012

  • no progress

March 2012

  • no progress

April 2012

  • no progress

May 2012

  • no progress (but the hope to revive the project ;) )

June 2012

  • I have continued to rewrite the code. Seems that i can do a test within the next Tuesdays :) Yeah baby, yeah —Bouni

July 2012

  • 04.07.2012 Yesterday i worked on the Matedealer again at last. I have not finisched the code, but found several bugs, fixed them and completed the code to the begin session state. The uplink communication works fine now, too. I created a little prototyping pcb that fits on the Arduino Mega 2560 like a schield, and it worked at the first go. —Bouni
  • 11.07.2012 Again on the yesterdays Hackerspace Tuesday i completeted the (main)functionality of the MateDealer. The following MDB commands are now working fine: RESET, SETUP, POLL, READER [ENABLE|DISABLE], VEND [REQUEST|SUCCESS]. Thus means you can: start a session, choose a drink, approve the vend, and enjoy your drink ;)


problems and solutions

wrong coin tubes

  • problem: The coin acceptor has 4 coin tubes, one for each coin type (5cent, 10cent, 20cent, 50cent). One of thees tubes didn't fit the programmed coin type (20cent) which led to malfunction of the coin acceptor.
  • solution: The manufacturer kindly sent us a list of available tubes, so that we could buy one that fits List of tubes (german)
  • costs: ~11€ + tax & shipping.

missing key

  • problem: When we bought the machine, it was open and the key for the built in lock was missing. Because nobudy unauthorized should be able to get access to the vending machine, we had to find a suitable lock.
  • solution: After a while of searching we found this store, and ordered a lock.
  • costs: ~7€ + tax & shipping.

cashless device

  • problem: In the initial state, the machine had an eeprom with an old firmware. This firmware didn't support the addressing of cashless devices.
  • solution: After a phone call to the manufacturer, he offered us a eeprom with the newest version of the bbmdex 5.14 firmware.
  • costs: ~30€ + tax & shipping.

VMC configuration

  • problem: After we replaced the eeprom the structure of the configuration menu has changed. The manual delivered with the machine was no longer useful.
  • solution: We got a new manual from the manufacturer as an email attachment new manual. It does not completely fit the menu structure, but it's better than the old one :).
  • costs: 0€

level monitoring

  • problem: A completely filled column can take 25 bottles. The switches which monitor the level, alert at about 10 bottles left in a column that it is empty.
  • solution: A few stripes of 2mm aluminum (3cm x 10cm) and a little duct tape improved the alert level to one bottle.
  • costs: 0€

Wishes and Ideas

Cashless payment

  • Idea: The main modification is, that want to be able to do the payment cashless. That will be realized through a microcontroller which emulates a cashless device, and a single board computer with wifi which does the comunication with the server, where the database is hosted.
  • Progress: 80%

Exact level monitoring

  • Idea: measure the level of all slots with an analog sensor (Sharp GP2Y0A21YK0F).
  • Progress: 0%

Temperatur logging

  • Idea: log the temperature curve inside the cooling area with DS18S20 1-wire sensors
  • Progress: 0%

control of the cooling unit

  • Idea: control the cooling unit by the microcontroller. The built-in bimetal controller does not work very well.In addition we can realize function like night subsidence etc.
  • Progress: 0%

Display front window

  • Idee: The machine had a terrible advertisement for mineral water all over the front window. We removed it already and plan to insert a dot-matrix display like this one
  • Progress: 5%

MDB Protocol


I decided to solve the electronic „problem“ with a Arduino Mega 2560 + MEGA Proto PCB Shield. That will make it much more easy to reconstruct the project for other hackers. The costs will be nearly the same as if we build our own board from scratch. Possibly we will manufacture a small series of MDB shields or something like that in the future and sell it at cost price. It's a clean solution. —Bouni

Basic wiring

Experimental setup

What we want to have on the PCB

  • 1 Relay to switch the cooling unit on and off
  • 1 Relay to switch the cooling fan on and off
  • Connectors for 1-wire sensors
  • Status LED's, possibly an lc display


The authentification at the machine is planned to be done with GNUPG SmartCards. We already own 2 OmniKey CardMan card readers

How To for GnuPG with SmartCard

Comparable projects

projects/mate_dealer_en.txt · Zuletzt geändert: 20.02.2018 23:20 (Externe Bearbeitung)