Fwd: అందరికీ పంపతగినది: RFID 522 link to learn 100%
---------- Forwarded message ---------
From: pingili vikram kumar <vikramkumar.volunteer@gmail.com>
Date: Sat, Mar 4, 2023, 14:42
Subject: Fwd: అందరికీ పంపతగినది: RFID 522 link to learn 100%
To: <satyasaianilmallavarapu@gmail.com>
From: pingili vikram kumar <vikramkumar.volunteer@gmail.com>
Date: Sat, Mar 4, 2023, 14:42
Subject: Fwd: అందరికీ పంపతగినది: RFID 522 link to learn 100%
To: <satyasaianilmallavarapu@gmail.com>
Subject: RFID 522 link to learn 100%
To:
/*ప్రాజెక్ట్ RFID reader module RC522 (code taken frm https://create.arduino.cc/projecthub/person87/rfid-rc522-sensor-7fc37b
and modified by vikrambhayyA; the mfrc522 library installation method was seen from the process
given in https://www.instructables.com/RFID-RC522-With-Arduino/)
circuit diagram taken from https://www.youtube.com/watch?v=3uWz7Xmr55c
विक्रम भय्या విక్రమ్ కుమార్ Vikram BhayyA
Science Communicator
vikramkumar.volunteer@gmail.com
8331926163
http://www.linkedin.com/in/विक्रम-విక్రమ్-vikram-कुमार-కుమార్-kumar-85424172
*/
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
//#define RED 2
//#define Green 3
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
void setup()
{
Serial.begin(9600); // Initiate a serial communication
SPI.begin(); // Initiate SPI bus
mfrc522.PCD_Init(); // Initiate MFRC522
Serial.println("bring your card to the reader...");
Serial.println();
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
}
void loop()
{
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent())
{
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}
//Show UID on serial monitor
Serial.println("UID tag :");
String content= "";
byte letter;
for (byte i = 0; i < mfrc522.uid.size; i++)
{
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
content.concat(String(mfrc522.uid.uidByte[i], HEX));
}
Serial.println();
Serial.print("Message : ");
content.toUpperCase();
if (content.substring(1) == "00 8C 04 1C")// || (content.substring(1) == "21 0B 99 26") )
//21 0B 99 26 change here the UID of the card/cards that you want to give access
{
Serial.println("Authorized access");
Serial.println();
digitalWrite(3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2000);
digitalWrite(3, LOW);
}
/*else if (content.substring(1) == "E1 11 52 19")// || (content.substring(1) == "21 0B 99 26") )
//21 0B 99 26 change here the UID of the card/cards that you want to give access
{
Serial.println("Authorized access");
Serial.println();
digitalWrite(4, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000);
digitalWrite(4, LOW);
}
*/
else {
Serial.println(" Access denied");
digitalWrite(5, HIGH); // turn the LED off by making the voltage LOW
delay(1000);
digitalWrite(5, LOW);
}
}
and modified by vikrambhayyA; the mfrc522 library installation method was seen from the process
given in https://www.instructables.com/RFID-RC522-With-Arduino/)
circuit diagram taken from https://www.youtube.com/watch?v=3uWz7Xmr55c
विक्रम भय्या విక్రమ్ కుమార్ Vikram BhayyA
Science Communicator
vikramkumar.volunteer@gmail.com
8331926163
http://www.linkedin.com/in/विक्रम-విక్రమ్-vikram-कुमार-కుమార్-kumar-85424172
*/
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
//#define RED 2
//#define Green 3
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
void setup()
{
Serial.begin(9600); // Initiate a serial communication
SPI.begin(); // Initiate SPI bus
mfrc522.PCD_Init(); // Initiate MFRC522
Serial.println("bring your card to the reader...");
Serial.println();
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
}
void loop()
{
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent())
{
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}
//Show UID on serial monitor
Serial.println("UID tag :");
String content= "";
byte letter;
for (byte i = 0; i < mfrc522.uid.size; i++)
{
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
content.concat(String(mfrc522.uid.uidByte[i], HEX));
}
Serial.println();
Serial.print("Message : ");
content.toUpperCase();
if (content.substring(1) == "00 8C 04 1C")// || (content.substring(1) == "21 0B 99 26") )
//21 0B 99 26 change here the UID of the card/cards that you want to give access
{
Serial.println("Authorized access");
Serial.println();
digitalWrite(3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2000);
digitalWrite(3, LOW);
}
/*else if (content.substring(1) == "E1 11 52 19")// || (content.substring(1) == "21 0B 99 26") )
//21 0B 99 26 change here the UID of the card/cards that you want to give access
{
Serial.println("Authorized access");
Serial.println();
digitalWrite(4, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000);
digitalWrite(4, LOW);
}
*/
else {
Serial.println(" Access denied");
digitalWrite(5, HIGH); // turn the LED off by making the voltage LOW
delay(1000);
digitalWrite(5, LOW);
}
}
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.