element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
NFC/RFID
  • Challenges & Projects
  • Project14
  • NFC/RFID
  • More
  • Cancel
NFC/RFID
Blog Blue Payment, paying for a vend via RFID card
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join NFC/RFID to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: michail
  • Date Created: 5 Jun 2019 12:50 PM Date Created
  • Views 2628 views
  • Likes 8 likes
  • Comments 1 comment
  • nfcrfidch
Related
Recommended

Blue Payment, paying for a vend via RFID card

michail
michail
5 Jun 2019

Introduction

It was always interested in a device talking with another device, especially when you start  seeing responses back. Talking to vending machine using MDB protocol is one of that amazing adventures.

My goal is to prototype a simple payment system using RFID tags for paying for a vend. Payment policy can be extend and customised in many ways including using the same RFID tag across many machines and limiting the vends in day basis by storing information inside the tag.

 

The Setup

 

Test board, Changegiver, MDB Machine. Beside test board can be connected to the machine directly. Currently we are connected via MDB Loom cable.

image

Interfacing MDB

In order to talk with vending machine, there must be interfacing part which will receive and send data via mdb bus.

1. 1x 6N137

2. 1x4N35( or PC133)

3. 1x 0.1mf capacitor

4. 1x 10k resistor

5. 1x 1k resistor

6. 1x C114 digital npn transistor

7. 1x CD74HC14 (Schmitt Trigger)

 

Schematic

image

image

Notes:

1. 4N35, can be replaced with PC113

2. I am using Nucleo STM32F303K8

 

SMT32CubeMX Layout

image

Cashless Device

We show ourself into MDB bus like Cashless Device with address 10H. In order to communicated with MDB master there must be implemented couple of commands. Main drama here is communication is with 9bit UART.

MDB is using parity bit like a mod bit to show if the value is address or data. I tried various approaches but one which works in my case is using STM32 UART configured on 9bit word length, without parity.

 

  1. RESET 10H
  2. SETUP 11H
  3. PULL   12H
  4. VEND  13H
  5. EXPANSION 17H

 

More details about them you can find in https://www.ccv.eu/wp-content/uploads/2018/05/MDB-Interface-Specification.pdf

 

The Tools and Libs

I am using STM32CubeIDE. Using VCP for debuting message. Currently allowing any card to have amount inside and allowing a vend. Vend policy can be changed in best suitable way, even using phone with NFC capabilities.

It is possible to code preloaded amount into card and use that amount during the vend.

For the reader MC522 is used library  Library 23- Read RFID tag with MF RC522 on STM32F4 with slight changes in order to fit into the project.

 

The Code

Source is experimental and lot of improvements are possible. I am experimenting also with Nucleo Board to be just like a bridge(because of 9th bit UART word size) to a Raspberry PI equipped with Typescript code and NodeJS.

 

 

 

 

 

 

 

Moment of Truth

We have one selection(Hot Chocolate) which is paid(one with button switched of). When  the RFID tag is reader, we respond back with amount of 2.0(can be any currency) credits.

User selects vend, machine request approval from us. We say 'yes' and vend is made.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Finally I can enjoy cup of Hot Chocolate.

  • Sign in to reply
Parents
  • malekses
    malekses over 3 years ago

    Hi,

    thank you for sharing the idea.

    could you please share the code here?

    • Cancel
    • Vote Up -1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • malekses
    malekses over 3 years ago

    Hi,

    thank you for sharing the idea.

    could you please share the code here?

    • Cancel
    • Vote Up -1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube