[Arduino] RFID payment terminal

Three years ago, we gathered a few euros to buy a fridge for our office. Since then, we’ve sold sodas with very little profit. One can after the other we had enough money to buy a freezer.

{<1>}Our good old fridge

So as to simplify the accounting we sell sodas and ice creams in exchange for a token. Yes, we have custom engraved tokens :-)

{<2>}The tokens

In a few days, we’ll make a big step forward: we’re going to replace the whole token money with virtual wallet associated with personal RFID tags.

I built a payment terminal that sits next to the fridge and Levi wrote a web application so that every “customer” can check his or her account.

{<3>}Me, buying a soda with my RFID tag

On this project, I’ve been working on the RFID terminal only. Please check Levi’s blog for the server part (spoiler: it’s in ASP.NET MVC, and uses Bootstrap and Angular.js)


</tr> </tr> <th colspan=2> Total </th> </table> ### Schematics Here are the electronic schematics, made with [Fritzing](http://fritzing.org/). {<4>}![Part 1: MCU and Ethernet](/images/2014/Feb/RfidTerminalPart1-2.png) {<5>}![Part 2: LCD Screen](/images/2014/Feb/RfidTerminalPart2-1.png) {<6>}![Part 3: RFID Reader](/images/2014/Feb/RfidTerminalPart3.png) ### Assembly I created a board that plugs on top of the Arduino, just like a standard "shield", so that the fixture and the maintenance is easy. {<7>}![](/images/2014/Feb/RfidTerminalBoard-1.jpg) {<8>}![Board and Arduino in the enclosure](/images/2014/Feb/RfidTerminalInTheEnclosure-1.jpg) ### Software The source code is available on GitHub: https://github.com/bblanchon/DrinksRfidTerminal Here is a Class Diagram if you want to navigate through the source code: {<9>}![Class diagram](/images/2014/Feb/ClassDiagram-1.png) Legend: - Green: the main program - Yellow: a class - White: a customizable `.h` file - Gray: a third party library ### Comments It took us about two months to complete that project, working only during the lunch break. The main difficulty was to parse the JSON data from the server. As I stated in [a previous article](http://blog.benoitblanchon.fr/arduino-json-parser/), I tried all existing JSON libraries for Arduino with no success. I finally wrote my own [Arduino JSON Parser](https://github.com/bblanchon/ArduinoJsonParser) library. Lastly, the Arduino Ethernet is a bit small for that kind of project. The binary size is 28634 bytes, it's 89% of the available memory on the board. I had to remove a few features (such as a serial console) and I reduced log to the minimum, to keep the size below 30 KB. Next time I need to work on a similar project, I think I'll use a bigger board, like the new Arduino Y├║n.
Arduino Ethernet 50 Ôé¼
125Khz RFID module 12 Ôé¼
2x20 LCD Display 10 Ôé¼
Piezzo buzzer 3 Ôé¼
Push buttons x 2 2 Ôé¼
Prototyping board 10 Ôé¼
Enclosure 12 Ôé¼
99 Ôé¼