How to use multiple Software Serial in Arduino nano?

Erick Luz picture Erick Luz · Mar 2, 2016 · Viewed 20.4k times · Source

I'm working on a project that needs to use at least 2 serial communications (2 TXs and RXs) alternately and in different pins. I wonder if it is possible to program the Arduino Nano for this task. I conducted research on the internet and saw that the processor that hardware (ATmega328) has only one UART, and by default this Arduino has dedicated 1 pin TX and one RX, but also saw that it would be possible in the Arduino UNO, which has the same processor, work with 2 serial communications using the SoftwareSerial library, it would be possible that the Arduino Nano?

Answer

Faizullah Khan picture Faizullah Khan · Mar 3, 2016

Yes you can use Software Serial library for multiple Serial communication.

As declared by https://www.arduino.cc/en/Main/ArduinoBoardNano using this method:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX
SoftwareSerial mySerial1(8, 9); // RX, TX