using RC522 and SD card reader with Arduino Pro Micro

Hey!

I´m trying to read RFID cards and to store their UIDs on a Micro SD card.
Both sensors are working individually, but I can´t read my card anymore when I connect the SD reader additionally.

I tried to localize the problem and found out that the problem disappears when I disconnect the MISO of the Micro SD card Reader even if I leave the code unchanged. But obviously the initialization of the SD card fails in this case.

Does anybody has an idea to fix my bug?

Does anybody has an idea to fix my bug?

Buy a non-buggy SD card reader. You most probably bought one of these cheap Chinese readers. Most of them have a bug that doesn't tri-state the MISO line if CS goes HIGH. This results in an SPI bus where you cannot add any other device (such as the RFC522).

Depending on the actual board you bought and iff you have good soldering skills you might fix the bug but usually it's easier to buy a new reader from a serious vendor (Adafruit, Sparkfun, etc.).