Arduino Communication with Several Instruments

Hello,

I'm relatively new at using Arduino technology, so my apologies if this is a simple question.

I currently have a project that requires me to use an Arduino to collect data from three instruments. Two of these instruments send out data via RS-232, while the third returns analog data that must be converted into digital. All three of these instruments must be connected to the Arduino, which has to take in the data and store them in one retrievable file (i.e. the data from all 3 instruments must be saved together, and are saved as the data comes in).

I'm currently thinking of getting a data logger shield as well as a few RS-232 shields as a way to get started. However, I'm really new to this, so I really don't know if this is a good approach or if there is a better way.

If someone can think of a way to accomplish this and outline the basics of what I can do, that would be extremely helpful. Thank you for your time!

If you use the SoftSerial library, you can connect any pins on your arduino the the RS-232 instruments. Depending on the range of the analog input, you can either use one of the analog pins on the arduino to read the value (0-5V) or some external A/D module that talks to your arduino

Do the serial devices send data on demand, or just when they feel like it? If the latter, then you can't have two instances of software serial listening at the same time, which may cause yu problems, and you should consider using an Arduino with more than one USART.

I would suggest an Arduino Mega which has 3 spare hardware serial ports How fast is data being transmitted ? how much data (bytes) in total? what are you thinking of logging the data too? e.g. a USB flash stick?

The two serial devices send data on their own (e.g. once every few seconds). The data isn't that large, but it just needs to be retrievable somehow (like with a card or USB).

I'm assuming that the Mega is the way to go, then. Does the SoftSerial library allow me to avoid having to get an RS-232 shield?

Thanks you all for the help!

ajzwu: Does the SoftSerial library allow me to avoid having to get an RS-232 shield?

Nope.

RS-232 voltage levels, remember???

.

ajzwu: I currently have a project that requires me to use an Arduino to collect data from three instruments. Two of these instruments send out data via RS-232, [u]while the third returns analog data that must be converted into digital.[/u] All three of these instruments must be connected to the Arduino, which has to take in the data and store them in one retrievable file (i.e. the data from all 3 instruments must be saved together, and are saved as the data comes in).

What is the analog signal, current loop, voltage level? What are the specs on all these instruments, data rate etc etc? Thanks.. Tom.. :)

I am not even sure why the OP is using the Arduino.

Download and install Visual Basic .NET Community; it's free. Buy three USB-RS232 adapters. Write program to query and obtain data from instruments. Convert data as required. Write to data file on hard drive.

It is really very simple. I've done it.

.

ieee488: I am not even sure why the OP is using the Arduino.

Download and install Visual Basic .NET Community; it's free. Buy three USB-RS232 adapters. Write program to query and obtain data from instruments. Convert data as required. Write to data file on hard drive.

if the OP does not know VB there are plenty of alternatives on on a PC, e.g. C++ or C# using Visual Studio or Java using jSerialComm (runs on Windows, Linux, Mac, Raspberry PI, etc) then use a Nano to acquire the analogue input for the PC

ieee488: Buy three USB-RS232 adapters.

Does anyone else see the the irony in this, given the poster's handle? :D

TomGeorge: What are the specs on all these instruments, data rate etc etc? Thanks.. Tom.. :)

These are the three instruments:

RS-232 Compatible: https://www.dropbox.com/s/uhmhce4d4gegx15/Reed%20Scientific%20SPL-%20Model%20SD-4023-manual.pdf?dl=0 https://www.dropbox.com/s/eafy0hpkhx7wz59/GT521_particle_counter.pdf?dl=0

Analog: https://www.dropbox.com/s/l0g95s4ngatlqn9/Carbon%20Dioxide%20Sensor.pdf?dl=0

I'm probably going to get an Arduino Mega with a data logger shield (like https://www.adafruit.com/product/1141), as well as two RS-232 shields (like https://www.seeedstudio.com/RS232-Shield-p-1910.html) for the two RS-232 instruments. I think this is the way to go if I use an Arduino.

I wouldn't use shields for the RS232; to much hassle to prevent wiring problems. I would use something like SparkFun RS232 Shifter - SMD. Make sure that the chosen product supports hardware handshake lines (if required by the instruments).

sterretje:
I wouldn’t use shields for the RS232; to much hassle to prevent wiring problems. I would use something like SparkFun RS232 Shifter - SMD. Make sure that the chosen product supports hardware handshake lines (if required by the instruments).

I’ve never heard of those before… just to make sure, they take the RS232 output and convert it into TTL format, which can be read in by the Arduino, correct?

TomGeorge:
What are the specs on all these instruments, data rate etc etc?
Thanks… Tom… :slight_smile:

Forgot in the previous post, but here are some data samples that the Arduino should store:

From the sound level meter (RS232):

From the particle counter (RS232):

From the CO2 meter (analog):

data1.PNG

data3.PNG

ieee488: I am not even sure why the OP is using the Arduino.

Download and install Visual Basic .NET Community; it's free. Buy three USB-RS232 adapters. Write program to query and obtain data from instruments. Convert data as required. Write to data file on hard drive.

It is really very simple. I've done it.

horace: if the OP does not know VB there are plenty of alternatives on on a PC, e.g. C++ or C# using Visual Studio or Java using jSerialComm (runs on Windows, Linux, Mac, Raspberry PI, etc) then use a Nano to acquire the analogue input for the PC

Forgot to mention, but this isn't going to be done on a PC. These instruments will be used to collect data outside (on a moving vehicle), so a computer would be infeasible to collect the data. I am using an Arduino since it seems to be a feasible option that would work (since it's small enough to be stored along with these instruments).

ajzwu: Forgot to mention, but this isn't going to be done on a PC. These instruments will be used to collect data outside (on a moving vehicle), so a computer would be infeasible to collect the data. I am using an Arduino since it seems to be a feasible option that would work (since it's small enough to be stored along with these instruments).

you could use a small laptop or tablet or even a raspberry Pi and power it from the vechicle battery

horace: you could use a small laptop or tablet or even a raspberry Pi and power it from the vechicle battery

Thanks for the input! I'll definitely go and look at that.

One more question, now that I thought of it:

Looking at this RS232 shield as an example: |500x375

There is only one RS232 port on here. Is there a way to obtain one with multiple RS232 ports, for multiple instruments? The researcher I'm working for wants something like this, where multiple RS232 devices can be connected to the same device.

never seen a RS232 to TTL with two ports but worth looking on EBAY - try a search on rs232 to ttl

sterretje: I wouldn't use shields for the RS232; to much hassle to prevent wiring problems. I would use something like SparkFun RS232 Shifter - SMD. Make sure that the chosen product supports hardware handshake lines (if required by the instruments).

This earlier comment is not quite valid; you can select any two pins when using a board with the Uno form factor (depending on the library used). But when using the additional hardwareSerials on a Mega, you will have to route manually using wires to the headers on the shield.

ajzwu: I've never heard of those before... just to make sure, they take the RS232 output and convert it into TTL format, which can be read in by the Arduino, correct?

Yes, read the spec ;)

ajzwu: There is only one RS232 port on here. Is there a way to obtain one with multiple RS232 ports, for multiple instruments? The researcher I'm working for wants something like this, where multiple RS232 devices can be connected to the same device.

if you use a laptop there are USB-RS232 interfaces with multiple connectors, e.g. an EBAY search for usb rs232 twin or usb rs232 multi with show interfaces with 2 and 4 RS232 ports. you could then write GUI based software to communicate with such devices using Visual Studio (C++, C#, VB), Java, Matlab, Labview, etc and display results graphically

Thank you all for the input! However, I think I may have asked too broad of a question, since I'm getting so many different options.

It would be most helpful right now to get an idea of how to get the Arduino to communicate with two RS232 devices at once. I'm currently reading about RS232 to TTL converters (https://www.seeedstudio.com/RS232-to-TTL-Converter-Module-p-1684.html), so I might get a few of those and a MAX232 (like this: http://tiny.cc/zxs6ty).

Is this a good way to go?