WAFER MDB-RS232 User manual

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 1 of 12 http://www.waferlife.com
Shanghai Wafer Microelectronics Co., Ltd.
23E,Liang Feng Building,NO.8,DongFang Road,Shanghai,China Tel.: (0086) 21 6845-8945 Fax: (0086)21 5045-4820
MDB Coin Changer and MDB Bill Acceptor
to RS232 Interface
Model: MDB-RS232 (New Version box type V3)
SPECIFICATIONS
Communication format:
Baud rate: 9600 Start bit: 1
Data bits: 8 Parity: NO
Stop bit: 1
PC data Send: Hex
PC data Receive: ASCII
Hardware Specification.
Power Min 20 VDC ( Normal working voltage 24...30 AC or DC )
Consumes an idle current < 0.05A (No MDB payment device connected)
Cable MDB connector, Standard RS232 serial cable and DC2.1 Power connector
Dimensions approx. 100 x 42 mm (Not include the cables)
Weight approx. 100 g
Install the MDB-RS232
( VMC can be Computer(PC) or PLC or Android main board )

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 2 of 12 http://www.waferlife.com
Below is the picture of two types of MDB-RS232, the same function and protocol ,the only
difference is Three LED version will enable the payment device from the start and Five LED
version start with disable status for payment device and user need to use the enable command
to enable.
(1) RS232 connector to Computer COM port
(2) Power connector for AC/DC power supply (Normally we use the DC24V)
(3) MDB connector to bill acceptor,coin validator or card reader

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 3 of 12 http://www.waferlife.com
(2) Power connector for AC/DC power supply (Normally we use the DC24V)
(3) MDB connector to bill acceptor,coin validator or card reader
(4) GPIO to Raspberry Pi board (Use RXD, TXD, GND and Ouput 5V to Raspberry pi)
(5) Serial port to PC (Can use this port to test with PC software)
Installation is relatively simple; there are only three connections that must be made for full
functioning of the device. There are connectors on the MDB adapter box.:
One cable plugs into a 24VDC power supply. (When connecting the DC24V power supply,
there is no need to consider the specific polarity. The 6-pin Molex connects to the MDB devices.
The final connector is a DB-9 and connects into the back of the computer or any other main
board with RS232 port. There should be an open port on the back of the computer labeled
“SERIAL2” or “COM2.” If you only has the USB port on your computer,then would be easy for
you to order a RS232/USB adapter.
For MDB-RPI board,has two serial port to PC and also to Raspberry pi board GPIO.Also it
will supply the DC5V voltage for Raspberry pi board.
After connected the device,and then Apply power on with DC24V. Check for “Power Status”
LED on the box (RED led) indicating power is OK.
If the MDB device is properly connected and working properly,then the “MDB Status” LED
should start to flash.
On the MDB-RS232 box also has another “PC Communication” LED,that would be flashing if
has any data sendt from MDB-RS232 box to PC.
Software
The MDB-RS232 sends information generated by the MDB device directly to the PC via RS-232
serial communication. There is no need to poll each MDB device. This is done by the
MDB-RS232. By default the MDB-RS232 will poll all known MDB devices. The MDB-RS232 then
sends data to the PC if there is activity. The information sent to the PC is send as bytes in
hexadecimal. For activity data,the first byte sent is the device ID. For example 30 XX means that
a bill validator has sent information. Whereas 08 XX means that a coin mechanism has sent data.
Consult the MDB V4.2 command specification for commands specific to your MDB device.

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 4 of 12 http://www.waferlife.com
MDB-RS232 Software Communication
Receive and Transmit
Use an interrupt driven comm event on the appropriate com port. Settings are
9600-8-1-None.
MDB OPERATION INSTRUCTIONS:
For BILL VALIDATOR
Bills Accepted (Byte 1) 1yyyxxxx
yyy = Bill Routing
000 = Bill Stacked
001 = Escrow Request
010 = Bill Returned
011 = Not Used
100 = Disabled Bill Rejected
xxxx = Bill Type
How to use the command to communicate with the MDB-RS232 adapter box?
Data sent and reply are all compabitle with the MDB protocol.
PC command: Just use the same command as the MDB protocol for VMC
PC received data1: Any data sent back according to PC query instructions, that is the same
format as the MDB protocol,no need to add the first device ID byte
PC received data2: Any activity data from payment device will be sent to PC automatically
and the first byte is the device ID
For example, Coin acceptor setup command: 09
After sent the data 09 from PC , then adapter box will read and send back the coin acceptor
setup information: 03 11 56 05 01 00 03 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 76
For example, Bill acceptor enable command: 0C FF FF FF FF
After sent the data 0CFFFFFFFF from PC , then adapter box will send to bill acceptor and
send back the validator response Data: 00
Above PC received data,don’t have the device ID at the first byte,but following data will have
Activity data from coin acceptor,For example a coin is accepted will be sent to as: 08 51 00
51 00 is the activity data from coin acceptor and when report the data to PC, MDB-RS232
add the first byte device ID 08h
Activity data from bill acceptor,for example,bill acceptor is disabled will be reported as: 30 09
09 is the activity data from bill acceptor and MDB-RS232 add the first byte device ID 30h
(Just simply noted: Automatically reported data will have the device ID byte)
Must be noted again
Any data sent from PC to MDB-RS232 box, that should use HEX data
Any data that PC received from MDB-RS232 box, that is ASCII data
So when user test command with MDB Demo tool or RS232 tools,must select the “hex” mode to
send data

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 5 of 12 http://www.waferlife.com
The bill types are:
Type 0 = $1 Type 2 = $5 Type 4 = $20
Type 1 = $2 Type 3 = $10
The software should have all of the bill types enabled, this will allow the user to set which type
of bills to be accepted on the validator itself.
Bill Validator Operation Notes
-Firmware sets Bill Validator to accept 1, 2, 5, 10, 20 US bills by default
-Any commands to changed bills accepted or held in escrow will be set back to the firmware
defaults upon a cycling of power or reset.
VMC Commands for Bill Validator
US Bills –Bit 0 = $1 Bit 1 = $2 Bit 3 = $5 Bit 4 = $10 Bit 5 = $20
BILL’S ACCEPTED
Bill Type 34h 4bytes Y1-Y4
Bill’s Accepted
Y1-Y2 = 001Fh for all US bills accepted
= 0000h accept no bill’s
For example:
Send the command: 3400030000h
Bill’s held in Escrow
Y3-Y4 = 001Fh for all US bills held in escrow
= 0000h for no bill’s held in escrow
Send out 34h and then the 4 bytes Y1-Y4 to change bill’s accepted and held in escrow.
For example:
Send the command: 34001F001F
Enable the ESCROW, can accept the $1, But the coin go to the cash box directly
BILL’S IN ESCROW ACTION
Escrow 35h 1byte Y1
Return bill Y1 = 00h
Stack bill Y1 = 01h
Send 35h and then Y1 to act on bill held in escrow
For example:
Send the command: 3500h to Return the bill
The bill acceptor will reply: 00 and also following two data bytes: 30 A3 to show the bill type
returned
Send the command: 3501h to accept the bill to the bill stacker box
The bill acceptor will reply: 00 and also following three status data bytes: 30 83 09 to show
the bill type returned
STACKER STATUS
Stacker 36h response Z1-Z2
Byte1 Byte2
Fxxxxxxx xxxxxxxx
F=1 Stacker Full
Xxxxxxxxxxxxxxx = Number of bill’s in stacker

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 6 of 12 http://www.waferlife.com
Send out a 36h to the Bill Validator—It will respond with 2 bytes Z1-Z2
For example,if the bill stacker is not full and already stacked 3 pcs bills,then would reply 03 03
Enable the escrow to accept or return bills
( For the following test,user should have bill validator with Bill recycler mounted,Following
command data is tested with ITL NV11 bill validator )
(1) Use the 34FFFFFFFF or other 34 command to enable the escrow
(2) When user insert the bill, it will stop at the escrow and send the command 30 90 09 to PC
and also later will keep to send 3009 to PC
30 that means data is from bill acceptor, 90 means a TYPE0 bill is accepted and stoped at the
Escrow position (For different bills,maybe 91 or 92 or 93, just depond on the Bill Type accepted)
and the last 09 means Validator is Disabled to wait the VMC to acceptor or return the bill
(3) PC send the command 3501 to accept the bill or 3500 to return the bill
BILL VALIDATOR
All values are in hex
MDB data from Bill Validator to the PC
Bill Accepted
$1
30 80 09
$2
30 81 09
$5
30 82 09
$10
30 83 09
$20
30 84 09
Bill Returned
All valid bill types disabled in software
$1
30 C0 09
$2
30 C1 09
$5
30 C2 09
$10
30 C3 09
$20
30 C4 09
Bill Held In Escrow
$1
30 90 09
$2
30 91 09
$5
30 92 09
$10
30 93 09
$20
30 94 09
Bill forcibly Removed
$1
30 A1 09
$2
30 A2 09
$5
30 A3 09
$10
30 A4 09
$20
30 A5 09

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 7 of 12 http://www.waferlife.com
Bill Validator Status
01
Defective Motor
02
Sensor Problem
03
Validator Busy
04
ROM Checksum Error
05
Validator Jammed
06
Validator was Reset
07
Bill Removed
08
Cash Box Out of Position
09
Unit Disabled
0A
Invalid Escrow Request
0B
Bill Rejected
010xxxxxx
Number of attempts to input a bill while validator is disabled
14
Bill not accepted either because the bill type is not enabled in
the software or the bill was not recognized
For COIN ACCEPTOR
Coins Deposited:
(Byte1) (Byte 2)
01yyxxxx zzzzzzzz
yy = Coin Routing
00: Cash Box
01: Tubes
10: Not Used
11: Reject
xxxx = Coin Type
zzzzzzzz = The number of coins in the tube for the type accepted.
Coins Dispensed Manually
(Byte1) (Byte 2)
1yyyxxxx zzzzzzzz
yyy = The number of coins dispensed
xxxx = The coin type dispensed
zzzzzzzz = The number of coins in the tube
The coin types are:
Type 0 = 5c Type 2 = 25c Type 5 = $2 Can.
Type 1= 10c Type 4 = $1 Can.
Note: The type of the coin is the same as the bit that needs to be set in the ‘mdbCointype’
routine in order to enable the acceptance, or distribution of that coin.
COIN ACCEPTOR
All values are in hex.
DATA RECEIVED FROM MDB AND SENT TO THE PC
Below Low Mark
Above Low Mark
Above High Mark
Coin Inserted

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 8 of 12 http://www.waferlife.com
NICKEL
08 50 00
08 50 06
08 40 4C
DIME
08 51 00
08 51 08
08 41 6B
QUARTER
08 52 00
08 52 06
08 42 4B
QUARTER (1)
08 52 00
08 52 06
08 42 15
$1 CANADIAN*
08 44 00
$2 CANADIAN*
08 45 00
* Dollar coins are routed directly to the cash box
Coin Dispensed Manually
NICKEL
08 90 00
08 90 06
08 90 4C
DIME
08 91 00
08 91 08
08 91 6B
QUARTER
08 92 00
08 92 06
08 92 4B
QUARTER (1)
08 92 00
08 92 06
08 92 15
Coin Rejected
NICKEL
08 70 00
08 70 06
08 70 4C
DIME
08 71 00
08 71 08
08 71 6B
QUARTER
08 72 00
08 72 06
08 72 4B
QUARTER (1)
08 72 00
08 72 06
08 72 15
$1 CANADIAN*
08 74 00
$2 CANADIAN*
08 75 00
MDB STATUS
01
Escrow Request
02
Changer Payout Busy
03
No Credit
04
Defective Tube Sensor
05
Double Arrival
06
Acceptor Unplugged
07
Tube Jam
08
ROM Checksum Error
09
Coin Routing Error
0A
Changer Busy
0B
Changer was Reset
0C
Coin Jam
21
Coin not recognized/slug. Returned
Upon startup one of these values below may be sent to the PC –These are the VMC
Commands.
08
Reset
09
Status
0A
Tube Status
0B
Poll
0C
Coin Type
0D
Dispense

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 9 of 12 http://www.waferlife.com

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 10 of 12 http://www.waferlife.com
MDB-RS232 test with Nayax MDB cashless reader
MDB card reader has six working status:
1.Inactive:
After powered on or after a Reset command,then device will go to this state.User can use the SETUP
command to active the nayax reader
2.Disable:
When card reader received the config data,will go to this "Disable" Status,Also If user send the "Disable"
Command,also will go to this state.
3.Enable:
After the "Enable" command and Before detected a valid card,then stay in this state.
4.Session Idle:
When read a valid card,will go to "Session Idle" state to wait the "Vend request"
5.Vend request
When received the "Vend request" from the VMC,will go to vend status
6.Vend
Command List:
1401 Enable card reader
1400 Diable card reader
1402 Cancel card reader
1300000A0001 REQUEST VEND
1301 VEND CANCEL
13020001 VEND SUCCESS
130500640001 CASH SALE
1304 SESSION COMPLETE
1500 REQUEST REVALUE
1700 REQUEST ID
110001000000 Config the card reader
1101FFFF0000 Setup the max and min price
Steps for Testing with the card reader:
VMC: 110001000000 Config the card reader
READER: 010109720102070D94 card reader reply
VMC: 1101FFFF0000 Set the maximum and minimum price
READER: no reply
READER: 03FFFE Reading a valid card and wait the Vend selection
VMC: 1300000A0001 VMC command to card reader after Vend selection
READER: 00
READER: 05000A Card reader send to VMC, confirm the good dispatch
VMC: 13020001 VMC tell the card reader,already dispatch the selected goods
READER: no reply
VMC: 1304 end the section.
READER: 07
Important note: if User want to test with Nayax card reader, must make sure that your card
reader already connected to the nayax remote server system.that would be better to
confirm with nayax servicer person. If not then MDB maybe cann’t test it.

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 11 of 12 http://www.waferlife.com
Important questions during application:
1. Sometimes when send the command to the mdb-rs232,but I cann’t get any reply. How can I
know if the command has already been sent successfully to the payment device?
Answer: In MDB-RS232 box design,when PC send the command to it ,it will forward the
command to payment device. But sometimes the payment device is busy,for example a bill is
inserted and payment device cann’t reply the box in time. So PC cann’t get the reply.then just
need to resend the command later. Of course,this is not a problem,because ALL the command
from PC,that is not a realtime command.
2. How can I know if the payment device is enabled or disabled ?
Answer: If the payment device is in disabled status,Bill acceptors will report the status to PC
always once each POLL. It will report 30 09 to PC, but for most coin acceptor,if need the status,
user can read the status with 0F05 command.
3. If I can use a PLC or android board to connect it ?
Answer: That is no problem. Actually,user can use any main controller which has RS232 or USB
port to work as the VMC.Of course, if the main controller only has the USB port.then will use a
USB version. And install the driver to create the virtual com port in the main controller.
3. If can supply more documents to facilitate the development of applications?
Answer: The MDB box we provide is to forward the data uploaded to the PC by the MDB
payment device. The documents we provide can only make it as easy as possible for customers
to understand the process of sending and receiving data and the structure of the data. As for
the commands of the host, the design of the user's host software requires the user to design
the control process after having a detailed understanding of the payment device and the MDB
protocol. We are not able to provide assistance in customer specific projects and software
design.
4. About the Status reading command of coin acceptor (0F05 command to read the status)
Not all coin validators can report the full working status,especially the old version,even in
Level03,also cann’t provide the proper status report data
Normally after powered on, it should report 01 00 06 00 07 (01/00 means powering up)
Read the status again should report 06 00 06 (coin validator is disabled by default)
After use the command 0CFFFFFFFF to enable,then read status should report with 03 00 03
Must be noted: Some coin validators always report with 030003,no matter in what status and
some only port with 000000. In these cases where the MDB protocol is not followed, please
consult the coin validator manufacturer. Not a problem that MDB-RS232 boxes can solve

MDB-RS232 Interface Adapter for MDB Coin Changer Bill Acceptor and MDB card reader
Page 12 of 12 http://www.waferlife.com
How to order a sample to test ?
Answer : We can order the samples from online shopping store: http://cnkiosk.aliexpress.com
Wafer manufacture a series of the MDB payment adapters for Vending machines cashless
payment system,wireless payment payment and Provide a rich solution for vending
machine,kiosk machine or other self-service projects.
How can we connect the Pulse type coin acceptors or bill acceptors to PC ?
Answer: WAFER also have the PULSE-PC adapter box,that is used to connect the pulse type
payment device to computer RS232 port.
We also can order the samples from: http://cnkiosk.aliexpress.com
How can we develop a cashless payment interface to existing vending machine?
Answer: WAFER also have the RS232-MDB adapter box,that is used to connect the RS232
interface PC or android main board or popular Raspberry pi board to vending machine,and then
developer can use some simple command to act as a perfect cashless payment solution.
We also can order the samples from: http://cnkiosk.aliexpress.com
How can we develop a mobile payment solution for existing vending machine ?
Answer: WAFER have the 3G or 4G or LAN version payment module for selection.
We also can order the samples from: http://cnkiosk.aliexpress.com
Where can we get more further information and get the fast technical service ?
http://www.waferlife.com/en/MDB2PC-PC2MDB.html
How to have a customized MDB or vending payment board ?
Answer : WAFER can provide users with customized control boards in the field of self-service
vending. Including time control boards, payment interface boards, coin refunders, lottery
machines and other control boards.
Both pre-sales and after-sales can receive help and advice through our online skype technical
support.
Email: wafer@waferstar.com
Web: http://www.waferlife.com
Tel: 0086-21-51870528
Online Service Skype: wafer-service
V2020-V9.1
Copyright waferstar
Table of contents