• Login
    • Search
    • [[global:header.recent]]
    • [[global:header.tags]]
    • [[global:header.popular]]
    • [[global:header.groups]]
    • [[global:header.search]]

    Elechouse PN532 NFC Module V3 for Arduino etc.

    Ideas for using NFC Rings
    26
    113
    232617
    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.
    • Lokki
      Lokki Community Helper last edited by

      @Pingi that's definitely better than the last one!

      Just to step back from everything and clear things a little, if you guys need to troubleshoot I'd recommend going via the elechouse manual from ~page 5. Once you've verified that it is hooked up correctly and is functioning with the example code then you have a known point to work forward from.

      http://www.elechouse.com/elechouse/images/product/PN532_module_V3/PN532_ Manual_V3.pdf

      P 1 Reply Last reply Reply Quote 0
      • P
        Pingi @Lokki last edited by

        @Lokki thanks for your suggestion, but that manual I have earlier than my first NFC shield. What I've understood from that manual I've used while wiring. The sample codes are also from there...
        I've checked the document 10 times also the wiring, tried to re-install the libraries, but the result is the same. That's why I've uploaded the photo, maybe you or somebody else has better eyes or more experience, what to check or where to look around...

        Lokki 1 Reply Last reply Reply Quote 0
        • Lokki
          Lokki Community Helper @Pingi last edited by

          @Pingi are you still using 19200 as the serial speed? If so, could you try some other settings there, up to 115200?

          P 1 Reply Last reply Reply Quote 0
          • S
            Shpalman last edited by Andreas

            hello
            I'm having the same problem: arduino one brake on the line nfc.begin();
            I'm new in arduino and nfc, but I've downloaded pn532 libraries, set pin 1-0 on the board, all the 4 wires are ok (vcc, gnd, sda, scl); the serial speed is set to 115200
            in this code:

              #include <Wire.h>
              #include <PN532_I2C.h>
              #include <PN532.h>
              #include <NfcAdapter.h>
              PN532_I2C pn532i2c(Wire);
              PN532 nfc(pn532i2c);
              
            void setup(void) {
              Serial.begin(115200);
              Serial.println("Hello!");
              nfc.begin();
              Serial.println("second Hello!");
            

            the serial write just the first Hello!
            I can't find a solution... Help me!!

            ok
            now it works!
            in SPI mode (jumper 0 - 1) and SCK MISO MOSI SS VCC GND

            thank you all
            Massimo

            1 Reply Last reply Reply Quote 0
            • S
              Sergey last edited by Andreas

              I, too, stops on the line nfc.begin(); if disconnect board or select another pin - Didn't find PN53x board. Connect to I2C. SPI don`t work too.

              hardware\arduino\avr\libraries\Wire\utility\twi.c

              uint8_t **twi_writeTo**(uint8_t address, uint8_t* data, uint8_t length, uint8_t wait, uint8_t sendStop)
              {
               . . . . . . . . . . . . . . . . . . . 
                // wait for write operation to complete
                while(wait && (TWI_MTX == twi_state)){
                  continue; //**stops here**
                }
                
                if (twi_error == 0xFF)
                  return 0;	// success
                else if (twi_error == TW_MT_SLA_NACK)
                  return 2;	// error: address send, nack received
                else if (twi_error == TW_MT_DATA_NACK)
                  return 3;	// error: data send, nack received
                else
                  return 4;	// other twi error
              }
              
              1 Reply Last reply Reply Quote 0
              • P
                Pingi @Lokki last edited by

                @Lokki , thanks for the hint. I've tried the whole range from 9600 up to 250000, but the result is the same.

                @Sergey , I think, that we both have the same issue, I've also checked the twi.c and my intention was that my code stopped on the same line. What the hell? Has anybody better understanding of the I2C protocol? Maybe the NFC shield is absolutely not responding to I2C protocol? But, I've 3 NFC shields of the same type but ordered from 3 different shops. The result is the same.... It's very hard to imagine, that all 3 shields are wrong, so the question is, what are we doing wrong?!

                L 1 Reply Last reply Reply Quote 0
                • L
                  Laszlo @Pingi last edited by

                  @Pingi Hi. I think you should write about this problem on stackoverflow. Maybe Michael Roland spots your question and helps you, he is quite good in NFC things! Dont forget to come back with the solution to this forum ;)!

                  1 Reply Last reply Reply Quote 0
                  • J
                    Javier last edited by

                    Try the same that I did! Read my previous reply. I made it work.

                    P 1 Reply Last reply Reply Quote 0
                    • P
                      Pingi @Javier last edited by

                      @Javier, thanks for the hint. I did not understood all you tries, but I've verified the followings already:

                      • resetting arduino
                      • changing voltage source from 5v to 3.3V

                      What I do not understand is:

                      • removing firmware lines of code
                      J 1 Reply Last reply Reply Quote 0
                      • S
                        shagun_8 last edited by

                        Has anyone worked with this module on raspberry pi?!
                        I just tried i2c connection, the raspberry pi is able to detect the device, but still I don't know which library will work. Please can someone help?!

                        1 Reply Last reply Reply Quote 0
                        • W
                          Waldi last edited by

                          Hey guys, found this Thread via google. I have exactly the same issue with a Arduino Nano and ElecHouse V3 Board. I have 3 boards ordered over an Aliexpress dealer.

                          • wired via i2c
                          • 3,3V used
                          • switch set to 1/0 for i2c
                          • downloaded the libraries from elechouse github
                          • power LED on board is on
                          • used demo code from elechouse (and the pieces posted above)
                          • removed all unneeded code related to SPI and Serial
                          • also tried with 2 additional 10k pullup resistors on I2C

                          -> same problem on all 3 V3 Boards - the code hangs on "nfc.begin". I have added a 2nd serial print "Hello" after "nfc.begin". This Hello isn't printed, only the first one. So it definatly hangs on this point.

                          If I disconnect GND from board on the "Hello" point I get this output (Debug is enabled on PN532_debug.h):

                          Hello!
                          write: 02
                          wait for ack at : 9101
                          Time out when waiting for ACK
                          Didn't find PN53x board

                          1 Reply Last reply Reply Quote 0
                          • W
                            Waldi last edited by

                            Tried an other Arduino Nano - it works. So maybe the I2C Pins or smthg else was bricked on the Nano.

                            1 Reply Last reply Reply Quote 0
                            • J
                              Javier @Pingi last edited by

                              @Pingi Some examples code have this lines of code:
                              I commented because the library could be bad.

                              void setup(void) {
                                Serial.begin(115200);
                                Serial.println("Hello!");
                              
                                nfc.begin();
                              
                              //  uint32_t versiondata = nfc.getFirmwareVersion();
                              //  if (! versiondata) {
                              //    Serial.print("Didn't find PN53x board");
                              //    while (1); // halt
                              //  }
                              //  
                              //  // Got ok data, print it out!
                              //  Serial.print("Found chip PN5"); Serial.println((versiondata>>24) & 0xFF, HEX); 
                              //  Serial.print("Firmware ver. "); Serial.print((versiondata>>16) & 0xFF, DEC); 
                              //  Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);
                              
                              1 Reply Last reply Reply Quote 0
                              • N
                                niocio01 last edited by

                                I have the same problem.

                                I have my pn532 v3 connected to my arduino mega via i2C.
                                But I only get the "Hello" message trough the Serial Monitor.
                                As suggested by Waldi the programm seems to get stuck at nfc.begin().

                                does anyone have a fix for this problem?

                                1 Reply Last reply Reply Quote 0
                                • M
                                  mc_glenn @Lokki last edited by

                                  @Lokki Hello sir. I have been trying to make my RFID work but with no success. I copied and pasted your previous codes, as I am very very new with PN532. May I know what could be the concern if as I run the program, it only stops on 'Im a Car!' or to @shagun_8 's code 'NFC Tag Writer'. Please help. Thank you

                                  1 Reply Last reply Reply Quote 0
                                  • P
                                    Peter176 last edited by

                                    Hi Guys!

                                    We ran into the same problem: PN532 V3 Module from elechouse and try to use it with I2C. After nfc.begin it stuck and no answer from module.
                                    After a lot of digging we found a solution. If you are using the Library which is extended with HSU compatibility in the end of PN532/PN532.h file there is the declaration of the buffer:
                                    uint8_t pn532_packetbuffer[255];

                                    If we changed the pn532_packetbuffer array size from 255 to 64 then the I2C communication starts immediately and the module could read data from tags. So the line in the header should look like this:
                                    uint8_t pn532_packetbuffer[64];

                                    Probably the buffer size was changed because of the HSU communication, while in the original repository this value is still 64, but unfortunately it does not fit to I2C communication

                                    Hope this helps for some people, who have the same problem.

                                    M 1 Reply Last reply Reply Quote 1
                                    • T
                                      Tompson Lopes Neves last edited by

                                      I have the same problem. I soved this problem just soldering two wires in the IRQ and RSTO ports of elctohouse module, and connecting respective in digital ports 2 and 3. looks like this

                                      L 1 Reply Last reply Reply Quote 0
                                      • A
                                        amir last edited by

                                        This post is deleted!
                                        1 Reply Last reply Reply Quote 0
                                        • M
                                          mh @Peter176 last edited by

                                          @Peter176 Registered here just to say thanks. I struggled with this for a little bit until finding your post. This solves the "Didn't find PN53x board" problem!

                                          1 Reply Last reply Reply Quote 0
                                          • L
                                            leo last edited by

                                            hy @Tompson-Lopes-Neves and @Peter176
                                            i have problem about nfc v3, nfc can't read card and "Didn't find PN53x board"
                                            can you help me?
                                            give me code, true
                                            thanks

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post