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.
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.
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?
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?
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...
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.