How to connect RS485 sensor with other sensors

Thread Starter

fsq

Joined Jul 1, 2018
8
Hi. I'm planning to make some project which involves different sensors like triangulation sensor, accelerometers, gyroscopes, odometer. I'm looking for an advice how to wire everything together. I've got couple of Arduino boards and some experience with Arduino. I've already bought MPU-9250 modules (accelerometer, gyroscope, magnetometer) which communicate via I2C, so here is a simple thing (I2c and Arduino). I wonder how to connect triangulation sensor which I don't have yet. They use RS485/RS232/CAN/Ethernet or analog (4-20mA, 0-10V). I have to choose interface and I've chosen RS485. I believe that connecting via RS will be the simplest, and 485 is better than 232, am I right ?

Question is, how to perform calculation (I need text data on pc) ?
- Connect everything to Arduino, perform calculation in Arduino and send data to PC or
- Connect only MPU-9250 to Arduino and send data to pc, connect RS485 via USB directly to pc, and perform calculations in some way on pc ?

I'm aware that in both cases additional converters are necessary. I don't have experience with RS, for what I read I need to learn some about Modbus:)
 

MrChips

Joined Oct 2, 2009
30,712
RS-485 is industrial strength communications interface intended for long distances in harsh environments. You might not need it.

The interface will depend on what the individual modules support. The first thing is to read up on the module and discover how it is intended to communicate with a controller, both from the physical connection and the data format.

Here is a list of common modes of communication:

4-20mA current loop
Parallel
UART (including TTL, RS-232, RS-485, RF)
SPI
SCI
I2C
1-wire

You can convert from one mode to another by employing a local controller. For example, you can convert any module to UART interface by letting a small MCU do the conversion. By doing so, you can create your own protocol and make each module addressable with a unique device address.

1-wire interface has the advantage in that it requires a single bus wire (plus ground) connection that goes to all devices.

MODBUS may be overkill though you might learn something by following the data formatting and protocol.
 

MrChips

Joined Oct 2, 2009
30,712
Wow, thanks for the information. I couldn't have had an answer for this. You explained it really well! I am liking how well informed the members are in this forum!
Welcome to AAC!

Thanks for the endorsement. Simply, we've been there, done that, seen it.
 

Thread Starter

fsq

Joined Jul 1, 2018
8
The interface will depend on what the individual modules support. The first thing is to read up on the module and discover how it is intended to communicate with a controller, both from the physical connection and the data format.
They use RS485/RS232/CAN/Ethernet or analog (4-20mA, 0-10V). I have to choose interface...
So, if not RS485/MODBUS then what ?
 

MrChips

Joined Oct 2, 2009
30,712
You have to examine the requirements of each device.
Make a list of all your devices.

Itemize:

1) Power requirements, voltage, current
2) Type of interface supported
3) Data format and protocol, e.g. is the data one-way or two-way?
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
They use RS485/RS232/CAN/Ethernet or analog (4-20mA, 0-10V). I have to choose interface and I've chosen RS485. I believe that connecting via RS will be the simplest, and 485 is better than 232, am I right ?
I don't have experience with RS, for what I read I need to learn some about Modbus:)
Using the UART module, the choice between RS232 and RS485, the driver IC for the latter requires less components than the RS232.
If the triangulation sensor does not require anything in the way of set protocol you can make up a simple one rather than tied to the Modbus format, but this will depend on whether there is any constraints or requirements of the sensor.
Do you have the spec sheet on the sensor?
Modbus is fairly easy to use.
Max.
 

MrChips

Joined Oct 2, 2009
30,712
The RF603 User's Manual defines a typical industrial strength communications interface and protocol that can be adapted to:

RS-232
RS-485
Ethernet
4-20mA
CAN
MODBUS

Pick whatever is needed.

Do you want to use the same interface for all devices? I shouldn't think so.
You can mix and match the interface to suit the device and the resources of the master controller.
As I said, make a list of all your devices, interface options and match it with the resources of the master controller. All devices are regarded as "slave" devices.

Whether you are implementing one of a kind or industrial OEM makes a difference.
In the later case, it makes sense to make all devices RS-485 compatible.
 

Thread Starter

fsq

Joined Jul 1, 2018
8
I'm implementing "one of a kind"

As I've written I already have MPU9250 boards which communicates via I2C. I'm gathering data from these sensors using Arduino board (I didn't see I2C to USB converters).

I don't know what to do with triangulation sensors, connect to Arduino or directly to PC ? Both type of converters (RS485 to USB and RS485 to TTL) are easily available.
 
Top