{"id":3635,"date":"2020-05-19T23:43:17","date_gmt":"2020-05-19T21:43:17","guid":{"rendered":"https:\/\/arduino.net.pl\/?p=3635"},"modified":"2020-05-20T00:07:45","modified_gmt":"2020-05-19T22:07:45","slug":"rfid-rc522","status":"publish","type":"post","link":"https:\/\/arduino.net.pl\/index.php\/rfid-rc522\/","title":{"rendered":"RFID RC522"},"content":{"rendered":"\n\n\n<p>\u0179r\u00f3d\u0142o: <a href=\"https:\/\/randomnerdtutorials.com\/security-access-using-mfrc522-rfid-reader-with-arduino\/\">Security Access using MFRC522 RFID Reader with Arduino<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">PO\u0141\u0104CZENIE<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>MFRC522<\/strong><\/td><td><strong>ARDUINO UNO<\/strong><\/td><\/tr><tr><td>RST<\/td><td>9<\/td><\/tr><tr><td>SDA<\/td><td>10<\/td><\/tr><tr><td>MOSI<\/td><td>11 \/ ICSP-4<\/td><\/tr><tr><td>MISO<\/td><td>12 \/ ICSP-1<\/td><\/tr><tr><td>SCK<\/td><td>13 \/ ICSP-3<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1276\" height=\"693\" src=\"https:\/\/arduino.net.pl\/wp-content\/uploads\/2020\/05\/Zrzut-ekranu-2020-05-19-o-23.39.36.png\" alt=\"\" class=\"wp-image-3637\" srcset=\"https:\/\/arduino.net.pl\/wp-content\/uploads\/2020\/05\/Zrzut-ekranu-2020-05-19-o-23.39.36.png 1276w, https:\/\/arduino.net.pl\/wp-content\/uploads\/2020\/05\/Zrzut-ekranu-2020-05-19-o-23.39.36-300x163.png 300w, https:\/\/arduino.net.pl\/wp-content\/uploads\/2020\/05\/Zrzut-ekranu-2020-05-19-o-23.39.36-1024x556.png 1024w, https:\/\/arduino.net.pl\/wp-content\/uploads\/2020\/05\/Zrzut-ekranu-2020-05-19-o-23.39.36-768x417.png 768w, https:\/\/arduino.net.pl\/wp-content\/uploads\/2020\/05\/Zrzut-ekranu-2020-05-19-o-23.39.36-440x239.png 440w\" sizes=\"auto, (max-width: 1276px) 100vw, 1276px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">BIBLIOTEKA<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/github.com\/miguelbalboa\/rfid\">miguelbalboa\/rfid<\/a> &#8211; biblioteka<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">KOD<\/h4>\n\n\n\n<p>Lekko zmodyfikowa\u0142em kod ze strony dodaj\u0105c kody breloka i karty<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; light: false; title: Kod:; toolbar: true; notranslate\" title=\"Kod:\">\n\/*\n * \n * All the resources for this project: http:\/\/randomnerdtutorials.com\/\n * Modified by Rui Santos\n * \n * Created by FILIPEFLOP\n * \n *\/\n \n#include &lt;SPI.h&gt;\n#include &lt;MFRC522.h&gt;\n \n#define SS_PIN 10\n#define RST_PIN 9\nMFRC522 mfrc522(SS_PIN, RST_PIN);   \/\/ Create MFRC522 instance.\n\n#define UID1 &quot;00 00 00 00&quot; \/\/ wpisz kod uid breloka\n#define UID2 &quot;00 00 00 00&quot; \/\/ wpisz kod uid karty\nvoid setup() \n{\n  Serial.begin(9600);   \/\/ Initiate a serial communication\n  SPI.begin();      \/\/ Initiate  SPI bus\n  mfrc522.PCD_Init();   \/\/ Initiate MFRC522\n  Serial.println(&quot;Approximate your card to the reader...&quot;);\n  Serial.println();\n\n}\nvoid loop() \n{\n  \/\/ Look for new cards\n  if ( ! mfrc522.PICC_IsNewCardPresent()) \n  {\n    return;\n  }\n  \/\/ Select one of the cards\n  if ( ! mfrc522.PICC_ReadCardSerial()) \n  {\n    return;\n  }\n  \/\/Show UID on serial monitor\n  Serial.print(&quot;UID tag :&quot;);\n  String content= &quot;&quot;;\n  byte letter;\n  for (byte i = 0; i &lt; mfrc522.uid.size; i++) \n  {\n     Serial.print(mfrc522.uid.uidByte&#x5B;i] &lt; 0x10 ? &quot; 0&quot; : &quot; &quot;);\n     Serial.print(mfrc522.uid.uidByte&#x5B;i], HEX);\n     content.concat(String(mfrc522.uid.uidByte&#x5B;i] &lt; 0x10 ? &quot; 0&quot; : &quot; &quot;));\n     content.concat(String(mfrc522.uid.uidByte&#x5B;i], HEX));\n  }\n  Serial.println();\n  Serial.print(&quot;Message : &quot;);\n  content.toUpperCase();\n  if ((content.substring(1) == UID1) || (content.substring(1) == UID2)) \/\/change here the UID of the card\/cards that you want to give access\n  {\n    Serial.println(&quot;Authorized access&quot;);\n    Serial.println();\n    delay(3000);\n  }\n \n else   {\n    Serial.println(&quot; Access denied&quot;);\n    delay(3000);\n  }\n} \n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">LINKI<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.youtube.com\/watch?v=waYM37_fUsg\">ESP32 #33: RFID Read and Write with MFRC522 Module + ESP32 Giveaway<\/a><\/li><\/ul>\n\n\n","protected":false},"excerpt":{"rendered":"<p>\u0179r\u00f3d\u0142o: Security Access using MFRC522 RFID Reader with Arduino PO\u0141\u0104CZENIE MFRC522 ARDUINO UNO RST 9 SDA 10 MOSI 11 \/ ICSP-4 MISO 12 \/ ICSP-1 SCK 13 \/ ICSP-3 BIBLIOTEKA&#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[108],"class_list":["post-3635","post","type-post","status-publish","format-standard","hentry","category-arduino","tag-rfid-rc522"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/3635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/comments?post=3635"}],"version-history":[{"count":4,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/3635\/revisions"}],"predecessor-version":[{"id":3641,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/3635\/revisions\/3641"}],"wp:attachment":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/media?parent=3635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/categories?post=3635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/tags?post=3635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}