1
\$\begingroup\$

I would like to setup a "sensor array" which has 4 sensors attached to it. Each sensor is expected to send data at rates of up to 8 Hz. The data would be shipped off to an MCU that is around 1-2 meters away.This MCU will store the data into an SD card.

To illustrate this a little better:

basic layout illustration

I was thinking about using I2C to communicate between the MCU and the sensors on the sensor array, but I'm not sure how well I2C would work at this distance and if it would even be fast enough.

SPI seems to be big a no no in terms of distance.

Other interfaces that could potentially work is CAN and RS485, though I've never used either of them before. I've dug deeper into using CAN and while it looks like it could work well, it also seems that it might be a bit "overkill" for what I need.

So what serial communication interface could work best in this sort of scenario?

Any help is appreciated.

\$\endgroup\$
  • 2
    \$\begingroup\$ 8Hz is extremely slow. You can use pigeons for it.... \$\endgroup\$ – Eugene Sh. Feb 15 '18 at 19:37
  • \$\begingroup\$ What does your sensor array consist of? If they are I2C or SPI might as well just use that. Or depending on your requirements and environment just read the analog values straight from the sensors... \$\endgroup\$ – Wesley Lee Feb 15 '18 at 19:39
  • \$\begingroup\$ 4-20mA current loop? Really depends what the sensors are. \$\endgroup\$ – τεκ Feb 15 '18 at 19:49
  • \$\begingroup\$ For just 4 sensors and 2m distance I would consider direct analogue connection and no communications bus if the sensors and controller can talk nicely to each other. A DE9 connector will support a common ground (or shield) and two signals for each sensor. A 5pin DIN connector will support a common and one signal each. Your electrical environment may dictate more elaborate options but direct connection would be simple. \$\endgroup\$ – KalleMP Feb 15 '18 at 19:53
1
\$\begingroup\$

You did not say how much data each sensor is producing and what is the environment (next to a big motor?). It may turn out that I2C will simply work if you don't have much EMI from outside.

There are interface standards for short (cheap and easy) distances and longer distances (more expensive and more complex). The classical long distance standards are certainly RS-485 and CAN.

In your scenario, if you don't want to use CAN or RS-485 you could use perhaps SPI with RS-422 drivers, so that each line (SCK, MOSI, CS) is transmitted as a differential pair. It will be as robust as RS-485, will not require another MCU on the sensor board, but will require more signal wires.

If you can afford a small, cheap, basic MCU on the sensor board, then you could easily use RS-485.

\$\endgroup\$
  • 2
    \$\begingroup\$ I would vote for RS-232 as it is easier to debug. Or even TTL levels will work if wired properly. 1m is not a long distance. \$\endgroup\$ – Eugene Sh. Feb 15 '18 at 19:56
0
\$\begingroup\$

4 sensors at 8Hz is something like 1 kbit/s, assuming 32-bit readings. A simple 5V UART will work with no problems across several meters at such baud rates.

SPI can also be used directly if your sensors allow arbitrarily slow data rates. Slow down your signals (using an RC filter) at the transmitter and regenerate fast edges using Schmitt triggers at the receiver, if show edges pose a problem.

\$\endgroup\$
  • \$\begingroup\$ D'you mean a UART at TTL/LVTTL or a UART at RS232? \$\endgroup\$ – TonyM Feb 15 '18 at 21:22

Your Answer

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

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