Use of RFID RC522

Sam Mckendrick

New member
Hi there,
I wish to use an RFID RC522 in a circuit to turn a servo for a school project but am unsure on the circuit i need; how to add it to the circuit and how to program my PICAXE chip with instructions on how to respond by opening and closing my lock.
Cheers and gone!
 

hippy

Technical Support
Staff member
The RC522 can apparently use SPI, I2C and serial so it should be fairly easy to interface that to a PICAXE. Which you can use may depend on which breakout board you are using.

That it should be possible to interface it to a PICAXE doesn't however mean anyone has actual done it or there is PICAXE example code available. It has been mentioned a few times but I don't recall anyone posting code which uses it.

None the less it should be possible. The best approach would be to break the project into separate parts; interfacing with the module, interfacing with your servo, detecting the ID from a card, determining if a valid code, and activating the lock if it is. Get the individual parts working and it should all work as a whole.

What previous PICAXE, electronics, and interfacing experience do you have ?
 

Circuit

Senior Member
The interface to the RC522 is straightforward; the code necessary to operate it is not. I have several RC522 now operational but not with PICAXE - which was my original intention - but with another system that is based on 32-bit PICs. It is quite a programming challenge to write PICAXE code for this device.
 

Flenser

Senior Member
Sam,

A search of the picaxe forurm for RC522 does not come up with anyone who has written code for this chip, so that will make it much more difficult.
Can you give us a link to the module that you have? A look at the datasheet might enable the forum to help you read data from this module.
 
The RC522 interfaces with the new 'Smart Rings', a new and upcoming tech. The ring can unlock your phone, front door, and heaven knows what next. Picaxe must catch up with this tech, or Arduino will leave it in the dust. I really don't want to have to learn Arduino tech, Picaxe is fine for me. Meanwhile, by default, I'm having to follow a similar project up with Arduino, grumble, grumble. Last post was March, it's now July!
 

hippy

Technical Support
Staff member
Picaxe must catch up with this tech
I'm not sure how true that will be and it really comes down how many are wanting to use that tech. The PICAXE was never intended to be able to do everything and it has always been acknowledged that there will be some things it will not be able to do, and probably never will. This may be one of them.

I have never used the RC522 but, having taken a look at the datasheet, having looked at some library code, I would agree with Circuit that the code to interface with it is anything but simple -

https://github.com/miguelbalboa/rfid/blob/master/src/MFRC522.cpp

That could perhaps be converted into PICAXE basic but it would be a long slog and would probably require a quite deep understanding of how the RFC522 works to get it right. And there would need to be a business case that it would be worth investing all that effort when there may be little or no return on it.

It could also be that the RC522 is just too demanding for what a PICAXE can handle. In that case the best solution might be to take what code there is for something else and modify that so it could more easily be interfaced with a PICAXE. For example just sending a string of ID digits over serial when a card or ring is presented to the reader.

There are already RF ID readers which can do that for cards and those might work with rings as well, so the best option might be to simply use one of those with a PICAXE where all the hard work has been done by the manufacturer.
 
Unbelievable amount of code in the Github link. I want things simple. I have an Arduino setup coming, will test the system for ways to simplify things. My favorite gizmo is an optoisolator. Small signal on one side triggers the other side of a different circuit, different voltage, it doesn't care. Small and cheap. I will report back in a week or so on any progress made.
 
Top