Hi everyone, I'm looking to connect 3 different UART sensors to an Arduino board and I already have an Uno R4 Wi-Fi on hand. I was looking into the SoftwareSerial library to help, but it seems (from perusing this forum), that you can only reliably use one SoftwareSerial port on an Uno R4. Is it more worthwhile to look into purchasing an Arduino Due or Mega?
the mega has four hardware serial ports
one is used for the serial monitor and programming but the other three are available
an alternative could be to use an ESP32 which has two spare hardware serial ports Serial1 and Serial2 and use EspSoftwareSerial for the third
Using MegaCoreX The NanoEvery has 3 hardware serial ports available as well as the usb serial.
You can use D0/D1 , D2/D7 and D6/D3
//pins are defined in megacoreX core files pins.h varients
//#define TX1 D0
//#define RX1 D1
//#define RX2 D2 PIN_PA0
//#define TX2 D7 PIN_PA1
//#define PIN_HWSERIAL3_TX D6 PIN_PF4
//#define PIN_HWSERIAL3_RX D3 PIN_PF5
The Nano Every is a small footprint alternative to the Mega and Due with multiple hardware serial ports.
I looked into the UART of the UNO R4 MINIMA/WIFI. According to the RA4M1 Hardware Manual, there are four Serial Communication Interface (SCI) channels.
And looking at the pins_arduino.h for each one:
In other words, only 1 channel of hardware serial can be used with MINIMA, but 4 channels can be used with WIFI.
In my experience, I have never used anything other than Serial1, but when I look at ArduinoCore-renesas, I see that three hardware serial objects are defined: SerialObj1.cpp, SerialObj2.cpp, and SerialObj3.cpp, so I think these might be usable.
Also, looking at the software serial code, it seems that several GPIO combinations can be used.
I believe the maximum baud rate for software serial is 115200.
Additional Info:
Looking at Arduino.h for UNO R4:
Since NO_USB is defined for UNO R4 WIFI, I think you can use at least only Serial1 , as hardware serial.Serial2, and Serial3
Edit: Serial2 (_UART3_) is connected ESP32-S3-MINI-1-N8 internally.
I typed the keywords "uno r4 serial2 serial3" into the search field of this forum and found several threads.
@KurtE's post looks like it might be helpful.
If you look at Page 4 of the R4 Minima Full Pinout you see there are 3 SCI UARTs in addition to the native USB Serial, but one is located on the SWD/JTAG connector...
This is one more than what is available on the R4 WiFi...
This all seems very helpful, thank you! I think I am confused on how I would define these pins as hardware serial ports?
Sorry but I made a misunderstanding about the core code and pinouts/schematics.
Serial/UART definitions for UNO R4 WIFI are:
| Serial | UART | Pin No. | GPIO | Connection |
|---|---|---|---|---|
| Serial | _UART1_ |
22, 23 | P109, P110 | Serial monitor (internally connected) |
| Serial1 | _UART2_ |
0, 1 | P301, P302 | D0/RX, D1/TX |
| Serial2 | _UART3_ |
24, 25 | P501, P502 | ESP_TXD0, ESP_RXD0 (internally connected) |
It means, on the UNO R4 WIFI, the only hardware serial that can be connected externally is Serial1 (_UART2_).
So, if you want to use hardware serial, you should choose a board recommended by other advisers.


