2022년 5월 26일 목요일

RFID (RC522)

 

https://lastminuteengineers.com/how-rfid-works-rc522-arduino-tutorial/








Arduino Code – Reading RFID Tag (=테그읽기)

Communicating with RC522 RFID module is a bunch of work, but luckily for us, there’s a library called MFRC522 library which simplifies reading from and writing to RFID tags. 

To install it, open the Arduino IDE, go to Sketch > Include Library > Add .ZIP Library, 

and then select the rfid-master.zip file that you just downloaded. 

If you need more details on installing a library, visit this Installing an Arduino Library tutorial.



▼라이브러리 설치했으면 여기부터 읽을것

Once you have the library installed, open Examples submenu and select MFRC522 > DumpInfo example sketch.

This sketch will not write any data to the tag. 

It just tells you if it managed to read the tag, and displays some information about it. 

This can be very useful before trying out any new tag!

Go to the beginning of the sketch and make sure that the RST_PIN is correctly initialized, in our case we’re using digital pin #5 so change it to 5!

리셋핀이 뭔지 잘 체크하고 코드 수정할것



OK, now upload the sketch and open the Serial Monitor

As soon as you bring the tag closer to the module, you’ll probably get something like the following. 

Do not move the tag until all the information is displayed.

생각보다 오래 Tag하고 있어야 정보가 보인다.


>>

MIFARE Classic 1K Memory Layout

The 1K memory of the Tag

                        is organized in 16 sectors (from 0 ~ 15)

Each sector is devided in to 4 blocks

Each block can store 16 bytes of data (from 0 ~ 15)


The Manufacturer Block is highlighted in red below



https://blog.naver.com/simjk98/222203260487https://blog.naver.com/simjk98/222203260487

댓글 없음:

댓글 쓰기