ESP32-S3 MDB Cashless Vending & EVA-DTS Telemetry Platform Development

Adequate Infosoft developed an open-source ESP32-S3-based cashless vending platform designed to modernize existing MDB-compatible vending machines. The solution combines MDB payment processing, EVA-DTS telemetry, Bluetooth provisioning, MQTT cloud connectivity, and a documented API.

With custom KiCad hardware, ESP-IDF firmware, an Android application, and a Docker-based backend, the project demonstrates Adequate Infosoft's end-to-end expertise in embedded systems, IoT product engineering, hardware design, and connected payment solutions.

Project Context: Retrofitting the Installed Base

The European vending fleet is substantial, long-lasting, and based on the Multi-Drop Bus (MDB), which is a 9-bit serial protocol used to communicate vending machine controllers (VMC) to coin changers, bill validators, and cashless devices since its inception.

The commercial cashless retrofit market is highly skewed towards closed, proprietary modules that enforce operator lock-in and have weak telemetry capabilities.

VMflow (which is available as nodestark/mdb-esp32-cashless on GitHub) was developed keeping in mind the requirement for an occurrence where a cashless device based on MDB technology and on ESP32-S3 performing the tasks of granting credits, completing transactions through vending machine and performing telemetry based on EVA-DTS DEX/DDCMP, Bluetooth provision and processing the MQTT commands from the cloud as well as having a well-documented API for users and operators.

Hardware layout made in KiCad, ESP-IDF firmware for devices, Android application and a backend made in docker have been published together making this case a unique source of inspiration for developers of payment terminals.

ESP32-S3 MDB cashless vending machine

System Architecture: Master, Slave, and Dual Control Planes

There are two main ESP32-S3 functions in this arrangement. The MDB Master serves as a link between the VMC and the MDB bus, while the MDB Slave acts as the cashless payment device that communicates with the VMC via MDB but connects to the outside world using BLE and MQTT.

In the conventional approach to retrofitting, the slave operates as a peripheral cashless device on the MDB bus identified by address 0x10, while the master entity is made available for testing.

The design purposely separates transactions from the monitoring process. MDB is used for transaction purposes with local validation, whereas the management plane deals with two different issues: configuration and credit provisioning over BLE GATT and cloud-based control and telemetry using MQTT.

This allows the device to be configured locally via Bluetooth, after which it can be operated and remotely updated using Wi-Fi or cellular technologies.

MDB cashless vending payment and telemetry workflow

MDB Protocol Implementation: 9-Bit UART by Bit-Banging

The biggest engineering problem is implementing MDB's 9-bit serial communication protocol. MDB uses 9 bits, while standard UART requires 8 bits, with the ninth bit functioning as a mode bit, allowing differentiation of command bytes (mode bit = 1) from data bytes (mode bit = 0).

As the ESP32 UART devices do not have native support for 9-bit communication, VMflow has implemented this protocol through bit-banging with the use of GPIOs through specifically created read and write 9-bit operations.

Bit masks – BIT_MODE_SET (0b100000000), BIT_ADD_SET (0b011111000), and BIT_CMD_SET (0b000000111) – extract the mode, address, and command fields. This software-driven approach provides precise control over bit timing and protocol sequencing, enabling the firmware to meet MDB's strict ACK/NAK/RET handshake requirements.

The commands are defined as an enumeration: RESET (0x00), SETUP (0x01), POLL (0x02), VEND (0x03), READER (0x04), and EXPANSION (0x07). The operation of the device follows a state machine consisting of five states: INACTIVE, DISABLED, ENABLED, IDLE, and VEND, corresponding to the state machine described in the MDB specification for a cashless peripheral.

The POLL loop is important in the protocol; it requires that the slave responds to each poll, reporting its status and any vend result, with the firmware using a non-blocking state machine.

Hardware: Isolated MDB Front-End and Field-Ready Carrier Board

The Production Slave PCB consists of a 4-layer FR4 circuit board with dimensions of 149.83 × 38.5 mm. It uses the ESP32-S3-WROOM-1U-N16R2 module that has 16MB flash memory along with 2MB PSRAM memory and uses a u.FL connector such that an external antenna may be installed outside the enclosure of the vending machine.

The power source is provided through an AP63201WU-7 synchronous buck that accepts an input voltage range of 3.8V to 32V and regulates it to 3.3V.

The MDB interface is optically isolated using four TLP785 optocouplers on a 6-pin Mini-Fit connector, protecting the ESP32-S3 from the noisy, often poorly grounded MDB bus and breaking ground loops between the vending machine and the logic board.

Additionally, the board features two relay outputs (SRD-03VDC-SL-C, SPDT, using MMBT3904 driver with flyback diodes), six 1-wire / sensor terminals, an I2C JST XH port, an NTC thermistor connection, a passive buzzer (MLT-8530), and a WS2812 RGB LED for field troubleshooting without the need for a serial terminal. The inner PCB layers mainly consist of ground planes, which offer a clean path back from both the RF module and the MDB part – a design decision that is justified by the high electrical noise level.

Firmware: ESP-IDF, FreeRTOS, NimBLE, and AES-CBC Provisioning

The slave firmware runs on FreeRTOS tasks as an ESP-IDF application (ESP-IDF v5.x). There are different modules for the MDB handler, BLE stack, MQTT client, telemetry reader, encryption engine, and UART drivers while the BLE stack is based on NimBLE making it smaller than Bluedroid. BLE provisioning and usage isn't merely serial.

The board is registered by the app, Wi-Fi credentials are configured, and the credit is sent in a signed 19-byte payload which is AES-CBC encrypted with a per-device key and nonce so that a captured frame would not be able to be re-used to create the credit itself. BLE GATT service has both control and notification characteristics. The app is notified about session start and approves the vending process.

EVA-DTS Telemetry: DEX and DDCMP on a Second UART

Telemetry is captured via UART1, independent of the MDB UART, through the use of EVA-DTS protocol, defined by the European Vending Association.

Two protocols have been adopted. For DEX, there is handshaking through ENQ/ACK/NAK, negotiation of a session, auditing of data, CRC-16 frame verification, and session termination. For DDCMP, the process involves setting up a connection, authentication, transfer of checksummed packets of data, and session termination. There is support for readTelemetryDEX(), readTelemetryDDCMP(), and requestTelemetryData(), together with a one-shot semaphore.

Telemetry can be triggered either by sending the character h over BLE or by publishing to the MQTT topic /iot/machine00000/telemetry, to which the client subscribes via the wildcard /iot/machine00000/#. Retrieved data includes product sales, cash collection, inventory levels, error and diagnostic information, and machine status—the raw material for the cloud dashboard's inventory alerts and AI diagnostics.

Cloud, Dashboard, and Agent-Ready API

The backend is powered by self-hosted Supabase, MQTT, and Nuxt technologies using Docker containers. The self-hosted Supabase technology is responsible for providing authentication and REST APIs functionalities, while MQTT facilitates real-time data communication between cloud server and vending machine devices via signed RPC requests.

Nuxt based operator dashboard that can be accessed from vmflow.xyz/dashboard is used to monitor and manage all the devices, track sales and inventories as well as provide telemetry and product catalog management functionalities with help of AI powered diagnostics.

Credit can be pushed through MQTT by using a Supabase edge function, and the platform provides a language agent API: OpenClaw skills, vmflow-cli with browser login, and AGENTS.md which allows for browser agents to explore the whole API surface without any token copy.

The x402 HTTP payments route lets either human or artificial intelligence agent make a payment to the machine through a signed X-PAYMENT header, and a quote is provided with the first request while dispensing happens on the second one.

VMflow vending operator dashboard and mobile UI

Bench Validation: The MDB AI Bridge

Recognising that most developers do not have a vending machine on the bench, the project includes an MDB AI Bridge design that puts the VMC, the VMflow cashless device, and a bill/coin reader on three ESP32-S3 boards, speaking MDB between them at 3.3 V logic (9-bit, 9600 baud) with links exposed on a 2×8 header for a logic analyser.

This turns protocol development into a reproducible, hardware-in-the-loop CI target rather than a field-only exercise, and it is the clearest expression of the project's engineering philosophy: isolate the hard part—the 9-bit MDB state machine—and test it exhaustively before it touches a revenue-bearing machine.

Conclusion

VMflow is the example of how the team of engineers can create a full-fledged open-source vending IoT platform through the tackling of the restrictions of the given industrial protocol, but not through their abstraction.

The architecture of VMflow includes software-defined 9-bit UART communications, electrically-isolated MDB connection, AES-CBC-based BLE provisioning, dual DEX/DDCMP telemetry capabilities, and agent-oriented cloud control plane.

All of the above technologies offer a good reference architecture for those, who want to develop vending machines with MDB protocol with cashless payment and telemetry capabilities.

Besides, the documentation also includes important engineering decisions, such as UART allocation for telemetry, external antenna usage because of the problems of metal enclosure and provisioning protection from replay attack.

This makes VMflow a valuable, extensible reference for embedded engineers developing secure, connected vending and industrial payment systems.

Project Repository: github.com/nodestark/mdb-esp32-cashless

Abhinav Akula
DevOps Engineer and 3× Microsoft Azure Certified professional specializing in Azure cloud solutions, migration, deployment automation, and multi-cloud environments. He holds Microsoft certifications as an Azure Developer Associate and Azure Solutions Architect Expert, with expertise in building scalable, secure, and reliable cloud infrastructure.

What Our Clients Say About Us

Client satisfaction is our ultimate goal. Here are some kind words of our precious clients they have used to express their satisfaction with our service.

Leadership That Leads Worldwide

With a physical presence in over 15 countries and a global footprint spanning 25+ countries, we are ready to serve you anywhere. Location, language, or culture is never a barrier, because our global team can work with you in your language. Our strong international team ensures seamless collaboration across borders We have a strong tech team, highly recognized in their domains, with extensive technical expertise.