14

Assuming I cannot use wireless technologies such as LoRa, LTE-M or SigFox in the environment for the install, I must use a wired sensor protocol to communicate with the gateway installed remotely in a building.

The cable runs can be up to 20m from the gateway and ideally I will be purchasing a reliable solution that is not overly expensive. It would be excellent if the sensor was CE compliant but there doesn't seem to be a low cost option (<£20), e.g. solar.

So, the requirements are:

  • Can connect to 10 or more devices
  • Maximum distance at least 20m
  • Price less than £20 for temperature/ humidity/ lux (luminosity) sensor(s)

There are many options such as SPI, I2C, RS485, Onewire and CAN. The protocol we select will determine the sensor we select.

The Onewire protocol from Maxim (Dallas) looks ideal but there are as yet a limited range of sensors, (in saying this we could use the maxim bridge)

What is the best wired protocol for the requirements listed above?

  • 3
    I2C is out of question. As its name tells Inter Integrated Circuit it was designed as on board small distance communication. Very sensitive to bus capacitance so long wires are not the best. Maybe a couple of meters can be achieved with it. – Bence Kaulics Dec 17 '16 at 10:21
  • 3
    RS485 is very old and supported by many sensors. – bravokeyl Dec 17 '16 at 10:58
9

I would either go with RS485 or CAN because with long buses a lot of noise can be picked up. These are the most noise resistant as both of them use differential, twisted data lines.

RS485 supports distances up to ~1,200 meters with a guaranteed speed of 100 Kb/s. Max 10 Mb/s with smaller distances. It is a multi point bus with up to 32 drivers and 32 receivers. (One active driver at a time.)

CAN is usable over 20 meters as well. From this document.

cable length vs signaling rate table

To repeat my comment, I2C is out of question because of the long distances. The bus capacitance would be too high. It is designed for short on-board distances.

As for SPI here is another document about Extending the SPI bus for long-distance communication but it might be complicated. So I would stay with CAN or RS485.

Both of them are pretty common, so finding sensors would not be a problem IMO.

There are sensors with CAN interface as well, but RS485 is more common, so maybe that would be the cheapest and the easiest.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.