You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reading the MFRC522 data sheet, it seems like it supports several power-saving modes, including a "soft power-down" mode (http://www.nxp.com/documents/data_sheet/MFRC522.pdf). Is there a way to use this functionality from this RFID library?
Or, generally, for battery operation, could you document some best practices for saving power when using this library?
Well, I was also reading it but I haven't noticed any useful difference between soft power-down and hard power-down. (?)
And going to hard power-down is quite easy, I just set the RST pin low. To wake it up I call MFRC522.PCD_Init() and it sets RST pin high. You can also find that in PCD_Init() there is 50 milliseconds delay for crystal startup. I modified it for myself to only 5 ms and it seems to work well in my case.
And generally, for battery operation, right now I'm testing the mode that ATmega328 asks MFRC522 if there is any PICC, if not then ATmega sets MFRC's RST pin low and goes to sleep for a second itself. After a second ATmega wakes up, sets RST pin high, asks MFRC and then it all go to sleep again... (Of course if there is a PICC present then it is more complicated.)
And to be woken for as short time as possible I also noticed that in library there is set 25 ms timeout in TReloadReg registers. You can find it in PCD_Init(). This timeout is used in PCD_CommunicateWithPICC(). I shortened it to 10 ms and it seems to work. But like the wakeup delay I don't know what the right minimum is.
Well, I'm not testing soft power down. Because like I said, I don't understand what is on or off in this mode.
In hard power-down (RST connected to GND) I measured 0.3 mA. It is quite a lot. I'm using a module called RFID-RC522 (popular and cheap on ebay, you can google it). I previously unsoldered resistor R1 nearby the power LED D1. (I think it was 1 kOhm, I didn't want to unsolder the LED.) But now I can see that there is also 10 kOhm R2 between 3.3V and RST and that makes that 0.3 mA.
So I unsoldered R2 and in hard power-down my cheap multimeter displays 0.1 uA. It is suspiciously much less than "max. 5 microamp" in datasheet.
Btw. two posts before I mentioned 10 ms timeout in PCD_CommunicateWithPICC. I googled datasheet for MF1S503x (MIFARE Classic 1K) and there it looks like that 10 ms is the maximum timeout for he longest operation.
I'm trying to make something like "PICC_IsAnyCardPresent()" and to have this as fast as possible.
Right now I have it this way:
Well I power down both mcu (328p) and the the rc522 exit low power when card is detected.
Still running on 4xAA batteries 6 months so far its a electronic safe hack rfid unlock.
Hardware race conditions can be tricky.
mfrc522.PCD_ReducedPowerCardDetection(MCU, LPMCU_PCD_MS, TH, FW_V);
Only Atmel AVR mcu support for now.
example
/** * ---------------------------------------------------------------------------- * This is a MFRC522 library example; see https://github.com/miguelbalboa/rfid * for further details and other examples. * * NOTE: The library file MFRC522.h has a lot of useful info. Please read it. * * Released into the public domain. * ---------------------------------------------------------------------------- * This sample shows how to read and write data blocks on a MIFARE Classic PICC * (= card/tag). * * BEWARE: Data will be written to the PICC, in sector #1 (blocks #4 to #7). * * * Typical pin layout used: * ----------------------------------------------------------------------------------------- * MFRC522 Arduino Arduino Arduino Arduino Arduino * Reader/PCD Uno/101 Mega Nano v3 Leonardo/Micro Pro Micro * Signal Pin Pin Pin Pin Pin Pin * ----------------------------------------------------------------------------------------- * RST/Reset RST 9 5 D9 RESET/ICSP-5 RST * SPI SS SDA(SS) 10 53 D10 10 10 * SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16 * SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14 * SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15 * */
#include<SPI.h>
#include<MFRC522.h>
#defineRST_PIN9// Configurable, see typical pin layout above
#defineSS_PIN10// Configurable, see typical pin layout aboveMFRC522mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.MFRC522::MIFARE_Key key;
/** * Initialize.*/voidsetup() {
Serial.begin(9600); // Initialize serial communications with the PCwhile (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card// Prepare the key (used both as key A and as key B)// using FFFFFFFFFFFFh which is the default at chip delivery from the factoryfor (byte i = 0; i < 6; i++) {
key.keyByte[i] = 0xFF;
}
Serial.println(F("Scan a MIFARE Classic PICC to demonstrate read and write."));
Serial.print(F("Using key (for A and B):"));
dump_byte_array(key.keyByte, MFRC522::MF_KEY_SIZE);
Serial.println();
Serial.println(F("BEWARE: Data will be written to the PICC, in sector #1"));
}
/** * Main loop.*/voidloop() {
// Look for new cards low power PCD and MCU etc...
mfrc522.PCD_ReducedPowerCardDetection(MCU, LPMCU_PCD_MS, TH, FW_V);
// Select one of the cardsif ( ! mfrc522.PICC_ReadCardSerial())
return;
// Show some details of the PICC (that is: the tag/card)
Serial.print(F("Card UID:"));
dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
Serial.println();
Serial.print(F("PICC type: "));
MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
Serial.println(mfrc522.PICC_GetTypeName(piccType));
// Check for compatibilityif ( piccType != MFRC522::PICC_TYPE_MIFARE_MINI
&& piccType != MFRC522::PICC_TYPE_MIFARE_1K
&& piccType != MFRC522::PICC_TYPE_MIFARE_4K) {
Serial.println(F("This sample only works with MIFARE Classic cards."));
return;
}
// In this sample we use the second sector,// that is: sector #1, covering block #4 up to and including block #7
byte sector = 1;
byte blockAddr = 4;
byte dataBlock[] = {
0x01, 0x02, 0x03, 0x04, // 1, 2, 3, 4,0x05, 0x06, 0x07, 0x08, // 5, 6, 7, 8,0x08, 0x09, 0xff, 0x0b, // 9, 10, 255, 12,0x0c, 0x0d, 0x0e, 0x0f// 13, 14, 15, 16
};
byte trailerBlock = 7;
MFRC522::StatusCode status;
byte buffer[18];
byte size = sizeof(buffer);
// Authenticate using key A
Serial.println(F("Authenticating using key A..."));
status = (MFRC522::StatusCode) mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, trailerBlock, &key, &(mfrc522.uid));
if (status != MFRC522::STATUS_OK) {
Serial.print(F("PCD_Authenticate() failed: "));
Serial.println(mfrc522.GetStatusCodeName(status));
return;
}
// Show the whole sector as it currently is
Serial.println(F("Current data in sector:"));
mfrc522.PICC_DumpMifareClassicSectorToSerial(&(mfrc522.uid), &key, sector);
Serial.println();
// Read data from the block
Serial.print(F("Reading data from block ")); Serial.print(blockAddr);
Serial.println(F(" ..."));
status = (MFRC522::StatusCode) mfrc522.MIFARE_Read(blockAddr, buffer, &size);
if (status != MFRC522::STATUS_OK) {
Serial.print(F("MIFARE_Read() failed: "));
Serial.println(mfrc522.GetStatusCodeName(status));
}
Serial.print(F("Data in block ")); Serial.print(blockAddr); Serial.println(F(":"));
dump_byte_array(buffer, 16); Serial.println();
Serial.println();
// Authenticate using key B
Serial.println(F("Authenticating again using key B..."));
status = (MFRC522::StatusCode) mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_B, trailerBlock, &key, &(mfrc522.uid));
if (status != MFRC522::STATUS_OK) {
Serial.print(F("PCD_Authenticate() failed: "));
Serial.println(mfrc522.GetStatusCodeName(status));
return;
}
// Write data to the block
Serial.print(F("Writing data into block ")); Serial.print(blockAddr);
Serial.println(F(" ..."));
dump_byte_array(dataBlock, 16); Serial.println();
status = (MFRC522::StatusCode) mfrc522.MIFARE_Write(blockAddr, dataBlock, 16);
if (status != MFRC522::STATUS_OK) {
Serial.print(F("MIFARE_Write() failed: "));
Serial.println(mfrc522.GetStatusCodeName(status));
}
Serial.println();
// Read data from the block (again, should now be what we have written)
Serial.print(F("Reading data from block ")); Serial.print(blockAddr);
Serial.println(F(" ..."));
status = (MFRC522::StatusCode) mfrc522.MIFARE_Read(blockAddr, buffer, &size);
if (status != MFRC522::STATUS_OK) {
Serial.print(F("MIFARE_Read() failed: "));
Serial.println(mfrc522.GetStatusCodeName(status));
}
Serial.print(F("Data in block ")); Serial.print(blockAddr); Serial.println(F(":"));
dump_byte_array(buffer, 16); Serial.println();
// Check that data in block is what we have written// by counting the number of bytes that are equal
Serial.println(F("Checking result..."));
byte count = 0;
for (byte i = 0; i < 16; i++) {
// Compare buffer (= what we've read) with dataBlock (= what we've written)if (buffer[i] == dataBlock[i])
count++;
}
Serial.print(F("Number of bytes that match = ")); Serial.println(count);
if (count == 16) {
Serial.println(F("Success :-)"));
} else {
Serial.println(F("Failure, no match :-("));
Serial.println(F(" perhaps the write didn't work properly..."));
}
Serial.println();
// Dump the sector data
Serial.println(F("Current data in sector:"));
mfrc522.PICC_DumpMifareClassicSectorToSerial(&(mfrc522.uid), &key, sector);
Serial.println();
// Halt PICC
mfrc522.PICC_HaltA();
// Stop encryption on PCD
mfrc522.PCD_StopCrypto1();
}
/** * Helper routine to dump a byte array as hex values to Serial.*/voiddump_byte_array(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? " 0" : "");
Serial.print(buffer[i], HEX);
}
}
When measuring with oscilloscope, I'm getting exactly 30 ms cycle with soft power down.
The pick (during 30 ms cycle) power consumption is ~20 mA. On power down I get 1.4 mA (note that I did not yet remove the resistors and hoping LED and 10K resistor are eating most of the power here)
here is what I did:
void loop() {
// exit soft power off
mfrc522.PCD_WriteRegister(mfrc522.CommandReg, mfrc522.PCD_NoCmdChange);
delay(5); // can go without delay?
if (!mfrc522.PICC_IsNewCardPresent())
{
// soft power off
mfrc522.PCD_WriteRegister(mfrc522.CommandReg, mfrc522.PCD_NoCmdChange | 0x10);
delay(50);
return;
}
bool status = mfrc522.PICC_ReadCardSerial();
if (!status) {
return;
}
mfrc522.PCD_WriteRegister(mfrc522.CommandReg, mfrc522.PCD_NoCmdChange | 0x10);
The results are very similar to jk987. However this does not require changing delays in the library (b/c no init is used in the loop)
update: changed the PCD_WriteRegister to PCD_WriteRegister(TPrescalerReg, 0x43) as @jk987 suggested. Now the whole power on cycle is less than 15 mSec. If my estimates are correct and ESP8266 wont' add a lot, sleeping for one second and being active for 15 mSec should translate to 4-6 months on 2 AA batteries
I made an example how to use ESP32's deep sleep mode with MFRC522. I haven't done exact measurements yet, but a quick test shows you should be in the <100µA region with a 1s interval. That's good enough for my application.
So I want to give your code a go, but a bit insure on the wiring between the ESP32 D1 mini and the RC522. How can I see what GIOP pins you are using on the ESP32?
A nother question. I seem to have some issue scanning some of my NFC/RFID tags when running this code.
If I dont go into sleep mode i have no issues scanning the same cards.
Is there something i can try an adjust to help with this issue?
Also I'm trying to implement ESP NOW to push out the ID tag to a server. Would it be appropriate to call all the ESP now initialization in the void setup() after the card is found?
Well I power down both mcu (328p) and the the rc522 exit low power when card is detected. Still running on 4xAA batteries 6 months so far its a electronic safe hack rfid unlock. Hardware race conditions can be tricky.
I interests build rfid door lock rc522+mcu (328p) you can share information.
Well, I was also reading it but I haven't noticed any useful difference between soft power-down and hard power-down. (?)
And going to hard power-down is quite easy, I just set the RST pin low. To wake it up I call MFRC522.PCD_Init() and it sets RST pin high. You can also find that in PCD_Init() there is 50 milliseconds delay for crystal startup. I modified it for myself to only 5 ms and it seems to work well in my case.
And generally, for battery operation, right now I'm testing the mode that ATmega328 asks MFRC522 if there is any PICC, if not then ATmega sets MFRC's RST pin low and goes to sleep for a second itself. After a second ATmega wakes up, sets RST pin high, asks MFRC and then it all go to sleep again... (Of course if there is a PICC present then it is more complicated.)
And to be woken for as short time as possible I also noticed that in library there is set 25 ms timeout in TReloadReg registers. You can find it in PCD_Init(). This timeout is used in PCD_CommunicateWithPICC(). I shortened it to 10 ms and it seems to work. But like the wakeup delay I don't know what the right minimum is.
Hi .
How can I do a hard power down without connecting to a pin reset?
thank you very much for your reply.
interested in a few things:
RC522 without a reset R2 resistor I can’t make it work.
set spleep mode 1 s
every time the processor wakes up, the consumption returns on every wakeup power 100 Mka at rotary excitation ptreblem current 1mA and so on up to 10 mA and the cycle repeats.
I turned off timer0 timer 1 timer but no result.
Thanks so much to @herm for that ESP32 code. I had to make a couple of modifications to get it working for me, which may be of help to anyone else trying to use it:
(Unlike gpioMux, GPIO_PIN_MUX_REG is available from within the stub, so no need to make special RTC variables anymore.)
After the call to dsMFRC522_FastReset(); add
ets_delay_us(1000);
This allows an extra millisecond for the card to get ready. Without this, like @hemandk I was finding that detection was very hit and miss, and when it did work the effective range was drastically reduced. After trying various things I had a hunch that everything was just happening a bit too quickly, and tried this extra delay, and it fixed it totally. 1000 was my first guess, and turned out to be right on the money: 500 and even 750 are not enough. But I only have one MFRC522 so I don't know if it will be the same with every reader, there might be some variation.
Using this method I'm measuring an average current of just a few mA, about an order of magnitude less than my best previous method!
I would take advance of this topic to ask your kind suggestion.
My goal is to make something working as long the card is near the reader, I have some dubts:
Should the card be moved away (powered down) and then close it again (powered up) to receive from it the code? Or there is a way with this library to "polling" the card when I want? SUpposing the card is always touching reader.
Is it safe for the card to be powered on 24/7? Or evantually, does it has a limited number of "wake ups"?
I would consider to poll the card every 10 seconds, for example, considering the card keeps near the reader, does the hard reset keep low for 9 seconds and 1second not, allow the process correctly? (time power up compared the time the card is transmitting, etc. all wil be succesfull at first read attempt?)
WHat you racomend me for this purpose? Thank you
I think consumption can be much lower if wakeup stub code works on the ULP coprocessor of the ESP32.
I am going to try to convert the software spi code to ASM so that it can be run while device is sleeping and only wakes up if a card is detected.
It is not much harder than reading i2c temperature sensors with the ULP but only downside is all connected pins must be RTC GPIO to be controlled via ULP.
@Rotzbua This seemed like the most appropriate place to ask: I am running a small project off a 9v battery and would like to improve its lifespan. Currently it only lasts a few hours because its running items. Is there a way to run the reader on a low power mode only so that it detects an rfid tag and sends an interrupt so I can know when to turn everything else back on?
@Rotzbua This seemed like the most appropriate place to ask: I am running a small project off a 9v battery and would like to improve its lifespan. Currently it only lasts a few hours because its running items. Is there a way to run the reader on a low power mode only so that it detects an rfid tag and sends an interrupt so I can know when to turn everything else back on?
No, sorry. The whole point of this thread is because the MFRC522 cannot do low power card detection and has no way of waking up the MCU when it does detect a card. Polling is the only answer. With an ESP32 you can do this from a deep sleep stub (see herm's code earlier in the thread, and my updates to it); I don't know if there's anything similar on Arduino, but Arduino are usually not a great choice for low power. ESPs are better, and STMs better still (but harder to use). There are other RFID readers that support LPCD properly and can wake the MCU when they detect a card.
Activity
Rotzbua commentedon Jan 6, 2017
Not implemented yet. I will be happy to get a pull request from you :)
jk987 commentedon Jan 15, 2017
Well, I was also reading it but I haven't noticed any useful difference between soft power-down and hard power-down. (?)
And going to hard power-down is quite easy, I just set the RST pin low. To wake it up I call MFRC522.PCD_Init() and it sets RST pin high. You can also find that in PCD_Init() there is 50 milliseconds delay for crystal startup. I modified it for myself to only 5 ms and it seems to work well in my case.
And generally, for battery operation, right now I'm testing the mode that ATmega328 asks MFRC522 if there is any PICC, if not then ATmega sets MFRC's RST pin low and goes to sleep for a second itself. After a second ATmega wakes up, sets RST pin high, asks MFRC and then it all go to sleep again... (Of course if there is a PICC present then it is more complicated.)
And to be woken for as short time as possible I also noticed that in library there is set 25 ms timeout in TReloadReg registers. You can find it in PCD_Init(). This timeout is used in PCD_CommunicateWithPICC(). I shortened it to 10 ms and it seems to work. But like the wakeup delay I don't know what the right minimum is.
jk987 commentedon Jan 15, 2017
I'll answer to myself. I started scope and it seems that my crystal+MFRC seems to be woken up in less than 300 microseconds.
ivoras commentedon Jan 15, 2017
Good to hear about your tests!
Did you measure power consumption difference between soft power-down and hard power-down? What was it?
jk987 commentedon Jan 15, 2017
Well, I'm not testing soft power down. Because like I said, I don't understand what is on or off in this mode.
In hard power-down (RST connected to GND) I measured 0.3 mA. It is quite a lot. I'm using a module called RFID-RC522 (popular and cheap on ebay, you can google it). I previously unsoldered resistor R1 nearby the power LED D1. (I think it was 1 kOhm, I didn't want to unsolder the LED.) But now I can see that there is also 10 kOhm R2 between 3.3V and RST and that makes that 0.3 mA.
So I unsoldered R2 and in hard power-down my cheap multimeter displays 0.1 uA. It is suspiciously much less than "max. 5 microamp" in datasheet.
Btw. two posts before I mentioned 10 ms timeout in PCD_CommunicateWithPICC. I googled datasheet for MF1S503x (MIFARE Classic 1K) and there it looks like that 10 ms is the maximum timeout for he longest operation.
I'm trying to make something like "PICC_IsAnyCardPresent()" and to have this as fast as possible.
Right now I have it this way:
This test takes about 30-40 ms according to cpu speed (with shorter wakeup delay, shorter timeouts, faster SPI).
KarlSix commentedon Jan 27, 2017
Well I power down both mcu (328p) and the the rc522 exit low power when card is detected.
Still running on 4xAA batteries 6 months so far its a electronic safe hack rfid unlock.
Hardware race conditions can be tricky.
KarlSix commentedon Feb 3, 2017
mfrc522.PCD_ReducedPowerCardDetection(MCU, LPMCU_PCD_MS, TH, FW_V);
Only Atmel AVR mcu support for now.
example
jk987 commentedon Feb 6, 2017
@KarlSix I'm quite interested how the
mfrc522.PCD_ReducedPowerCardDetectionlooks like. Is it please possible to find it somewhere?KarlSix commentedon Feb 7, 2017
Nope I haven't posted the code.
akellai commentedon Mar 18, 2017
When measuring with oscilloscope, I'm getting exactly 30 ms cycle with soft power down.
The pick (during 30 ms cycle) power consumption is ~20 mA. On power down I get 1.4 mA (note that I did not yet remove the resistors and hoping LED and 10K resistor are eating most of the power here)
here is what I did:
The results are very similar to jk987. However this does not require changing delays in the library (b/c no init is used in the loop)
akellai commentedon Mar 18, 2017
update: changed the PCD_WriteRegister to PCD_WriteRegister(TPrescalerReg, 0x43) as @jk987 suggested. Now the whole power on cycle is less than 15 mSec. If my estimates are correct and ESP8266 wont' add a lot, sleeping for one second and being active for 15 mSec should translate to 4-6 months on 2 AA batteries
KarlSix commentedon Mar 18, 2017
1.4mA is still a lot when battery powered, with arduino mini pro and rc522 total current consumption during sleep should be 60uA.
akellai commentedon Mar 18, 2017
agree. Need to solder out R1 and R2 and hope to get it down to 100uA or below
jk987 commentedon Mar 19, 2017
@KarlSix Karl, I still would like to ask you to show us your mfrc522.PCD_ReducedPowerCardDetection. Please, is it possible or is it some secret?
48 remaining items
hemandk commentedon Jan 8, 2022
So I want to give your code a go, but a bit insure on the wiring between the ESP32 D1 mini and the RC522. How can I see what GIOP pins you are using on the ESP32?
herm commentedon Jan 9, 2022
Pin configuration is right at the beginning:
You should be able to use any pins you want.
hemandk commentedon Jan 10, 2022
Thanks that helped.
A nother question. I seem to have some issue scanning some of my NFC/RFID tags when running this code.
If I dont go into sleep mode i have no issues scanning the same cards.
Is there something i can try an adjust to help with this issue?
Also I'm trying to implement ESP NOW to push out the ID tag to a server. Would it be appropriate to call all the ESP now initialization in the void setup() after the card is found?
ZnRobotics commentedon Apr 17, 2022
I interests build rfid door lock rc522+mcu (328p) you can share information.
6000850 commentedon May 10, 2022
Hi .
How can I do a hard power down without connecting to a pin reset?
jk987 commentedon May 11, 2022
According to this (chapter 8.6.1, page 33) I guess you can't: https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf
Seems quite logical because how would you wake it up again?
ZnRobotics commentedon May 12, 2022
thank you very much for your reply.
interested in a few things:
set spleep mode 1 s
I turned off timer0 timer 1 timer but no result.
BenMemescape commentedon Feb 12, 2023
Thanks so much to @herm for that ESP32 code. I had to make a couple of modifications to get it working for me, which may be of help to anyone else trying to use it:
(gpioMux is obsolete in the current version of ESP32-IDF)
with
(Unlike gpioMux, GPIO_PIN_MUX_REG is available from within the stub, so no need to make special RTC variables anymore.)
This allows an extra millisecond for the card to get ready. Without this, like @hemandk I was finding that detection was very hit and miss, and when it did work the effective range was drastically reduced. After trying various things I had a hunch that everything was just happening a bit too quickly, and tried this extra delay, and it fixed it totally. 1000 was my first guess, and turned out to be right on the money: 500 and even 750 are not enough. But I only have one MFRC522 so I don't know if it will be the same with every reader, there might be some variation.
Using this method I'm measuring an average current of just a few mA, about an order of magnitude less than my best previous method!
Barabba11 commentedon Aug 27, 2023
I would take advance of this topic to ask your kind suggestion.
My goal is to make something working as long the card is near the reader, I have some dubts:
WHat you racomend me for this purpose? Thank you
Tasshack commentedon Sep 21, 2023
I think consumption can be much lower if wakeup stub code works on the ULP coprocessor of the ESP32.
I am going to try to convert the software spi code to ASM so that it can be run while device is sleeping and only wakes up if a card is detected.
It is not much harder than reading i2c temperature sensors with the ULP but only downside is all connected pins must be RTC GPIO to be controlled via ULP.
travisjayday commentedon Nov 16, 2023
Pro tip: Only turn on the antenna right before issuing the start request to save extra power:
Moosems commentedon Jan 12, 2024
@Rotzbua This seemed like the most appropriate place to ask: I am running a small project off a 9v battery and would like to improve its lifespan. Currently it only lasts a few hours because its running items. Is there a way to run the reader on a low power mode only so that it detects an rfid tag and sends an interrupt so I can know when to turn everything else back on?
Moosems commentedon Jan 12, 2024
And is there a way to have it do this with the arduino on low power mode?
BenUniqcode commentedon Jan 15, 2024
No, sorry. The whole point of this thread is because the MFRC522 cannot do low power card detection and has no way of waking up the MCU when it does detect a card. Polling is the only answer. With an ESP32 you can do this from a deep sleep stub (see herm's code earlier in the thread, and my updates to it); I don't know if there's anything similar on Arduino, but Arduino are usually not a great choice for low power. ESPs are better, and STMs better still (but harder to use). There are other RFID readers that support LPCD properly and can wake the MCU when they detect a card.
zfranco55 commentedon Mar 7, 2024
Is it possible to run the code on a board (PN532) with I2C protocol?
or it can work on a modified card like here:
https://forum.arduino.cc/t/rc522-rfid-rc522-switching-spi-to-uart-interface-or-i2c-possible/425741