Can RFID read stacked cards?
Ask QuestionAsked todayActive todayViewed 49 times2
I want to create a project that will read playing cards that have integrated RFID. If I put multiple cards on top of each other will it still be able to determine the stacked cards?
what if the cards are not perfectly stacked on each other? Like for example layed on top of each other but pushed down a little where only the letter appears?
Thanks.antennarfidshareedit follow flag asked 9 hours agoFA952111 bronze badge New contributor
- 3Welcome. First question-No. Your second question requires speculation and/or testing. Can you actually test these conditions? Is this for real science or daydreaming? – DAS 9 hours ago
- 1what does this mean?
pushed down a little where only the letter appears
– jsotola 9 hours ago - 1that is not
stacked
… that issplayed
– jsotola 8 hours ago - 1@jsotola oh sorry. Thanks. Do you think it still reads them? – FA95 8 hours ago
- 1it may be able to somehow determine the presence of a tag, but not a position relative to other tags – jsotola 8 hours ago
add a comment | show 7 more comments
1 Answer
Question
Can a RFID reader read a stack of playing cards?

Answer
Short Answer
(1) My RFID reader will freeze if given a two card stack to read, and
(2) It will complain if I try to slowly splay the two cards.
Long Answer (TLDR)
Part 1 – Introduction
The RFID reader can of course read cards one by one, but not sure what will happen if trying to read a stack or a splay.
I have a python program to read cards one by one, next step is try to read a stack.
Part 2 – Testing Procedure
(1) Which kind of RFID reader and library to use for testing
I have basically two kinds of cheap RFID modules, pn532 and RC522. I can use SPI, I2C or UART interface, using libraries or writing a program using python. However, I think there is no need to spend time to choose which reader and which library to use, because I think they are not relevant. Also I think the reading distance is also not relevant, my two kinds of RC522, and THM3060 can read cards at 2 cm and 10 cm. But I don’t think distance matters.
So I think what to find out first is the following:
If I give a stack of cards for the RFID card reader to read, will it just read the card that it get the strongest signal, or the first card that he gets a signal, or random?
(2) Testing procedure
(a) Take 4 cards and separately write the names Spade Ace, Diamond Ace, Club Ace, and Heart Ace to each of them and then read back.
(b) Now try to read them again, but two cards at a time, three at a time and four at a time.
Part 3 – Testing Results
So I first tested 4 playing cards one by one, giving them names “Heart Ace” etc. Then I read them back one by one without any problem.
Next is the fun part. I give a two card stack, but the reader hangs. I think it gets confused of a corrupted signal.
Next I tried to splay them, very very slowly, as I was playing poker. Then a weird thing happens, the reader gave the following error message:
AUTH ERROR!!
AUTH ERROR(status2reg & 0x08) != 0
What is also interesting is that the Thonny python 3.7.3 prints the above message
IN BRIGHT RED!!! (This is my first time seeing a red warning from Thonny, after programming Thonny python for a year or so!)
This is the main test functions I am using (Appendix B)
def main():
printBeginProgram()
#testMcp3201()
#testMcp3208()
#testRc522()
#writeRfidCard('Diamond Ace')
#readRfidCard()
#writeRfidCard('Heart Ace')
#readRfidCard()
#writeRfidCard('Club Ace')
#readRfidCard()
#writeRfidCard('Spade Ace')
#readRfidCard()
readRfidCard()
printEndProgram()
return
And this is a sample output
Sample Output
%Run rfd_util_01_v134..py
Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:17
spiPortName = SpiPort00
spiSpeedName = 1 MHz
This RFID card is (647176253282, 'Diamond Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:17
%Run rfd_util_01_v134..py
Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:18
spiPortName = SpiPort00
spiSpeedName = 1 MHz
AUTH ERROR!!
AUTH ERROR(status2reg & 0x08) != 0
/ to continue, …
/ to continue, …
References
(1) Program listing and sample output of a python program to read RFID cards one by one v0.1 2020sep05
(2) RFID Mfrc522-nfc Module Testing Notes
(3) pn532-nfc Module Testing Notes 1/2
(4) pn532- nfc Module Testing Notes 2/2
(5) RFID Reader Signal Strength Measurement Notes
(6) RFID Reader THM3060 Setup Notes
/ to continue, …
Appendices
Appendix A – Sample output of python program reading RFID cards one by bone.

Appendix B – Sample output of python program reading cards one by one and also a stack and a splay
# Program:
rfd_util01_v135.py tlfong01 2020sep05hkt1619
def writeRfidCard(nameString):
# 1. Set SPIPort00 SPI speed 1 MHz
print('\n 1. *** Set SpiPort00 1 MHz ***')
spiutil.setSpiPortSpeedBySpiPortNameList(['SpiPort00'], '1 MHz') # <<< SpiPort00 <<<
# 2. Loop back SpiPOr00 three bytes 0x5b, 0x5c, ox5d
print('\n 2. *** Loopback SpiPort00 three bytes 0x5b, 0x5c, 0x5d (remember to short MOSI and MISO ***')
spiutil.testLoopbackThreeBytesSpiPortNameList(['SpiPort00'], '0x5d', '0x5c', '0x5b') # <<< SpiPort00 <<<
# 3. Test RC522 WriteRead
print('\n 3. *** RC522 Module Write/Read Test (Remember to place RFID tag/car on top or near the RC522 Module ***')
GPIO.setwarnings(False)
reader = SimpleMFRC522() # *** Create SimpleMFRC522 object
reader.write(nameString) # Writete something to RFID tag/card, must place tag/card on top or near to the RC522 module
#reader.write('Joker') # Writete something to RFID tag/card, must place tag/card on top or near to the RC522 module
readText = reader.read() # Read back from tag/card
print('\n This RFID card is', readText)
return
def readRfidCard():
# 1. Set SPIPort00 SPI speed 1 MHz
# print('\n 1. *** Set SpiPort00 1 MHz ***')
spiutil.setSpiPortSpeedBySpiPortNameList(['SpiPort00'], '1 MHz') # <<< SpiPort00 <<<
# 2. Loop back SpiPOr00 three bytes 0x5b, 0x5c, ox5d
# print('\n 2. *** Loopback SpiPort00 three bytes 0x5b, 0x5c, 0x5d (remember to short MOSI and MISO ***')
# spiutil.testLoopbackThreeBytesSpiPortNameList(['SpiPort00'], '0x5d', '0x5c', '0x5b') # <<< SpiPort00 <<<
# 3. Test RC522 WriteRead
# 3. Read RFID card
# print('\n 3. *** RC522 Module Write/Read Test (Remember to place RFID tag/car on top or near the RC522 Module ***')
GPIO.setwarnings(False)
reader = SimpleMFRC522() # *** Create SimpleMFRC522 object
#reader.write('Dimond Ace') # Writete something to RFID tag/card, must place tag/card on top or near to the RC522 module
#reader.write('Joker') # Writete something to RFID tag/card, must place tag/card on top or near to the RC522 module
readText = reader.read() # Read back from tag/card
print('\n This RFID card is', readText)
return
Main
def main(): printBeginProgram() #testMcp3201() #testMcp3208() #testRc522() #writeRfidCard(‘Diamond Ace’) #readRfidCard() #writeRfidCard(‘Heart Ace’) #readRfidCard() #writeRfidCard(‘Club Ace’) #readRfidCard() #writeRfidCard(‘Spade Ace’) #readRfidCard() readRfidCard()
printEndProgram()
return
if name == ‘main‘: main()
End of program
Sample Output
Python 3.7.3 (/usr/bin/python3) %Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:08 spiPortName = SpiPort00 spiSpeedName = 1 MHz
This RFID card is (504284031262, 'Dimond Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:08
%Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:12 Traceback (most recent call last): File “/home/pi/Programs/programs/rfd_util_01_v134..py”, line 544, in main() File “/home/pi/Programs/programs/rfd_util_01_v134..py”, line 534, in main writeRfidCard(‘Diamond Ace’) NameError: name ‘writeRfidCard’ is not defined %Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:13
1. *** Set SpiPort00 1 MHz ***
spiPortName = SpiPort00
spiSpeedName = 1 MHz
2. *** Loopback SpiPort00 three bytes 0x5b, 0x5c, 0x5d (remember to short MOSI and MISO ***
sendBytes = 0x5d 0x5c 0x5b
sendBytes = 0x01 0x6f 0x5c
3. *** RC522 Module Write/Read Test (Remember to place RFID tag/car on top or near the RC522 Module ***
This RFID card is (504284031262, 'Diamond Ace ')
spiPortName = SpiPort00
spiSpeedName = 1 MHz
This RFID card is (504284031262, 'Diamond Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:13
%Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:13
1. *** Set SpiPort00 1 MHz ***
spiPortName = SpiPort00
spiSpeedName = 1 MHz
2. *** Loopback SpiPort00 three bytes 0x5b, 0x5c, 0x5d (remember to short MOSI and MISO ***
sendBytes = 0x5d 0x5c 0x5b
sendBytes = 0x01 0x6f 0x5c
3. *** RC522 Module Write/Read Test (Remember to place RFID tag/car on top or near the RC522 Module ***
This RFID card is (647176253282, 'Diamond Ace ')
spiPortName = SpiPort00
spiSpeedName = 1 MHz
This RFID card is (647176253282, 'Diamond Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:13
%Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:14
1. *** Set SpiPort00 1 MHz ***
spiPortName = SpiPort00
spiSpeedName = 1 MHz
2. *** Loopback SpiPort00 three bytes 0x5b, 0x5c, 0x5d (remember to short MOSI and MISO ***
sendBytes = 0x5d 0x5c 0x5b
sendBytes = 0x01 0x6f 0x5c
3. *** RC522 Module Write/Read Test (Remember to place RFID tag/car on top or near the RC522 Module ***
This RFID card is (504284031262, 'Heart Ace ')
spiPortName = SpiPort00
spiSpeedName = 1 MHz
This RFID card is (504284031262, 'Heart Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:14
%Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:15
1. *** Set SpiPort00 1 MHz ***
spiPortName = SpiPort00
spiSpeedName = 1 MHz
2. *** Loopback SpiPort00 three bytes 0x5b, 0x5c, 0x5d (remember to short MOSI and MISO ***
sendBytes = 0x5d 0x5c 0x5b
sendBytes = 0x01 0x6f 0x5c
3. *** RC522 Module Write/Read Test (Remember to place RFID tag/car on top or near the RC522 Module ***
This RFID card is (233736302454, 'Club Ace ')
spiPortName = SpiPort00
spiSpeedName = 1 MHz
This RFID card is (233736302454, 'Club Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:15
%Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:16
1. *** Set SpiPort00 1 MHz ***
spiPortName = SpiPort00
spiSpeedName = 1 MHz
2. *** Loopback SpiPort00 three bytes 0x5b, 0x5c, 0x5d (remember to short MOSI and MISO ***
sendBytes = 0x5d 0x5c 0x5b
sendBytes = 0x01 0x6f 0x5c
3. *** RC522 Module Write/Read Test (Remember to place RFID tag/car on top or near the RC522 Module ***
This RFID card is (896130096106, 'Spade Ace ')
spiPortName = SpiPort00
spiSpeedName = 1 MHz
This RFID card is (896130096106, 'Spade Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:16
%Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:17 spiPortName = SpiPort00 spiSpeedName = 1 MHz
This RFID card is (504284031262, 'Heart Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:17
%Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:17 spiPortName = SpiPort00 spiSpeedName = 1 MHz
This RFID card is (233736302454, 'Club Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:17
%Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:17 spiPortName = SpiPort00 spiSpeedName = 1 MHz
This RFID card is (896130096106, 'Spade Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:17
%Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:17 spiPortName = SpiPort00 spiSpeedName = 1 MHz
This RFID card is (647176253282, 'Diamond Ace ')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:17
%Run rfd_util_01_v134..py Begin program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:18 spiPortName = SpiPort00 spiSpeedName = 1 MHz AUTH ERROR!! AUTH ERROR(status2reg & 0x08) != 0
This RFID card is (896130096106, '')
End program rfdutil_01_v134 (Testing SimplMFRC522) tlfong01 2020-09-05 16:18
shareeditdeleteflagedited just nowanswered 4 hours agotlfong0166544 silver badges77 bronze badges
- 1Your code formatting looks strange. What are the lines beginning with “%” and the lines beginning with 1., 2., 3.? Maybe some differentiation is required between code and generated output? For code formatting either start each line with four or more spaces or highlight the code and use the
{}
code formatting button. – Transistor 1 hour ago - Ah, the “%” symbol is what the Rpi4B buster Thonny python output displayed in the output window. I copied the output window text to my penzu programming log in Rpi USB stick, and then carry it to Window 10 and use EditPlus 2 to shift the output to top for easy assessing by human, then I edited it in EE SE. – tlfong01 36 mins ago
- Sometimes others cannot read my Chinese Windows based file, so I usually give my penzu programming log, with the complete python program which is newbie friendly Plug N Play (Just copy and Run, no libraries required). You might like to read my penzu diary (Ref 1, (almost) fully debugged): penzu.com/public/09885381 – tlfong01 36 mins ago
- Gluing code with output, with time stamps, is to make sure there is no time gap where I have made changes but forget to mention. I once worked as a tutor in an open community college, and I wrote tutorials with code and sample output. My students would be extremely angry if I made a careless mistake, eg, forget a comma, or extra stupid space after comma and the program cannot run. / to continue, … – tlfong01 12 mins ago
- My students often had very little time to study (go to bed 10pm), not to mention no time doing programming assignments. Some are in jail, serving long sentences. Those in jail of course have no smart phone, no email, and can only write tutors letters, but they can only write letters once a week, because they cannot afford the postal stamps, … But they do study as happily as me, and they often get academic awards:) Ah, locking supper time. See you later, my apologies for my long-windness and typo errors. – tlfong01 4 mins ago Edit
Categories: Uncategorized