0

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
    What sort of boat? I2C over what distance? – AlmostDone Mar 23 '18 at 01:22
  • We need details more than your strategy or maybe this-or-that ideas. Else we cannot help you. CAN is a good idea. So is I2C if done correctly. –  Mar 23 '18 at 03:35
  • 4
    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) – Michael Karas Mar 23 '18 at 03:50
  • 2
    (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. – Michael Karas Mar 23 '18 at 03:54
  • 1
    https://electronics.stackexchange.com/questions/283748/i²c-bus-buffer-vs-extender-p82b715-vs-p82b96/284664#284664 – Henry Crun Mar 23 '18 at 05:08
  • @AlmostDone I'm concentrating on sailboats. Personally I'm looking around 30' (~10m) overall, but it would be nice if other people used the system to, so around 50' is getting pretty big for a recreational yacht –  Mar 23 '18 at 07:35
  • @Sparky256 I've started to put together a wiki with the design, a bucket list of what I want to measure is here: https://github.com/chris-brown-nz/PiLogbook/wiki/Future-Enhancements –  Mar 23 '18 at 07:38
  • @MichaelKaras Thanks Michael, I knew that the addresses weren't finite but didn't know it was this much of an issue. I like the second option of using dedicated MCUs as that would allow me to have a 'backbone' going round the boat, instead of wires going everywhere from a heap of 8-device multiplexers. Good info though, thanks. –  Mar 23 '18 at 07:43
  • @HenryCrun Thanks Henry, something to bear in mind for devices close to controller, however I don't think I'll get away from the cable run issue completely, with a masthead device up an 8m mast (and then having to get back to the controller) I'm going to need to look at extending the signal in places. This will be useful for the closer runs though. –  Mar 23 '18 at 07:46
  • 2
    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 – Henry Crun Mar 23 '18 at 10:51
  • 2
    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 – Henry Crun Mar 23 '18 at 10:52
  • Thanks @HenryCrun, I understood all of your comment (after Googling) apart from what you mean by "Using a bus switch breaks the bus onto lower capacitance segments" - that is I understand what you mean but don't understand the implications and can't find any answers on Google. What should I be reading to get a better understanding? Thanks heaps. –  Mar 24 '18 at 05:01
  • Lets say you have 15m to masthead + 8m to bow + 7m stern +4m engine + 3m bilge +1m local = 38m cable total without a bus switch. A fault anywhere and your whole system is dead. The whole system has to run at 10kHz (perhaps) as cable is so long. When your ssb radio transmits, the whole system stops working. With bus switch, each segment is isolated in operation. A fault only affects that segment, and the system can report which cable failed. The mast runs slowly at 20kHz perhaps, the others at 50kHz, local at 400kHz. During transmit, only mast and stern are affected. – Henry Crun Mar 24 '18 at 05:32
  • Thanks @HenryCrun, sorry for the delay I've been pondering what you said and come up with a rough design which I think may work. http://35.226.134.251/doc/img/2018/03/draft_i2c_bus_layout_large.jpg Thank you for your help. –  Apr 06 '18 at 10:41

0 Answers0