Best board for multiple serial devices?

Hi folks,

A couple of serial questions:

  1. I’d like to interface a serial GPS module to a serial LCD display. Can that be done easily with a Nano or Uno (which I have on hand) or must I order-in something like a Mega?

  2. Can I use a Nano or Uno to just talk to the serial GPS (with no display) but have it feed the NMEA strings back to my computer via the serial monitor function? - or am I out of luck using a Nano or Uno for anything serial whilst still wanting a PC connection?

TIA

Cheers,

Colin

What is your serial LCD display ? Can you give a link to it ?

If you only need 2 serial connections in total then SoftwareSerial works well enough on a Uno or Nano at relatively low speeds. For more serious serial applications use a Mega which has 4 hardware UARTs

If you need multiple Serial connections then the Mega is a good board.

An LCD display with serial connection is not a good choice. Try to find modules with bus interfaces (SPI, I2C…) instead and use serial only with modules far away.

Some SoftSerial library can be used for a second serial connection, but it’s not that fast and reliable.

If you do not use the USB, and take the TX pin into the PC through a MAX232 chip to PC serial port or similar UART interface you can take the RX pin and tie it to the GPS to receive NMEA strings only.

The LCD will use a Motorola 6800 bus which requires 6-11 GPIO or an I2C bus, which requires use of the I2C pins.

If you have the right LCD and GPS, you can choose dual-simplex operation or 1 software serial port and 1 hardware serial port.

A “Nano Every” theoretically has up to 4 uarts.

1 Like

Hi again folks,

Thanks for the speedy replies.

Can of worms opened; the display uses the I2C protocol - does that make things easier?

This is the GPS module; to be honest, I’m new to this and am not sure what protocol it uses:

https://www.aliexpress.com/item/4000484837984.html

I’m hoping to learn how to extract GPS time and display it on the LCD screen this weekend; I have a standard interface LCD but at this stage I’d be happy just to be able to extract the time from the NMEA signal and display it on the PC via the serial monitor (baby steps etc) - but I’ve not worked with serial on Arduino before and have read that the single serial interface on the Nano and Uno (which I have) is already used by the device to communicate with my PC - so I’m not sure if/how it could be used to read the GPS - hence my post.

Your linked module is “not found” but almost any gps receiver from GPS 19x HVS to any g-mouse, will output $GPRMC string by default, which contains date and time. Using any of the NMEA libraries for Arduino, you can parse what you want. It will operate in simplex, receive only.

Thanks.

Not sure why it’s “not found”; I’ve checked it again and it’s working fine this end.

At this stage I’m not particularly worried about tackling the extraction of the data … just the physical interfacing of the devices. I’ve only got a couple of UNOs and a couple of Nanos on-hand - so for now, all I really want to do is connect the GPS module to one of my Arduinos and get it to the point where I can see the NMEA strings on my PC using the serial monitor function - but I still don’t know if it’s possible for a Nano or Uno to do that since it only has 1 serial port and (apparantly) that port is used for Arduino/PC comms.

What are the “serial LCD display” and the GPS module. There is not just one kind of each.

Sure. Use a software serial port to capture what the GPS sends and re-transmit the GPS data with Serial prints to the serial monitor. The following code should print the NMEA sentences to the serial monitor from a GPS TX connected to the Uno pin 4 (RX). GPS RX not connected.

//gps test

#include <SoftwareSerial.h>

SoftwareSerial mySerial(4, -1); // RX, TX

void setup()
{
   // Open serial communications
   Serial.begin(9600);
   Serial.println("Neo6M GPS module test code");
   // set the data rate for the SoftwareSerial port
   mySerial.begin(9600);
}

void loop()
{
   if (mySerial.available())
   {
      Serial.print(char(mySerial.read()));
   }
}

Thanks gF - most helpful.

This is the GPS module: https://www.aliexpress.com/item/4000484837984.html - Perehama reported that it’s not working, but it’s still working fine from my end.

The Display has an I2C interface.

I2C and serial are independent. You should have no problem running I2C and serial together.

Is it a 16x2 or 290x4 I2C character display (1602, 2004). For an I2C LCD display to work, the I2C address and the I2C backpack to LCD pin mapping must be correct. If the library default settings for either or both are not correct the LCD will not work. You can try to figure out the right pin mapping and use an I2C scanner to find the address, but if you install and use the hd44780 library that is done automatically by the library. The library is available in the Library Manager.

The TinyGPS library is good for parsing the data from NMEA sentences.

Brilliant - thanks for that.

I’m a bit confused; my understanding is that I2C is a serial protocol - does it not use the serial pins on a Nano or Uno?

Are you saying that in essence there’s actually 2 serial interfaces on a Nano or Uno - “I2C” and “plain old un-protocol’d serial”?

No

Yes, and SPI too, makes 3

Thanks Bob;

Can more than 1 I2C device be connected to the same interface at the same time?

There are actually 3 types of serial interfaces on an Uno or Nano ( as well as many Arduinos). The UART serial, I2C and SPI. Each of those interface types are independent of each other.

Yes, I2C and SPI are busses. As to I2C, several devices can share the same 2 pins, Each device has its own unique address. With SPI there are 3 pins plus chip selects to the bus and each device will have its own chip select.

Yes, as long as they each have a unique address

Yes, it makes things easier.

Most Arduinos already have at least one UART and a separate I2C interface. If you used an Every or a Leonardo, you’d have Serial1 for the GPS, i2C (“Wire”) for the LCD, and still have “Serial” connected to the PC for debugging/upload… (for Uno or an ordinary Nano, the “Serial” PC connection would need to be shared somehow with the Serial connect to the GPS (or you might get away with SoftwareSerial, but that’s less desirable.)

Arduino Pro Micro. It’s similar to Leonardo but in a small form factor, like Nano. Do not confuse with Pro Mini. Pro Micro has an available hardware UART, communications with the PC happen over its built-in USB interface and it has I2C.

I2C is indeed a serial protocol but it is not an asynchronous protocol such as the RS-232 serial port on your PC. It is a synchronous protocol with a clock pin (“SCL”) to mark the successive bits on the data pin (“SDA”).

Of course the standard “serial” port is anything but “un-protocol’d”. :roll_eyes: