{"id":51197019,"url":"https://github.com/nodestark/mdb-esp32-master","last_synced_at":"2026-06-27T21:30:56.128Z","repository":{"id":363220427,"uuid":"1254421391","full_name":"nodestark/mdb-esp32-master","owner":"nodestark","description":"ESP32-based MDB Vending Machine Controller (VMC) with support for bill validators, coin changers, cashless devices, and EVA-DTS DEX/DDCMP telemetry for vending machine integration and management.","archived":false,"fork":false,"pushed_at":"2026-06-19T13:05:29.000Z","size":946,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-19T15:10:23.752Z","etag":null,"topics":["esp32","iot","nuttx","protocol-mdb","vending-machine"],"latest_commit_sha":null,"homepage":"https://vmflow.xyz","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodestark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-30T14:44:17.000Z","updated_at":"2026-06-19T13:05:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nodestark/mdb-esp32-master","commit_stats":null,"previous_names":["nodestark/mdb-esp32-master"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nodestark/mdb-esp32-master","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodestark%2Fmdb-esp32-master","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodestark%2Fmdb-esp32-master/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodestark%2Fmdb-esp32-master/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodestark%2Fmdb-esp32-master/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodestark","download_url":"https://codeload.github.com/nodestark/mdb-esp32-master/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodestark%2Fmdb-esp32-master/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34869004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32","iot","nuttx","protocol-mdb","vending-machine"],"created_at":"2026-06-27T21:30:55.380Z","updated_at":"2026-06-27T21:30:56.076Z","avatar_url":"https://github.com/nodestark.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n[![Discord](https://img.shields.io/badge/Discord-Community-5865F2?style=for-the-badge\u0026logo=discord\u0026logoColor=white)](https://discord.gg/YgnusQaDHM)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)](LICENSE)\n[![ESP-IDF](https://img.shields.io/badge/ESP--IDF-v5.x-E7352C?style=for-the-badge\u0026logo=espressif\u0026logoColor=white)](https://docs.espressif.com/projects/esp-idf/)\n\n# VMflow — MDB ESP32 Vending Machine Controller\n\n**A micro vending machine controller (VMC) on the ESP32, speaking native MDB to real peripherals.**\n\u003c/div\u003e\n\n---\n\nThis project implements the **MDB master / Vending Machine Controller (VMC)** side of the [Multi-Drop Bus](https://en.wikipedia.org/wiki/Multidrop_bus) protocol. The ESP32 acts as the brain of a micro vending machine: it powers the 9-bit MDB bus and polls real peripherals — coin changer, bill validator, and cashless readers — driving the full deposit → credit → vend → audit cycle. It runs on **any ESP32**, and ships with a bare-metal **KiCad** board that provides the sockets and level/current bridges required for MDB.\n\nThe board exposes **two independent MDB ports** — a **controller port** and a **target port**. On the **controller port** the board is the master (VMC): it drives the peripherals — coin changer, bill validator, cashless reader. On the **target port** the board is a slave: it emulates a peripheral and talks to the vending machine's VMC/master. This firmware uses the controller port.\n\n![ESP32-S3 N16R8](esp32-s3n16r8.jpeg)\n\n# Features\n- **MDB master / VMC** firmware implementing the bus poll loop, ACK/NAK/RET handling, and 9-bit address/mode framing\n- Talks to the standard MDB peripherals:\n  - **Coin Changer** (moedeiro, address `0x08`) — setup, tube status, coin-type enable, deposited credit\n  - **Bill Validator** (noteiro, address `0x30`) — setup, security, bill-type enable, escrow/stacker\n  - **Cashless reader #1** (`0x10`) and **#2** (`0x60`) — reset/setup/poll/vend/reader session flow\n- **Combined cash + cashless** vend logic: accumulates coin and bill credit, deducts on vend, and reports cash sales back to the cashless device for audit\n- **EVA-DTS DEX** interface over a dedicated UART for reading machine audit data\n- **WS2812 status LED** indicating MDB bus state\n- Product-selection button (GPIO0) to trigger a vend on the selected coil\n- **Dual MDB ports**: drive peripherals as a VMC on the controller port, or act as a peripheral on the target port\n- Bare-metal **KiCad** hardware: MDB sockets + bridges, designed for low-cost production and customization\n- Part of the open **VMflow** platform — pairs with the [📊 Web Dashboard](https://vmflow.xyz/dashboard) for telemetry, sales, inventory, and AI-powered diagnostics\n\n# Hardware\n\nThe companion board (KiCad project [`kicad/`](kicad)) carries the ESP32-S3 module and the MDB interface bridge (TX/RX opto-isolation and the 9-bit UART path) plus the peripheral socket. Shared on PCBWay:\n\n👉 **[MDB ESP32 Bridge Device — PCBWay](https://www.pcbway.com/project/shareproject/MDB_ESP32_Bridge_Device_ca013cf8.html)**\n\n![MDB VMC ESP32-S3 PCB](kicad/mdb-vmc-esp32s3.jpg)\n\n[![PCBWay](https://www.pcbway.com/project/img/images/frompcbway-1220.png)](https://www.pcbway.com/project/member/?bmbno=1B3B95CB-4E28-4D)\n\n### MDB ports \u0026 pinout (default)\n\nTwo MDB ports — name reflects the board's role on each:\n\n| Port            | RX  | TX  | Board role          | Connects to                                  |\n|-----------------|-----|-----|---------------------|----------------------------------------------|\n| **Controller**  | IO1 | IO2 | master (VMC)        | peripherals: coin changer, bill validator, cashless |\n| **Target**      | IO4 | IO5 | slave (peripheral)  | the vending machine's VMC/master             |\n\nThis VMC firmware uses the **controller port** (master): peripherals plug in here. The **target port** lets the board act as a peripheral driven by an external VMC.\n\nOther pins:\n\n| Signal        | GPIO | Note                         |\n|---------------|------|------------------------------|\n| MDB state LED | 21   | WS2812 status LED            |\n| DEX RX        | 18   | EVA-DTS / DDCMP              |\n| DEX TX        | 17   | EVA-DTS / DDCMP              |\n| Vend button   | 0    | product select (active low)  |\n\nMDB UART: 9600 baud, 9 data bits (8 data + 1 mode), even parity emulated for the 9th bit, 1 stop bit.\n\n![MDB PCB connection diagram](mdb_pcb_connection.svg)\n\n# Getting Started\n\nBuild with **ESP-IDF v5.x**:\n\n```bash\n# Clone the repository\ngit clone https://github.com/nodestark/mdb-esp32-vending-machine-control\ncd mdb-esp32-vending-machine-control\n\nidf.py build flash monitor\n```\n\nWire the MDB bridge to the peripheral's MDB connector, power the bus, and the VMC starts polling automatically — reset → setup → enable → poll. Press the vend button to attempt a purchase using whichever credit (coin, bill, or cashless) is available.\n\n# How to Contribute\n- Contributions are welcome! Open issues, send pull requests, or propose new features\n- Before submitting a pull request, make sure the code complies with the style and quality guidelines defined in the project\n- Help improve documentation by adding usage examples, wiring notes, and peripheral compatibility reports\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodestark%2Fmdb-esp32-master","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodestark%2Fmdb-esp32-master","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodestark%2Fmdb-esp32-master/lists"}