Friday, April 6, 2018

MicroPython and RFID-RC522 (NodeMCU clone and RFID reader)

Refer to micropython-mfrc522.  Download and unzip to your PC, use a tool like ampy to copy read.py, write.py and mfrc522.py to the root directory of your device.

Connect to the RFID-RC522 according to the picture above.  I wrote the corresponding pins of the RFID-RC522 in white text on top of the NodeMCU.

Run a tool like screen to open up a terminal that shows the REPL running on the device that's running MicroPython.  I use the command: screen /dev/ttyUSB0 115200.

At the REPL, type "import read".  Then "read.do_read()".  You should get a dump of the RFID tag when you hold it in front of the reader.

You can also experiment with writing data back to the RFID tag.

Here's my setup:

No comments: