Hi
I am building an rfid system at work. The system is working with arduino uno and RC522 (with a buzzer on pin 7) but things got mixed up when trying to add ethernet shield to communicate via ethernet. I am new to the ethernet shield but I learned that i cant use the pin 10 on the shield. So i changed the SDA My pinout is like this:
Pin Pin
Arduino Uno MFRC522 board
9 RST (Reset)
8 SDA (SPI SS)
11 MOSI (SPI MOSI)
12 MISO (SPI MISO)
13 SCK (SPI SCK)
And the code i use is at the end. So my question is will this pin layout work? If not what do i have to do?
Also it would be nice, if you can post guides / helps about using the shield. I need to read the same data on the serial monitor via ethernet.
I have also attached the photos of the pins.
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 8
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
const int buzzer = 7; //buzzer to arduino pin 9
void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
}
void loop() {
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}
tone(buzzer, 1000); // Send 1KHz sound signal...
delay(1000); // ...for 1 sec
noTone(buzzer); // Stop sound...
// Dump debug info about the card. PICC_HaltA() is automatically called.
for (byte i = 0; i < mfrc522.uid.size; i++) {
Serial.print(mfrc522.uid.uidByte[i]);
}
Serial.println();
}
based on the code: Arduino Playground - MFRC522

