9
votes

I'm looking to build the same interaction that a normal user has with a vending machine through a chip card (smartcard) with an Arduino project of mine. I want to limit the users the time they can play with the toy (my project) for that, they will be required to insert the card and the code should:

  1. Read the card.
  2. Ask for a 4-digit password.
  3. Authenticate password on chip.
  4. Read time balance.
  5. Display on LCD the time balance.
  6. Save time of usage (via millis()).
  7. Subtract usage from time balance and display new balance.
  8. Log the usage time and date.

I have one of this SMART CARD readers and datasheet is very straight forward on how to connect, but I'm not as fluent as I would like on writing my own functions. Is there a good library that I can use? perhaps an example .ino or .pde file? thanks in advance!


[UPDATE #1]

I have found a good looking project by Angus71 in SourceForge but I must admit that I don't know how to implement the library into the arduino code itself. The author wrote SCTest (example) that is not enough for me, So I wanted to check if you can help me?

You may download the library and examples from the link above and would appreciate very much if you can point me in a better direction!

1
Note, that memory cards (which would suffice and may be easier to interface) and smart cards have a limit of writing cycles in the 100 000 range, so you may want to restrict the update frequency. As I read your given link, it is not exactly a reader you use but more a contacting unit, which means you have to implement the communication protocol to the chip. For smart cards the protocol is asynchronous (i.e. complicated, many special cases) and called T=1 or T=0 (no google hits with arduino). Memory chips like 5528 are synchronous (2wire, 3wire, i2c )which is surely less work from scratch.guidot
Thanks guidot, I saw the blog you shared before, but the code has a lot of undeclared and functions and it kind of freaked me out.Gustavo Valencia
That's a big question Gustavo. I'll vote it up, but I'm not sure there will be anybody that can answer.Maarten Bodewes
if your problem is not over, and about your update, what did you try and how those examples are not enough for you? I just checked those examples, and they seem fairly easy to understand and implement! Did you check the code on the svn?zmo

1 Answers

0
votes

If you are still flexible with the hardware you might want to consider using an NFC card and store the data in your reader (or the nfc card if you need to use it in several devices. There are many open NFC libraries that work flawlessly.