RFID READER and SD card arduino Wont work together

trying to make my arduino talk with a speaker when a specific card is read. also it opens a solednoid
please help

solenoid_door.ino (2.91 KB)

Kingsman_Galahad:
Hello. I try the same with 330R and that worked but when I want to play file audio through SD module and speaker of 8 ohm something happened, the speaker sounds like BEEP. If I disconnect the module RFID the file audio sounds in the speaker. I use the library tmrpcm.

Can somebody help me?

did you find an answer . im in a same pickle as you

  mfrc522.PCD_Init();   // Init MFRC522 card

On every pass through loop()? Why?

    buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.

Why does the comment come after the code?

Why does your
code have
such crappy
indenting?

Code is SUPPOSED to be easy to read, not a nightmare to read. Use Tools + Auto Format before posting your code.

That aside, what does the code actually do? How does that differ from what you want?

PaulS:
That aside, what does the code actually do? How does that differ from what you want?

hi, sorry about my messy code.
my code is suppose to read a rfid card and the arduino chooses a music file to be played and opens a solenoid lock .

My only problem is i cant make the sd card and rfid reader work

My only problem is i cant make the sd card and rfid reader work

Oh, good. I thought you had more than one trivial problem.

That does not answer the question, though. What does the code ACTUALLY do? "It doesn't work" tells us nothing.

john_arry:
did you find an answer . im in a same pickle as you

You've started your own thread. Don't go asking here, too.

PaulS:
That does not answer the question, though. What does the code ACTUALLY do? "It doesn't work" tells us nothing.

It is suppose to activate the SPI of the rfid reader so it can read the tag then switch SPI to the sd card reader so that it can play a file in the sd card .

Now whenever i boot my arduino the sd card reader works but the rfid doesnt read.

sd card reader wont work together with rfid reader .

is there a way for them to work together?

solenoid_door.ino (2.71 KB)

How many threads on this subject are you going to start?

dannable:
How many threads on this subject are you going to start?

only 2 :smiley: peace

Now whenever i boot my arduino the sd card reader works but the rfid doesnt read.

Does the RFID reader work if it is the only SPI device? That example code you started from is crap. I suspect that the library isn't a heck of a lot better.

PaulS:
Does the RFID reader work if it is the only SPI device? That example code you started from is crap.

yes the rfid does work when its alone , same could be said for the sd card reader . IF its is the only module plugged in.

john_arry:
yes the rfid does work when its alone , same could be said for the sd card reader . IF its is the only module plugged in.

So, the problem arises when you have three things plugged in. The obvious next step is to connect just the RFID reader and the SD card, initialize the SD card and the RFID reader, and see what happens.

PaulS:
So, the problem arises when you have three things plugged in. The obvious next step is to connect just the RFID reader and the SD card, initialize the SD card and the RFID reader, and see what happens.

ok i only attached the rfid and sd card reader.
outcome:
-The SD Module initialization done.

-RFID not responding to a tag

edit:
if i take out he miso pin of the sd card and reboot it , the rfid works

@john_arry, do not cross-post. Do not hijack. Threads split and merged.

john_arry:
only 2 :smiley: peace

Liar. There are three. Stop cross-posting.

sorry i meant for that thread :expressionless:

if i take out he miso pin of the sd card and reboot it , the rfid works

That would suggest that your SD reader/writer is not properly releasing the MISO pin when it is done communicating with the Arduino, tying up the SPI bus.

A link to your SD device is in order.

PaulS:
A link to your SD device is in order.

sd card:
http://www.ebay.com/itm/Micro-SD-Shield-TF-Card-Memory-Shield-Module-6-Pin-SPI-For-Arduino-/190940601928

rfid MFRC522
SPI Bus Switching isn't working:(

I told you twice to stop cross-posting. Why are you still doing it?