[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.
So as to simplify the accounting we sell sodas and ice creams in exchange for a token. Yes, we have custom engraved 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.
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)
|Arduino Ethernet||50 €|
|125Khz RFID module||12 €|
|2x20 LCD Display||10 €|
|Piezzo buzzer||3 €|
|Push buttons x 2||2 €|
|Prototyping board||10 €|
Here are the electronic schematics, made with Fritzing.
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.
The source code is available on GitHub:
Here is a Class Diagram if you want to navigate through the source code:
- Green: the main program
- Yellow: a class
- White: a customizable
- Gray: a third party library
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, I tried all existing JSON libraries for Arduino with no success. I finally wrote my own Arduino JSON Parser 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.