Software Serial In Arduino - Tutorialspoint

  • Home
  • Whiteboard
  • Online Compilers
  • Practice
  • Articles
  • AI Assistant
  • Jobs
  • Tools
  • Corporate Training
  • Courses
  • Certifications
Menu Categories Login
  • Switch theme
  • SQL
  • HTML
  • CSS
  • Javascript
  • Python
  • Java
  • C
  • C++
  • PHP
  • Scala
  • C#
  • Tailwind CSS
  • Node.js
  • MySQL
  • MongoDB
  • PL/SQL
  • Swift
  • Bootstrap
  • R
  • Machine Learning
  • Blockchain
  • Angular
  • React Native
  • Computer Fundamentals
  • Compiler Design
  • Operating System
  • Data Structure and Algorithms
  • Computer Network
  • DBMS
  • Excel
Technical Questions and Answers
  • Data Structure Data Structure
  • Networking Networking
  • RDBMS RDBMS
  • Operating System Operating System
  • Java Java
  • MS Excel MS Excel
  • iOS iOS
  • HTML HTML
  • CSS CSS
  • Android Android
  • Python Python
  • C Programming C Programming
  • C++ C++
  • C# C#
  • MongoDB MongoDB
  • MySQL MySQL
  • Javascript Javascript
  • PHP PHP
  • Selected Reading
  • UPSC IAS Exams Notes
  • Developer's Best Practices
  • Questions and Answers
  • Effective Resume Writing
  • HR Interview Questions
  • Computer Glossary
  • Who is Who
Software Serial in Arduino ArduinoSoftware & CodingHardware

The SoftwareSerial library was developed to ensure that any pins of Arduino can exchange Serial data with other peripherals, like GNSS receivers, using software. Arduino Uno, for example, has only one HardwareSerial port (pins 0 and 1), which is connected to the USB via the USB to UART conversion chip. Thus, if you have any other peripheral that requires serial communication, in the absence of SoftwareSerial, you’d have to do away with USB Serial communication.

SoftwareSerial has some limitations −

  • If you are using multiple SoftwareSerial ports, only one can receive data at a time

  • Speeds can be up to a maximum of 115200 bps

Other limitations of this library, specific to some Arduino boards, can be found here.

The SoftwareSerial library is included in Arduino IDE Versions 1.0 and above, and you don’t need to install it separately. Defining the Software Serial is very straightforward. An example is shown below −

#include <SoftwareSerial.h> SoftwareSerial mySerial(10, 11); // RX, TX

As you can see, you need to create a SoftwareSerial object using two arguments − the RX pin and the TX pin. The other functions are similar to Serial. For example,

Serial.begin(9600) translates to mySerial.begin(9600)

Serial.println("Hello World") has the equivalent mySerial.println("Hello World") and so on.

You are encouraged to go through the examples that come in with the SoftwareSerial library. They can be found in File → Examples → SoftwareSerial.

Yash Sanghvi Yash Sanghvi Updated on: 2021-07-30T16:06:40+05:30

8K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started Print Page Previous Next Advertisements

Tag » Arduino Newsoftserial.h