user44971: I am trying to connect Bluetooth, GSM and GPS to the ATMega328P, but since it has only 1 RX and 1 TX, can I use the digital pins of ATMega328P as RX/TX pins.

user19409: It sounds like you are after the SoftwareSerial library.

The SoftwareSerial library has been developed to allow serial communication on other digital pins of the Arduino, using software to replicate the functionality (hence the name "SoftwareSerial"). It is possible to have multiple software serial ports with speeds up to 115200 bps. A parameter enables inverted signaling for devices which require that protocol.

Although, SoftwareSerial does come with limitations. The major one is that only one serial port can receive data at a time.

user42539: Sounds like you need something with 4 hardware serial ports. 2560 processor.

44971: <p>I am trying to connect Bluetooth, GSM and GPS to the ATMega328P, but since it has only 1 RX and 1 TX, can I use the digital pins of ATMega328P as RX/TX pins.</p>
 19409: <p>It sounds like you are after the <a href="https://www.arduino.cc/en/Reference/SoftwareSerial" rel="nofollow noreferrer">SoftwareSerial</a> library.</p>

<blockquote>
  <p>The SoftwareSerial library has been developed to allow serial communication on other digital pins of the Arduino, using software to replicate the functionality (hence the name "SoftwareSerial"). It is possible to have multiple software serial ports with speeds up to 115200 bps. A parameter enables inverted signaling for devices which require that protocol.</p>
</blockquote>

<p>Although, SoftwareSerial does come with limitations. The major one is that only one serial port can receive data at a time.</p>
 42539: <p>Sounds like you need something with 4 hardware serial ports. 2560 processor.</p>
