Introduction: RFID Security Test

This is just to test if the rfid card works for a first timer

Supplies

Rfid card reader
Rfid tag
Rfid card
Green led
Red led
Breadboard
Jumper wires
Buzzer
Arduino uno

Step 1: Connect the Rfid Card Reader to Arduino

The rfid reader has pins and where they are connected to
3.3v - 3.3v
Sck(serial clock) - pin 13
MOSI(Master Out Slave In) - pin 11
MISO(Master In Slave Out) -pin 12
RST -pin 9
SDA(or SS )- pin 10
GND-GND
IRQ - not connected

Step 2: Connecting the Leds and Buzzer

You can connect the led to any pin on the microcontroller as well as the buzzer but they will have a common ground I will using pin4 for the buzzer and pin 6 and 7 for the red and blue led respectively

Step 3: The Code

There is need to download MFRC522 library, the SPI library is already instead with arduino

The code
#include
#include

const int buzzer =6;

#define RST_PIN 9 // Configurable, see typical pin layout above
#define SS_PIN 10 // Configurable, see typical pin layout abov


MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.

String read_rfid; // Add how many you need and don't forget to include the UID.
String ok_rfid_1="89189c99"; // This is for my main RFID Card. aka. The one I will be using to turn on my PC. Can also be used to shut it down if you want to.
String ok_rfid_2="29d93594"; // This is for the RFID Keyfob. aka. Shutdown Keyfob. Not advisable tho. Just shutdown your PC normally.
int led_lock = 7; // For the Card.
int led_lock2 = 6; // For the Keyfob.
/*
* Initialize.
*/
int noteDurations[] = {
4, 8, 8, 4, 4, 4, 4, 4
};
void setup() {
pinMode(buzzer,OUTPUT);

Serial.begin(9600); // Initialize serial communications with the PC