RS-232 Communication via USB

Quick question...

If I use a USB to Serial Adapter (https://www.amazon.com/KeySpan-High-Speed-Serial-Adapter/dp/B0000510Y4) and connect it to an USB shield (https://www.sparkfun.com/products/9947) for my Arduino, would this allow me to read in data via RS-232 communication?

Thanks!

SparkFun RS232 Shifter - SMD - PRT-00449 - SparkFun Electronics is what I would use.

Why USB? All you need is a RS-232 to TTL Serial converter (as suggested), which you connect to RX/TX for use with Serial.

DrDiettrich:
Why USB? All you need is a RS-232 to TTL Serial converter (as suggested), which you connect to RX/TX for use with Serial.

I have two RS-232 instruments, so I'm planning on using a USB that has two RS-232 ports, like this:

Is there a better way?

I don't think that you can use that converter with an USB client, like Arduino Uno. Most probably it can be used with a PC only.

If you need multiple serial lines, a Mega has 4 Serial devices in hardware.

ieee488:
SparkFun RS232 Shifter - SMD - PRT-00449 - SparkFun Electronics is what I would use.

DrDiettrich:
I don't think that you can use that converter with an USB client, like Arduino Uno. Most probably it can be used with a PC only.

If you need multiple serial lines, a Mega has 4 Serial devices in hardware.

Okay, so I should instead get an Arduino Mega and two of these for the two RS-232 devices? SparkFun RS232 Shifter - SMD - PRT-00449 - SparkFun Electronics

Thanks!

I don't understand why you even need an Arduino if all you are doing is "reading in data" from the instrument.

I have done this. No Arduino needed!

.

ieee488:
I don't understand why you even need an Arduino if all you are doing is "reading in data" from the instrument.

I have done this. No Arduino needed!

Not just reading in data... the data must be stored onto an SD Card, and the instruments will be collecting data outside. How would you do this without an Arduino?

zhukm29:
Not just reading in data... the data must be stored onto an SD Card, and the instruments will be collecting data outside. How would you do this without an Arduino?

Connect instruments to PC.
Query instruments for data.
Write data to file on hard drive.

.

Right, build a data logger with Arduino and SD card.

ieee488:
Connect instruments to PC.
Query instruments for data.
Write data to file on hard drive.

Unfortunately, it would be infeasible for me to connect the instruments to a PC given the environment the testing will be done in. The project I'm working on requires live data, so I don't believe that approach would work.

How "live" should the data be? What has to be done with those data?

RS232 and TTL serial are not the same thing. 5v TTL serial has voltage levels of 5v and 0v, this is what the serial pins and most serial adapters are. RS232 uses +10v and -10v; these will damage arduino or ttl serial adapt34s if connected directly. rs232 <-> TTL serial adapters are cheap and readily available. Max232 is one.

Often ttl serial is referred to as rs232, incorrectly.

(This is in addition to any other concerns - I always remind people who mention “rs232” of this )

DrAzzy:
RS232 and TTL serial are not the same thing. 5v TTL serial has voltage levels of 5v and 0v, this is what the serial pins and most serial adapters are. RS232 uses +10v and -10v; these will damage arduino or ttl serial adapt34s if connected directly. rs232 <-> TTL serial adapters are cheap and readily available. Max232 is one.

Often ttl serial is referred to as rs232, incorrectly.

(This is in addition to any other concerns - I always remind people who mention “rs232” of this )

I’m assuming that just connecting the RS-232 via a USB cord to the Arduino will not work?

I don’t know how to connect two RS-232 devices to an Arduino then. Any help would be appreciated.

DrDiettrich:
How "live" should the data be? What has to be done with those data?

This is the process:

I have two devices that use RS-232 to transmit data. Both of these devices will be attached to an Arduino, which will be reading in the data live and storing it in an SD card or USB (I'm using a data logger shield for this).

These instruments will be placed outside to collect data, and they will be placed in locations where no internet or PC access will be available (so using something small like an Arduino would be best). Both machines will be spitting out data every few seconds or so, and I will have to read the data into a file in the order they come in. So I will have to be communicating with both instruments at once.

I just need to know how I can communicate with both RS-232 data outputs using an Arduino.

Connect each device to a Serial port of the Mega. If a device is true RS-232 a converter is inserted into the line, see brands already mentioned.

DrDiettrich:
Connect each device to a Serial port of the Mega. If a device is true RS-232 a converter is inserted into the line, see brands already mentioned.

Okay, thanks. Just curious, can this be done using an UNO with the SoftwareSerial library?

A SoftwareSerial can be used, but it can have consequences or can be influenced by the remaining software. If you encounter any problems, a test of the software on a Mega, with hardware Serials, will help to spot the trouble maker.

zhukm29:
These instruments will be placed outside to collect data, and they will be placed in locations where no internet or PC access will be available (so using something small like an Arduino would be best). Both machines will be spitting out data every few seconds or so, and I will have to read the data into a file in the order they come in. So I will have to be communicating with both instruments at once.

I just need to know how I can communicate with both RS-232 data outputs using an Arduino.

The environment is good enough for these instruments with RS232 ports to operate but not good enough to have internet or a PC?

How exactly will these instruments be getting power? Solar?

.

ieee488:
The environment is good enough for these instruments with RS232 ports to operate but not good enough to have internet or a PC?

How exactly will these instruments be getting power? Solar?

I believe they are battery powered.