I am using a Raspberry Pi3 to design a system for automation, monitoring, navigation and general management of a boat.

I'll be using quite a lot of I2C sensors (but well under the maximum which I believe is 127).

I had planned to arrange them in a loop around the boat, however I've read from various sources that the maximum cable run is pretty short (around 1m seems to be a common number).

A couple of options I've looked at for extending the range are using a P82B96 buffer, or a CAN Bus network. The P82B96 looks fairly straightforward?

I haven't done this or even looked into it before, so would like to know if one of the suggestions I've made is considered 'best practice', or if there's something I've not heard of.

Another consideration is what standard interconnects a system might have. In a harsh marine environment they must be robust and IP67/IP68 in places. I will need panel mount, through bulkhead, plugs (M&F), inline connectors and cable and blanking plugs to prevent accidental ingress.

  • 1
    \$\begingroup\$ What sort of boat? I2C over what distance? \$\endgroup\$ – AlmostDone Mar 23 '18 at 1:22
  • 4
    \$\begingroup\$ Note that whilst the I2C spec and protocol allows for 127 or 128 devices you will in practice be unlikely to achieve that in a single I2C bus segment. The reason for this is that various types of sensors are designed with a very specific range of I2C addresses. Take temperature sensors for instance. They typically support up to 8 address sets via strapping pins so using that component you are limited to 8 temperature sensors. Same holds true for other families of I2C type devices. You can work around this limit by using I2C muxes and making branches on your bus structure (continued) \$\endgroup\$ – Michael Karas Mar 23 '18 at 3:50
  • 2
    \$\begingroup\$ (continued from above) that use the same sensor addresses in repeat across a number of sub bus segments. Another way is to design all your sensors with a small MCU as part of each sensor device. Some means can be used to configure that address for each MCU over the full range. The MCU in turn talks to the local I2C device and translates the control and status monitoring for the sensor accordingly. \$\endgroup\$ – Michael Karas Mar 23 '18 at 3:54
  • 2
    \$\begingroup\$ Using a bus switch breaks the bus onto lower capacitance segments. It also allows segment faults without disabling the whole system. You can use lower speeds for longer runs. Nothing says 100kHz is compulsory \$\endgroup\$ – Henry Crun Mar 23 '18 at 10:51
  • 2
    \$\begingroup\$ And you MUST use some sort of level shifter/protection circuit when the I2C comes from an SOC e.g RPI. They have notoriously un-robust i/o \$\endgroup\$ – Henry Crun Mar 23 '18 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.