Go Down

Topic: Arduino UNO with MIFARE RC522 and SD Card Reader module (Read 3697 times) previous topic - next topic

rudedholf

Hi. I already made a simple RFID Card Reader with my Arduino UNO and MIFARE RC522. I also got it working with my Custom Time Attendance System by reading the serial output of the Arduino after reading the card. Now I'm looking at expanding this by attaching an SD Card Module to make it as a standalone device for collecting attendance logs. My problem now is that the sample code for Read/Write to SD Card uses the SPI pins 10 to 13, which the said pins are already used by my RFID Module.

Here's my pin assignments for the RFID Module:

    SDA            D10
    SCK            D13
    MOSI          D11
    MISO          D12
    IRQ             N/A
    GND           GND
    RST             D9
    3.3V            3.3V

Can the 2 modules share these pins? If not, anyone can help me with mapping the pins needed for the SD Card module? Thanks in advance.

robtillaart

the pin 10 of the SD card is probable the Device Select pin (also other names)
so if you can connect that pin to lets say pin 8, and rewrite the sd library a bit so it uses pin 8 to enable the SD card
then you can disable the RFID when you want to write to SD  and vice versa

get the idea?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

rudedholf


mashigtl

Hi Rude, did you manage to sort it out because I am a student and I have project to design and build attendance system and I am gathering information as much as I can and how can you help as well?

robtillaart


Hi Rude, did you manage to sort it out because I am a student and I have project to design and build attendance system and I am gathering information as much as I can and how can you help as well?

If you are a student you should try to design it yourself and show your work (project code) here.
If it doesn't work then you will get more help (but most people do not make your homework ;)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

rudi2014

Hi robtillaart,
I am currently struggling to make work my Arduino Uno with RFID RC522 and a stand-alone micro SD Card.They are both SPI, therefore share the same MISO, MOSI and SCK pins. I assigned pin 10 for SDA (Slave Select) RFID, pin 9 for RST RFID and pin 4 for CS (Slave Select) SD Card. Individually RFID and SD Card sketch work well, but when it is combined it does not work...
I made sure to disable RFID by making the SDA Pin High before enabling the micro SD CS pin. But the program is still not working. It stops after printing "Card Ready" on the monitor and it did not respond to any RFID Card.

Here I attach the sketch...

Any help would be appreciated
Thank you very much...

marchantcilliers

I have the exact same problem. Rfid and sd work fine seperately, but sd doesnt init when put together. Has anybody found a solution yet?

sak9383

I am aslo doing this ,,, please help me how i will connect the RF reader and Sd Card Pin to Arduino UNO







khagesh

Same. I am working on mega controller and i need to open and read the file from the SD card. 

when i am using RFID card, i want that chip id of the RFID card to be as a file name to open a file, store in SD card. but its not working after converting to string format too.
 basically i am facing this issue in loop file system. on set up are thing is work file but on loop file system it showing error

some times: file dosn't exist.
: invalid (controller do not open the file)

jonnyg

If it helps I managed to get the SD card reader work alongside the RC522 RFID reader.

I worked out that if I disconnected the SD's MISO pin, the RC522 still worked.
So I tried to isolate them by adding a diode on each MISO line. The diode on the RC522's line stopped the RC522 from working at all (I'm guessing that this is because it's on 3.3V and the diode drops the signal by 0.7V and that's too low to be considered 'high' by the 5v Arduino) so I just left the other diode in and it solved the problem. I have to admit that I'm not sure why it helps.

To summarize:
I got it to work by adding a diode between the SD card reader's MISO pin and the Arduino's MISO input (pin 12 on the UNO). The diode's direction is anode to SD Reader, cathode to Arduino.

Hope this helps and if anyone can explain to me *why* it works I'd appreciate it!

Thanks

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy