Using SoftwareSerial.h long term

I am relatively new to Arduino and computer hardware in general. I currently am making an environmental monitor with an Arduino Uno R4 Minima that I want to connect to a LoRa module and send that data to my company's LoRaWan gateway. I also want to have a touch screen display to display the information directly from the device. The issue I have is that both components want to use the RX and TX pins for communication.

I'm familiar with the SoftwareSerial library, but as this is a device that I'm making for my company, I'm concerned with whether this is a good solution long term. I've seen the idea of using a multiplexer instead, which if I understand would be a good deal more complicated. If anyone cares to know what the particular components are, the LoRa module is the Grove-Wio-E5 Wireless Module, and the display is a Nextion NX4832F035.

Any advice with how to approach this would be appreciated, if SoftwareSerial would be just fine, or if another solution would be better.

Thanks!

If you build your system around software serial and it works the way you want then there's no issue whether you use it for 10 minutes or 10 years.

1 Like

It works at 9600 baudrate, so I don't see softwareserial necessarily a problem.
Give it a try, if it works, it will work in future.
On the other hand the chip has i2c and spi al well, you just have to pick a module that has those pins.

1 Like

Then you know that it has baud rate limitations and cannot send and receive at the same time and one one can receive at a time.
Will that be a problem with the LoRa module or dispaly or the libraries they use?

1 Like

Seedstudio has demo for Wio-e5 with R4 and softwareserial.

1 Like

That's very helpful thank you

You can create extra hardware serial ports. See e.g. Third Serial Port on Uno R4 (Serial2). For you to study what will be possible.

More search results: arduino r4 minima serial ports - Google Search

1 Like

Okay, so according to the Minima datasheet:

USB Serial & UART

The UNO R4 Minima board features two separate hardware serial ports.

  • One port is exposed via USB-C®, and
  • One is exposed via RX/TX pins.

This is one of the few things that are distinctly different from UNO R3 to UNO R4, as the UNO R3 only features one hardware serial port, that is connected to both the USB port and the RX/TX pins on the board.

In theory, if I get this USB to Serial converter, I could just plug the NX4832F035 into the USB slot on the Arduino, right?

serial-to-usb converters require a USB host (usually a PC). Can the Minima act as a host?

I think that you are starting to make your life difficult.

Here I was thinking I was making my life simpler :sweat_smile:

That is something I did not know was necessary, so perhaps this wouldn't be the way to go. At least I now know there are a few different options on how I can try to approach this.

So keep it simple. There's no reason to think sw serial doesn't work with E5 and R4.
Otherwise go with this and you can experiment all the communication methods available...

1 Like

Well, there's the potential that at some point you'll want to upgrade to a different Arduino board that won't support SoftwareSerial. This has happened to "some" people upgrading from AVR boards to ARM boards. In theory, the ARM boards have extra hardware serial ports that should usually make the use of softwarSerial unnecessary, but sometimes those won't be on the "right" pins, and would require changing the source code in perhaps-mysterious ways.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.