🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5Stack - Simple Applications for RFID- Arduino

    Scheduled Pinned Locked Moved PROJECTS
    9 Posts 6 Posters 28.4k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      Ddaniel
      last edited by

      HI,
      I would like to connect a RFID reader to a M5Stack, I have a RC522 sensor witch is connected like this SDA to SDA, SCK to SCK, MOSI to MO, MI to MI, Reset to 1. I have this code:

      #include <SPI.h>
      #include <MFRC522.h>
      #include <M5Stack.h>

      #define RST_PIN 1 //Pin 1 para el reset del RC522
      #define SS_PIN 21 //Pin 21 para el SS (SDA) del RC522
      MFRC522 mfrc522(SS_PIN, RST_PIN); //Creamos el objeto para el RC522

      void setup() {
      M5.begin();
      Serial.begin(9600); //Iniciamos la comunicación serial
      SPI.begin(); //Iniciamos el Bus SPI
      mfrc522.PCD_Init(); // Iniciamos el MFRC522
      Serial.println("Lectura del UID");
      M5.Lcd.println("Lectura del UID");
      }

      void loop() {
      // Revisamos si hay nuevas tarjetas presentes
      if ( mfrc522.PICC_IsNewCardPresent())
      {
      //Seleccionamos una tarjeta
      if ( mfrc522.PICC_ReadCardSerial())
      {
      // Enviamos serialemente su UID
      Serial.print("Card UID:");
      M5.Lcd.println("Card UID:");
      for (byte i = 0; i < mfrc522.uid.size; i++) {
      Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
      M5.Lcd.print (mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
      Serial.print(mfrc522.uid.uidByte[i], HEX);
      M5.Lcd.print (mfrc522.uid.uidByte[i], HEX);
      }
      Serial.println();
      M5.Lcd.println();
      // Terminamos la lectura de la tarjeta actual
      mfrc522.PICC_HaltA();
      }
      }
      ´´
      Unfortunately does not work.
      Please, could somebody give me an advise, something simple...
      In the future I want to create a door access.
      Thank you in advance.

      1 Reply Last reply Reply Quote 0
      • m5stackM Offline
        m5stack
        last edited by

        pin 1 is for serial0, maybe not good for this.

        1 Reply Last reply Reply Quote 2
        • D Offline
          dda
          last edited by

          #define RST_PIN 1 //Pin 1 para el reset del RC522

          As @m5stack said, PIN 1 is used by Serial0. You should pick a GPIO that's not in use already.

          D 1 Reply Last reply Reply Quote 1
          • D Offline
            Ddaniel @dda
            last edited by

            @dda Are there any other solucions to connect RFID to M5Stack?

            D 1 Reply Last reply Reply Quote 0
            • D Offline
              dda @Ddaniel
              last edited by

              @ddaniel Read my answer again: don't use pin 1 for RST_PIN. Connect it to another pin that isn't used yet.

              1 Reply Last reply Reply Quote 0
              • D Offline
                Dave
                last edited by

                I am interested in a compact RFID reader with a feedback display.
                I am wondering whether you have managed to build the sensor into the stack or whether it needs to be put off to the side somewhere?

                JJJ 1 Reply Last reply Reply Quote 0
                • JJJ Offline
                  JJ @Dave
                  last edited by

                  @dave Hi Dave,

                  I have a RFID-RC522 module on order but hasn't arrived yet... Apparently the board dimensions are: 3.9 x 6 cm

                  So unfortunately it seems the whole module won't fit inside the M5 case....

                  Might be ok with just a little sticking out the side....

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    jp128
                    last edited by

                    You could take a look at https://www.sparkfun.com/products/11828

                    It is somewhat more expensive, but has a body type that may be able to fit just fine into a different stack, or even the protoboard. They have other models as well.

                    JJJ 1 Reply Last reply Reply Quote 1
                    • JJJ Offline
                      JJ @jp128
                      last edited by JJ

                      @jp128 @Dave @ddaniel

                      Hi Jp128,
                      Thanks for the tip..... could be very useful.... more reading required....

                      1 Reply Last reply Reply Quote 0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • First post
                        Last post