Combined thermal printer and RFID shield

Hello Sparkers!

We’re attempting to build a combined thermal printer and RFID reader using Spark Core. The device will read a user’s RFID card, send the card’s ID to a server which looks up that user, send some relevant information back to the Core, which prints it on the printer.

Is this likely to be possible? Looks as though we can use both Serial and Serial2, so both devices can be connected okay. But what about reading an ID from the RFID card and sending it to the server? And sending bitmaps to the printer?

Thanks for your thoughts.

Henry

It should be doable, Its what the spark was made for! reading the id from a RFID card is possible, and printing on a thermal printer is possible. there are some threads on the forums about doing this. the search feature will bring quite a few up

The hard part will probably be the bitmap part as there is pretty limited RAM on the core, but i imagine the resolution would be pretty low for printing anyways… so should be OK

What type of RFID are you looking at using? there is the RC522 which is cheap and common and a few people have it working well on the core, and it uses SPI

Sending data to a server is straight forward with TCP, and will be even easier when webhooks are released in the future.

Thanks @Hootie81! The thermal printer’s been ordered and is on its way.

I’ve been experimenting with the RC522 and that works fine, though we had hoped to read Oyster contactless cards with it – that doesn’t seem to be working, though to my understanding the RC522 is a MIFARE reader, so I’m not sure what the problem is.

Are you aware of any Spark-compatible RFID readers that work with Oyster?

I just checked in the header file, there is a list of cards in there, and Oyster is not there.

All the cards listed are MIFARE

It may be possible to get the datasheet and add it to the library, there probably isn’t a huge difference between it and one of the others… but you would need to find out whats different and see if it can be changed

There is a heap of info in the library header file, even where to get datasheets…

@henryaj, please try and maintain your questions to a single topic. Please see my reply in the other topic you posted in:

1 Like

Thanks @hootie81 and @peekay123 – I’ll have a look at modifying the header and report back.

After a little more research, it looks as though 0xAF is the crucial command to read the ID from a newer DESfire card. That said, I'm not sure how to actually add that in to the RFID.h or .cpp library files I'm using...

You send either

--> AF
<-- 00 048A4AAAA62D80BA34D5E9103612

or

--> 90AF000000
<-- 048A4AAAA62D80BA34D5E9103612 9100

You will finally receive an answer with the UID. The first 7th bytes are your UID. In my example it's : 04 8A 4A AA A6 2D 80.