1

I want to do a project that has multiple Arduino communication through UART, that project project one of limit is using Arduino Nano (small and cheap). I need to set 4 serial port instance on Nano to connect other nano to receive and write, I searched about serial port of nano that only have one hardware serial port, so after I found the many softserial library such as pre-bulite softserial and altsoftserial NeoSWSerial and NeoHWSerial and NeoICSerial. Because library too libraries i don't know which one can help complete my project.

Michel Keijzers
13k7 gold badges41 silver badges58 bronze badges
asked Mar 1, 2019 at 9:21
2
  • what's wrong with the arduino softwareserial library? in what way does it not work for you? Commented Mar 1, 2019 at 9:41
  • Is using UART a hard requirement? If not, consider using an I2C connection which uses a single connection and addresses to communicate with many devices. Commented Mar 1, 2019 at 16:18

1 Answer 1

5

I think your problem is that you need 4 serial ports.

With software serial that's just not going to happen:

  • SoftwareSerial can only receive on one serial port at any given time.
  • AltSoftSerial is limited to specific pins, and only one instance because there is only one set of pins
  • NeoSWSerial is kind of between the two. More efficient than SoftwareSerial, but still (as far as I can tell) limited to one instance (it uses a timer interrupt to drive the communication, so can use any pins)

If you need communication between lots of devices over serial then you will either need devices with more hardware serial ports (Arduino Mega, for example), or implement a multi-drop bus system (like RS-485) which only needs one serial port to communicate with many devices. Extra external hardware is required though.

answered Mar 1, 2019 at 10:04
1
  • Good answer. Another hardware option is a SPI to UART expander. Commented Mar 1, 2019 at 12:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.