Arduino Nano and PN532 with long cable doesn't work

Hi everybody, I'm developing a project with sensor RFID PN532 v.3 and a Arduino Nano v.3. It works perfect when I use short cables (20 cm) , but I want to implement it in my door so I need a long cable (180 cm), I decided using UTP Cat 5 cable, the sensor turn on well but it's not recongnize by Arduino, that is, it doesn't work. I think this is because to using larger cable, so my question is, can I use a extra component to solve this?

thank you

Are you using the i2c version? If so, the best you can do with CAT5 cable is to use twisted pairs as
pair 1: GND + SDA
pair 2: GND + SCL
pair 3: GND + GND
pair 4: GND + POWER

also, a capacitor near your sensor to keep the voltage stable.

You can also use an i2c extender, like this: Adafruit LTC4311 I2C Extender / Active Terminator [STEMMA QT / Qwiic] : ID 4756 : $7.50 : Adafruit Industries, Unique & fun DIY electronics and kits

Yes, I'm using I2C connection. I used a 220uf capacitor, it works for a while, it reads a card one time and then it fails.
I didn't understand how to connect twisted pairs, could you please explain me again with a simply diagram? thank you

a twisted pair is usually a solid color and the same solid color with white. These two wires are twisted together inside the Cat5 cable. There are usually 4 of these twisted pairs, blue, orange, green and brown. so
SCL = blue+white
GND = blue
SDA = orange+white
GND = orange
Power = brown+white
GND = brown
GND = green+white and green

make sure to tie all the GNDs together at both ends

Hi @arv07 @blh64 .

To avoid the "ground loop" effect, I recommend that the ground should only be turned on on one side, and that the other end be left free.
Only the power return GND should be turned on from both sides.

RV mineirin

In an electrical system, a ground loop or earth loop occurs when two points of a circuit are intended to have the same ground reference potential but instead have a different potential between them . ... Ground loops are a major cause of noise, hum, and interference in audio, video, and computer systems.

@ruilviana @blh64 I have found next: with a short cable SDA and SCL voltage is 2.5 and 2.6 approximately and it works ok. With a long cable sometimes SDA is 4.2v and SCL is 2.5v and viceversa. When I use twisted pairs as @blh64 told, SDA and SCL are 4.2v and sensor doesn't work. I tried using pull-up resistor putting a resistor with different values (4.7k, 1.2k, 2.2k, 3.3k) in SDA and SCL but again sensor doesn't work. This is the link I found https://forums.adafruit.com/viewtopic.php?t=125116

Hi @arv07

Are there the required pull_up resistors on your I2C bus?

RV mineirin

@ruilviana yes, however I decied using a 150 cm cable, it works ok but I need to do an extra work in my door to install the device. thank you

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.