4 serial connections on arduino uno

Hello.

I'm working on a project that needs 4 serial connectoins. are there any way to do this on an uno, or do I need the mega?
I would really like to use the uno to reduce the size.

Software serial may work, but I'm not sure how many serial connections you are limited to.

You can use softSerial library but only one can send/receive at the same time. Furthermore there is a practical upper limit of the baud rate of 57600.
What baud rates do you need?
What is the expected throughput/second? in total /per port?

When using a MEGA you get 4 Hardware serials which might make live easier

Also very important to consider do you need to both send and recieve on all ports ?

I haven't used it myself, but the AltSoftSerial library seems to offer some advantages over the standard SoftwareSerial, if you need to use multiple ports concurrently.

A discussion that might be of interest.

http://forum.arduino.cc/index.php?topic=175851.msg1305132#msg1305132

Can always add external UARTs, such as thus Dual UART

SC16IS752_SC16IS762_SPI_dual_UART.pdf (292 KB)

Do they all need to be active at once? You could use a multiplexer to switch the input/output pins around.

If they are all active at once I doubt SoftwareSerial would do it for you. What CrossRoads suggested would work with an extra chip or two.

Hi there,
yes, another one who know just nothing about it.......... ME! :grin:

I got 12 'probes' to measure PH, ORP, DO in my experimental Aquaponic system......
They are all from Atlas Scientific where it is possible to download the code for Arduino to be used to read on my
Uno or Mega

code for UNO https://www.atlas-scientific.com/_files/code/Arduino-sample-code-EZ-COM.pdf

Code for Mega https://www.atlas-scientific.com/_files/code/Arduino-sample-code-EZ-COM-MEGA.pdf

Now here is the first question:
Why when I use the Code for the Arduino UNO and the relative board, all works quite fine :astonished:
BUT
when I upload the code (always given by Atlas Scientific)for the Mega, I get different errors like: =(

'Serial3 was not declare in this scope
EZ_com_mega_My_version_3_and_2.ino: In function 'void setup()':
EZ_com_mega_My_version_3_and_2:27: error: 'Serial3' was not declared in this scope
EZ_com_mega_My_version_3_and_2:28: error: 'Serial2' was not declared in this scope
EZ_com_mega_My_version_3_and_2.ino: In function 'void serialEvent3()':
EZ_com_mega_My_version_3_and_2:43: error: 'Serial3' was not declared in this scope
EZ_com_mega_My_version_3_and_2.ino: In function 'void serialEvent2()':
EZ_com_mega_My_version_3_and_2:48: error: 'Serial2' was not declared in this scope
EZ_com_mega_My_version_3_and_2.ino: In function 'void loop()':
EZ_com_mega_My_version_3_and_2:57: error: 'Serial3' was not declared in this scope
EZ_com_mega_My_version_3_and_2:63: error: 'Serial2' was not declared in this scope
'

SECOND QUESTION:
If I can get the Mega working with one probe,
How can I add all the remaining probes to it?
I don't need to read all at the same time and not even in fast repetition, say that a reading every 5-10 sec is more than enough.

Thanks for all your attention and time.

Looking forward to get illuminated. :cold_sweat:

Best regards
Andrea

Ok,
The found the problem with Serial3 not declared!
My mistake of course!
I dint change the Board Type from Uno to Mega in the 'Tools' menu!

Now I am trying to read two probes together but no luck for now......
:wink:

Now I am trying to read two probes together but no luck for now

Roll the dice again. Does that make you feel better? No luck is involved in writing good code. Skill is.