Interface Arduino with Loconet for Model Railway

“simplest” always is in the eye of the beholder.

  1. sprinkle Nanos throughout the layout, one per PCA9685 or cluster of PCA9685, interface with RS485.

  2. sprinkle pro Micros throughout the layout, interface via DCC(see post 2).

  3. sprinkle some variant of ESP32 around the layout, interface with PCA9685 or drive a few servos directly; use Wifi for comms. Have to deal with the 3.3V-5V signal issues, but it’s not insurmountable.

  4. put a few Megas on the layout, do more servos/node, fewer nodes. Still need a communication method

And probably a dozen more variants.

I2C is, as you’re finding out, a localized bus. Without grilling you on the details of your implementation, and on your cognizance level of the best ways to optimize I2C(best pullup values, communication speeds, wiring), I’d suggest one of the other methods.

But, the devil is in the details. Room size, layout topography, owner’s skill level at both electronics and code, all play into the ultimate success of your implementation.

I’ve done the RS485 Nano approach, with MCP23017 boards for Tortoises, and it works quite well. I’ve also got several Nano nodes with up to 16 servos and attendant buttons(analog string) and LEDs(WS2812D), all working quite well.

I now also have an 8 servo, 8 Touch Toggle Nano-based solution in the works, which can be expanded quite a bit if you use a Mega instead of a Nano. It also works with the ubiquitous TTP223 touch buttons. Still needs a communication layer for some applications, but I’ve left D0-D2 for MAX485 to be added down the road. This version allows use of the very common Nano breakout boards for connecting both the Touch Button/TTP223 and the servos.

There are many options. Sounds to me like you’ve gone partway down a road, and now want to refactor. Don’t try too hard to keep what isn’t working, instead try for the best solution.

Feel free to reach out by PM to discuss the nuances, if you’d rather.