SoftwareSerial Doesn't Allow Multiple Instances - Workaround?

In the end, this was the ultimate solution: Solid, reliable, no more bruises from banging my head against the wall. :smiley:

In the back of my mind I kinda new some sort of hardware switch would be required, but I was too busy ignoring what many of the more experienced engineers here have been saying, the management of serial communications via software is flaky and unreliable. :smiley:

Wouldn't you know it, I only had two of any kind of transistor, and it's a major overkill but I do have some 2N7002 mosfets here from another project (well, another part of the overall project.) Using almost the same sub-circuits I managed to hack into ADKEY1 and voila . . . . it works to drive three of these players.

I haven't given up entirely on serial connections, it has it's purpose but given the wide variation of Arduino boards, this seems like it will be way more stable (the final project will be driven from a Nano clone.)

What we have below is a Fritzing of the tested and working project with a static mixer for output. I have a 100 watt mini amp that will drive the sounds through a Goodwill subwoofer.

Basic working code of the working project shown in the Fritzing. These "triggers" for the sound will be incorporated with three other events that will fire at the same time.



const int playPin1 = 6;
const int playPin2 = 7;
const int playPin3 = 8;

void setup()
{
  Serial.begin(9600);
  pinMode(playPin1, OUTPUT);
  pinMode(playPin2, OUTPUT);
  pinMode(playPin3, OUTPUT);
  // Allow cards to power up
  delay(3000);
}

// We're just setting static delays for demo only, in the full project there will be randomizers
// within a given range controlled by pots; two other events will fire at the same time.
void loop()
{
  Serial.println("set play 1 pin high " + String(playPin1));
  digitalWrite(playPin1, HIGH);
  delay(100);
  Serial.println("set play pin 1 low " + String(playPin1));
  digitalWrite(playPin1, LOW);
  delay(3000);

  Serial.println("set play 2 pin high " + String(playPin2));
  digitalWrite(playPin2, HIGH);
  delay(100);
  Serial.println("set play pin 2 low " + String(playPin1));
  digitalWrite(playPin2, LOW);
  delay(3000);
  Serial.println("set play 3 pin high " + String(playPin3));
  digitalWrite(playPin3, HIGH);
  delay(100);
  Serial.println("set play pin 3 low " + String(playPin3));
  digitalWrite(playPin3, LOW);

  delay(6000);

}