SOLVED: PN532 (MFRC-522) Module Not Appearing on I2C Bus

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
dirtbikr
New user
Posts: 5
Joined: 03 May 2016, 21:44

SOLVED: PN532 (MFRC-522) Module Not Appearing on I2C Bus

#1 Post by dirtbikr » 03 May 2016, 22:14

Hello everyone,

I recently stumbled on ESP Easy and love the concept and execution, it seems like an awesome way to get a lot of customized home automation and IoT devices online. The first thing I did was flash my NodeMCU board with the stable (78) release and test out the virtual light switch (using the flash button on the NodeMCU board) through Domoticz. This worked great and I could turn the virtual switch on and off.

I purchased a SunFounder PN532 board (http://www.amazon.com/SunFounder-Mifare ... op?ie=UTF8) as I want to integrate it into the home automation to unlock my front door when a familiar tag is read. I first hooked the board up to an Arduino via SPI and verified it worked as expected with some example code (I was able to fetch the UID of each tag read).

I then connected the board via I2C to the NodeMCU board without pullup resistors like such:

"VCC" to "3.3v" on NodeMCU board
"GND" to "GND" on NodeMCU board
"NSS" to "D2" on NodeMCU board (which I believe is GPIO4 in ESP Easy and set to "SDA" by default. I may have these switched though as I don't have it in front of me right now)
"MISO" to "D1" on NodeMCU board (which I believe is GPIO5 in ESP Easy and set to "SCL" by default. As I said above I may have these reversed)

Serial log on the board showed that the was a read error a couple times a second and the number would increase from 0-255 and then back to 0. I2C scan tool reported no devices found on the I2C bus.

I then added 5K pullup resistors tied to 3.3v to the SDA (NSS) and SCL (MISO) lines and nothing changed, still the same error and nothing discovered in the I2C scan tool. I emailed SunFounder since most PN532 boards I have seen have a dedicated SDA line and am waiting for a response, but could it be possible this board does not support I2C, however they have wired it? This is my first time connecting an I2C device in ESP Easy, but I don't think it should take hours to figure it out.

If there is anything else you guys can think of I am all ears, trying to learn as much as possible! Thank you!
Last edited by dirtbikr on 07 May 2016, 21:36, edited 1 time in total.

dirtbikr
New user
Posts: 5
Joined: 03 May 2016, 21:44

Re: PN532 (MFRC-522) Module Not Appearing on I2C Bus

#2 Post by dirtbikr » 06 May 2016, 18:50

Just wanted to update this thread for anyone in the future that might run into this.

I purchased another PN532 breakout that had dedicated lines for SDA/SCL and the selector switch to choose between UART/I2C/SPI. Set the dip switches to I2C, changed the pullups to 2K (closest to the recommended 1.5K that I had), plugged it all in and it worked right away.

I am using this as access control on my front door, so the next issue I ran into was in Domoticz. I was trying to read the values into a virtual text sensor in Domoticz and compare that in the Events section to send an HTTP request to my Vera automation controller to open the lock. This was not working, so I tried a bunch of different sensors and settled on the distance sensor. Almost all of the others seemed to round the tag's UID off (which caused my comparisons to fail), but distance must be stored as a float in Domoticz and as soon as I set that up, I could scan "approved" tags and the front door would unlock. Super cool!

Have a great day!

tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: PN532 (MFRC-522) Module Not Appearing on I2C Bus

#3 Post by tozett » 07 May 2016, 13:12

cool. may you change the thread-topic to SOLVED?

Post Reply

Who is online

Users browsing this forum: No registered users and 131 guests