RFID module working on USB power supply but not on external power supply.

I'm working on a project based on this door lock project: http://www.instructables.com/id/Arduino-RC522-RFID-Door-Unlock/step2/Hardware-Setup/
So I connected the RFID reader module (https://www.iprototype.nl/products/components/rfid/rfid-reader-rc522), the button and a LED instead of the relay to an Arduino Uno.

When testing everything on a breadboard setup, it works fine when I power the arduino via USB (3.0) and via an external power supply (12V 1500mA). The LED goes on when I scan a card on the RFID module just as programmed.

For the project, I need the RFID reader module to be +/- 7 meters away from the arduino. I connected the module and the arduino with a 7 meter CAT6 F/UTP cable. When testing the same script again, everything worked as expected when powering the arduino with a USB cable from my laptop (USB 3.0).

When I power the arduino with the external supply (12V 1500mA), the arduino works, I can read the serial output, the RFID reader module is getting 3.2V power (the same as when working with USB power).
The only thing that is not working is when I try to scan a card, nothing happens??...
I tried using a 9V 400mA power supply, but this one also does not work.
Replacing the Arduino or the RFID module gives the same problem.

Does anyone know what is causing this and how I can solve it? I would like to power the arduino with an external power supply because I want to use a relay shield which needs the arduino to have at least a 9V power supply.

Thanks in advanced!!

Possibly noise.

So... I'm having a bit of difficulty sorting this out.

On the breadboard, powered only by USB only. Works.

On the breadboard, powered only by 12V 1.5A power supply. Works.

Connected up differently with 7 meters of Cat 6 cable, powered only by USB. Works.

Connected up differently with 7 meters of Cat 6 cable, powered only by 12V 1.5A power supply. Does not work.

Is this correct?

Schematic? Picture of the layout?

I'm guessing that the 12V 1.5A power supply is a switching regulated power supply, and that the 9V 400mA supply is an old linear unregulated power supply. So even after fixing the problem, it may have issued on the 9V supply.

So I connected the RFID reader module (https://www.iprototype.nl/products/components/rfid/rfid-reader-rc522), the button and a LED instead of the relay to an Arduino Uno.

The RFID reader on that link uses SPI. Is that what you have running over the 7m cable?

Do you have access to a data analyser or oscilloscope to check the SPI signals, looking to see if they differ when you use PSU instead of USB power?

To add to what @polymorph said, maybe there is a difference in grounding between the two configurations. Try turning off power to the PC or USB power supply (whatever is feeding power to the Arduino) but leave it connected while you power the Arduino from the PSU.

Thanks for your replies! I found the solution :slight_smile:

The RFID reader on that link uses SPI. Is that what you have running over the 7m cable?

Yes it is! Using google to find if SPI signals have problems when using long wires learned me that indeed they do. (Long distance SPI installation: Lessons Learned)

The faster the SPI signal is, the more vulnerable it is.

I went looking for the SPI configuration in the RFID library and added this line which slows down the SPI signal by a factor of 8. This solved my problem.

SPI.setClockDivider(SPI_CLOCK_DIV8);

Yay!