- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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
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.
- Related Articles
- Difference between hardware serial and software serial in Arduino
- Serial Plotter in Arduino
- View Serial Output in Arduino
- Serial Filtering Library in Arduino
- Stop Autoscroll in Serial Terminal in Arduino
- Read values sent by Serial Monitor to Arduino
- How to Use a Serial Monitor with Arduino IDE 2.0?
- How to change the baud rate of the Serial Monitor in Arduino?
- Calculation of Serial and Non-Serial Schedules in DBMS
- Serial Killings in India
- What is Serial Transmission?
- Serial Line Internet Protocol (SLIP)
- Serial Killer: Meaning and Types
- Arduino Uno vs Arduino Leonardo
- Arduino Uno vs Arduino Micro
