Arduino controlled model trains and layout

sterretje:
The main thing that I definitely would have done differently is the use of the I2C bus; it's not designed for long distances. and hence your setup requires all URBs to be close to each other which will still result in long wires under a layout. I've always visualised my design with RS232/RS422/RS485 which would be better in my view so modules can be closer to the area where they are needed and reducing the wire mess under a layout. It will also be easier for modular layouts.

You are absolutely right. I2C bus has a problem with long cables and use RS282 and RS485 is the best solution.
My project has no restrictions on the use of any types of buses, I like CANbus more. The whole idea is to you make design your own control system, as similiar design from LEGO cubes.

But I2C is the only way to make routing between several microcontrollers, simple and very affordable way in Arduino. That's why I chose this solution. Any person who has more than one Arduino board can wield I2C bus without other devices.
Also, It seems to me also a very important a simply applyed software application of I2C bus. For I2C there is a classic library of the Wire, and its use in a sketch is very simple, you just need to specify the address and send one byte of data to it. On my project, send the one byte is more than enough.

You can send commands via the I2C bus to any of the end peripherals connected to any URB on the layout. According to the specification, the maximum length I2C bus when using a twisted pair of about eight meters. In practice, with a total cable length of three meters, everything works correctly.
If you need a large length of wires, you can use a repeater consisting of two URBs, creating a connection I2C-Serial-I2C (see previous posts). Or apply RS485 or similar buses.