New simple network card

I’ve been working up a design for a simple card, 50mm x 50mm, for networking a bunch of sensor nodes together using CAT5 type cable (8 conductor) using RS485 electrical levels, to support long distances and not have to mess with wireless.
(other cable or jacks could also be used - or no jack, just solder two-wire twisted pair to the board.)

A processor-less card at one end of the chain will connect to an Arduino to drive the string using a master/slave type protocol. Each card will be locally powered with 5V wallwart. The RS485 driver can be one of a number of chips. The chips seem to vary in price depending on how many “loads” they present to the chain, thus impacting the number of nodes that can be connected. “1 load” chips are the lowest cost, with a a limit of 32 nodes, while “1/4 load” are approx. twice to 2.5 times that but allow up to 256 nodes.

Each card has two RJ45 jacks, so the string can continue by connecting more cards. Three connectors could be crammed onto a 50 x 50mm card, I chose not to cram that much onto the card for now.

Space is provided so the end card can have bus termination resistors as needed.
+5/Gnd/14 data lines are on 0/.1" pitch spaced headers, so a perfboard daughter card can be easily mounted. The ICSP and FTDI headers can also be accessed on the same pitch, altho Rx/Tx and D2 are used for serial comm’s, thus only 17 IO are envisioned to be accessible if one really wanted to go nuts at a node.

My thinking is that each device will always be listening, and enables its Tx line when it transmits.
Perhaps something like:

The comm sketch addition for slave each card would be simple, for example:

if (Serial.available()>2){ // 3 byte command received?
  if (Serial.read() == 0xAA){ // query from master, used to get in sync
    if (Serial.read() == myAddress){ // are you talking to me?
      if (Serial.read() == 0x01){ // send status command
        // send 3 bytes back
       digitalWrite (txEnable, LOW);
       Serial.write (0x55);
       Serial.write (myAddress);
       Serial.write (myStatus);
       digitalWrite (txEnable, HIGH);
      }
    }
  }
}

On the master side, do the same, loop thru the addresses: send out 3 bytes, pause to give slave a chance to answer, read in the status, next device.
Maybe add a time check to make sure slave answers in timely manner and has not died, or cable got yanked along the line, etc.
Of course that can be beefed up to send more commands, receive more data, maybe have global commands, etc.

Altho all these articles would seem to suggest a 3 connector card would be very useful too.

AN723 RS485 fail safe terminations.pdf (155 KB)

AN763 RS485 termination.pdf (234 KB)

AN-960 Analog Devices RS485.pdf (246 KB)

Ok, 3 connector, but lost the mounting holes. Ultimate flexibility on building up the network.

Nice work. reminds me of this thread - http://forum.arduino.cc/index.php?topic=213941.0 -

robtillaart: Nice work. reminds me of this thread - http://forum.arduino.cc/index.php?topic=213941.0 -

With the notable exception that RS485 is much more robust over long distances than any of the protocols used on the Kat/Kiten boards.