Serial Port Question

I am in the initial planning stages of a controller for my aquarium, and am currently trying to map out all my pins in Excel before starting to code and wire things up.

I have 4 probes (Atlas Scientific SDS kit) that I would like to use which all connect to a 'stamp' that requires a serial connection to Arduino. I see that the Due has pins RX0-3 and TX0-3, but have read that RX0 and TX0 are used for the USB communication.

From http://arduino.cc/en/reference/serial:

All Arduino boards have at least one serial port (also known as a UART or USART): Serial. It communicates on digital pins 0 (RX) and 1 (TX) as well as with the computer via USB. Thus, if you use these functions, you cannot also use pins 0 and 1 for digital input or output.

This leads me to believe that I can use pins 0 and 1 for serial communication with for example a probe.

The Arduino Due has three additional 3.3V TTL serial ports: Serial1 on pins 19 (RX) and 18 (TX); Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX). Pins 0 and 1 are also connected to the corresponding pins of the ATmega16U2 USB-to-TTL Serial chip, which is connected to the USB debug port. Additionally, there is a native USB-serial port on the SAM3X chip, SerialUSB'.

But then this quote muddies it for me, and I can't tell if I can use pins 0 and 1 or if they are reserved.

So my question is, if I am not using the USB port for anything aside from uploading my code (ie once the controller is complete and attached to the aquarium) can I use all 4 serial ports for my probes?

I do also have a Mega that I will likely be using as a slave device for additional pins, but would prefer to have all of the probes handled through 1 board.

Sorry for the thin details, I really don't have much else at this point. Hope my question makes sense.

As far as pinouts, you might like this...

Source:
http://forum.arduino.cc/index.php/topic,132130.0.html

I don't think you can use the UART0 port, given is already connected to another UART device which does the USB to UART conversion.

I don't think SoftwareSerial is supported by the Due yet, otherwise you could add more Serial inputs.

May I ask what is your ultimate goal? I have a feeling there may be an easier way than to plug all these devices to one Arduino...

Thanks. I have been studying that pinout diagram.

My ultimate goal is to utilize 4 probes for reading and graphing the salinity, pH, ORP and DO in my saltwater aquarium. Each of the 4 probes came with a small circuit called a "stamp" which has both a TX and RX pin for connecting to an Arduino.

In other words, all you want to do is log this data so you can later graph it?
If this is the case then I would use the Arduino mega you have available and use softwareserial for the extra UART. Log the data to an SD card etc. An even easier way would be to use USB to TTL adapters, all four to a PC, log all streams from terminal windows to text files, no programing required.

Do your devices have more than the TX/RX serial pins? Using other RS232 signals like clear to send, data set ready, etc. you could use a small external circuit to tell each device to wait and you'd poll each serial device in turn, using only one serial port and a control lines.

Of course someone completing a SoftwareSerial library would be the best solution.

The SAM3X actually has 5 serial ports, the UART used for programming and 4 USARTs, for some reason the Arduino team decided not to support USART2, but it's there and the pins are available on D52 and D62(A11).


Rob

accordianthief:
So my question is, if I am not using the USB port for anything aside from uploading my code (ie once the controller is complete and attached to the aquarium) can I use all 4 serial ports for my probes?

I believe you can. Use Serial1, Serial2, Serial3 for pins 14-19, and Serial for 0,1. Pins 0,1 will still drive the USART, but thats Ok as long as you are not connected to the USB.

And why not use SerialUSB as the 4th one? Answer: Because its too flaky for two way comms! See other posts in this forum...

Ugly workaround that worked for me: Program/debug via the Native port, and use the programming port for comms.