I am trying to use several (four) software-based serial ports to talk to different peripheral hardware. However, I am unable to receive data through the SoftSerial when using more than one software serial port.

I tested each pair of pins be defining it to the first port. All pairs are working as desired. In addition, I am only interested in bridging/piping from a software serial port to the hardware serial (for debugging reasons).

My code is as follows:

#include <stdint.h>
#include <SoftwareSerial.h>

#define SOFT_SERIAL_A_RX        5
#define SOFT_SERIAL_A_TX        6
#define SOFT_SERIAL_B_RX        7
#define SOFT_SERIAL_B_TX        8
#define SOFT_SERIAL_C_RX        9
#define SOFT_SERIAL_C_TX        10
#define SOFT_SERIAL_D_RX        11
#define SOFT_SERIAL_D_TX        12

#define SERIAL_BAUD_RATE        9600

SoftwareSerial softwareSerials[] = {
    // Unable to receive data on first software serial when un-commenting following lines.
    // All pins are working when declaring each pair for first software serial (tested pins by doing this)
    // SoftwareSerial(SOFT_SERIAL_B_RX, SOFT_SERIAL_B_TX),
    // SoftwareSerial(SOFT_SERIAL_C_RX, SOFT_SERIAL_C_TX),
    // SoftwareSerial(SOFT_SERIAL_D_RX, SOFT_SERIAL_D_TX)
const uint8_t numberSoftwareSerials = sizeof(softwareSerials)/sizeof(*softwareSerials);

void initHardwareSerial()

void initSoftwareSerials()
    for(uint8_t i=0; i<numberSoftwareSerials; i++) {

void setup()

void loop()
  // Only one software serial can be used (receive/transmit) at once.
  // So just using a single software serial port (first element from array)
  if (softwareSerials[0].available()) {
  if (Serial.available()) {


How can I narrow down the issue of being unable to receive when defining several serial ports? If there is no suitable solution I might switch to an Arduino Mega with its four hardware ports (would need only one additional software serial in that case), but an Arduino Nano is strongly preferred due to smaller footprint.

1 Answer 1


You cannot receive on more than one SoftwareSerial port. It's sad, but that's the way it is.

You can manually select which port you are listening to at any time with the softwareSerials[x].listen() function, but only one can ever listen at a time.

SoftwareSerial is a fudge at best and should only be used for one port and even then only if you really have to.

  • Thanks for this hint. After some more searching around the Internet in the meantime, I finally found a link to the docs where '.listen()' is used: arduino.cc/en/Tutorial/TwoPortReceive
    – albert
    Commented Sep 16, 2018 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.