Reading SPI over a distance using RS485


I have a controller that can read a rfid cardreader using RC522. This uses a SPI connection.

Is it possible to use 2 arduino boards and an RS485 line to put some distance between my controller and cardreader?

In effect I want to the RS522 chip at one end and emulate the RS522 chip using a arduino on the other.

Where do I start or has this been done before?

If you use Arduino #1 to interact with the card reader over SPI, then you can use the serial port Tx line of Arduino #1 to connect to a TTL-to-RS485 converter. On Arduino #2 you can use another TTL-to-RS485 converter connected to its Rx line. That would give you one way communication between your 2 Arduinos.

According to MaximIntegrated, the maximum cable length is about 4000ft (or 1.2km) with a data rate limited to 100kbps. That was part of the 1998 spec but using modern devices you might be able to get further if needed.

Of course, if you need 2-way communication with your card reader, then you can use half duplex communications over the same twisted pair cable or install 2x twisted pair cables for full duplex if you need it.