Open links in new tab
  1. The SoftwareSerial library in Arduino enables serial communication on additional digital pins, beyond the default hardware serial ports. This is particularly useful when working with multiple serial devices or when the hardware serial port is occupied for debugging.

    Key Features

    • Allows communication on user-defined pins using software emulation.

    • Supports baud rates up to 115200 bps.

    • Enables multiple software serial ports, though only one can actively receive data at a time.

    Basic Usage

    To use the SoftwareSerial library, include it in your sketch and define the RX (receive) and TX (transmit) pins. Below is an example:

    #include <SoftwareSerial.h>

    // Define RX and TX pins
    const byte rxPin = 2;
    const byte txPin = 3;

    // Create a SoftwareSerial object
    SoftwareSerial mySerial(rxPin, txPin);

    void setup() {
    // Initialize the software serial port
    mySerial.begin(9600);
    Serial.begin(9600); // For debugging
    }

    void loop() {
    // Send data
    mySerial.println("Hello, Serial!");

    // Check for incoming data
    if (mySerial.available() > 0) {
    char received = mySerial.read();
    Serial.print("Received: ");
    Serial.println(received);
    }

    delay(1000);
    }
    Copied!
  1. SoftwareSerial Library | Arduino Documentation

    Create an instance of a SoftwareSerial object. Multiple SoftwareSerial objects may be created, however only one can be active at a given moment.
    Available

    Get the number of bytes (characters) available for reading from a software serial port. This is data that has already arrived and stored in the serial receive buffer.

    Begin

    Sets the speed (baud rate) for the serial communication. Supported baud rates are: 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 31250, 38400, 57600, and 115200 bauds.

    Overflow

    Tests to see if a SoftwareSerial buffer overflow has occurred. Calling this function clears the overflow flag, meaning that subsequent calls will return false unless another byte of data has been received and discarded in the meantime. The Software…

    Peek

    Return a character that was received on the RX pin of the software serial port. Unlike read(), however, subsequent calls to this function will return the same character. Note that only one SoftwareSerial object can receive incoming data at a time (selec…

  2. Arduino - SoftwareSerial | Arduino Tutorial

    Learn how SoftwareSerial sensor works, how to connect SoftwareSerial to Arduino, how to program Arduino step by step. The detail instruction, code, wiring …

  3. ArduinoCore-avr/libraries/SoftwareSerial/examples

    The Official Arduino AVR core. Contribute to arduino/ArduinoCore-avr development by creating an account on GitHub.

  4. Arduino Software Serial User Guide - Seeed Studio Wiki

    Jan 16, 2023 · The Arduino hardware has the built-in support for Serial communications on pins 0 and 1 (Hardware Serial) but in some circumstances such as when these pins are already in-use or you need …

  5. Software Serial in Arduino - Online Tutorials Library

    The SoftwareSerial library was developed to ensure that any pins of Arduino can exchange Serial data with other peripherals, like GNSS receivers, using software.

  6. Arduino SoftwareSerial: Master Multiple Serial Ports

    Dec 2, 2025 · Discover how to use Arduino SoftwareSerial to create multiple serial ports on Uno or Nano. Connect GSM and Bluetooth modules, simulate in Proteus, …

  7. People also ask
    Loading
    Unable to load answer
  8. SoftwareSerial Library – Arduino Developer

    Example Usage #include <SoftwareSerial.h> SoftwareSerial mySerial(8, 7); // RX=pin #, TX=pin # //This also works: //SoftwareSerial mySerial(PA2, PA3); // RX=pin #, TX=pin # void audio_init (void) { //Set the …

  9. Software Serial Arduino: Everything You Need to Know

    Jun 21, 2024 · By understanding the concepts and techniques presented in this article, you can confidently integrate Software Serial Arduino into your projects …

  10. Adding More Serial Ports to your board. - Arduino

    Jul 21, 2022 · With the help of the SoftwareSerial library, it is possible to create additional software serial ports on your Arduino board.

  11. Demystifying the Arduino SoftwareSerial Library: An …

    Dec 27, 2023 · The Arduino SoftwareSerial library enables tremendously flexible serial communications, unleashing the potential of those unused Arduino pins. …