This might seem an old question. However quite recently my professor has assigned a project to me to develop a Attendance-cum-Access System for his Lab. The problem Statement is: "Develop a Arduino based Security system, that reads a RFID card and grants access to the lab. For the same you are allowed to use Arduino Nano v3 with the following components: 1 MFRC522 Reader (NXP Semiconductor), a SD Card Module (6-pin Config) to store the access information, an RTC module(DS3231) to maintain the time logs, an 16x2 LCD panel to display messages and a Relay connected to Door (and an Optional GSM800A module to send SMS of unauthorized access)."
So far I have used of the above components individually and all of them are working perfectly fine by using their respective library available on Arduino Libraries or GitHub repository. However the real problem arises when I am trying the save the access info on the SD Card. The moment the Reader and SD card share the Common SPI Wires, the SD card malfunctions showing varied errors ranging from SD initialization failed or FAT16/32 partition not found or Filename does not exist. I have been searching a solution for the past 1 month but without any success and my project seems to remain stuck here. The workflow is as follows:
1 Wait for Card:
2 Once detected Check the UID
3 Make note of the UID, time and date.
4 Check for the UID in access.txt file in SD Card.
4a. If UID exists: grant access by activating Relay. Show relevant info on LCD
4b. If UID does not exist: Deny access (if needed send SMS of the unauthorised access)
Well SMS module is not that crucial now keeping in mind the cost (It cost more than all the other modules together). So we can keep it aside for now. But any help in managing the SPI communication between Nano (master) and the slaves (SD, Reader) will be beneficial. I have tried the solutions posted in previous discussions but none seem to work out effectively, including adding a 220K resistor / diode in the wiring.