Connecting different Arduinos to one Raspberry (wired, low speed)

Hi, I'm thinking about a way to connect different Arduino to RB, then process received datas by NR, maybe there is something ready?
There may be some options:

  1. ethernet: this is the easiest way, shield with ethernet port and MQTT packets, it needs a switch/hub to get all cables together. To save the hub it's possible to use WiFi, but I would love to stay on wire transmission
  2. UART, this has sense as the data sent are just some bytes, but there is only one UART interface.. so I may connect all together and polling each Arduino, only then they can send datas. Complicated to connect wires together, I need open collector outputs and one pullup resistor, is it possible to configure the TX Adruino output as open collector?
  3. can be interesting to connect different GPIO pins to each Arduino, but how then import data? I suppose I need to rebuild a serial protocol for each GPIO input..

Thnak s for suggestions

If your arduino's are ethernet enabled go the mqtt route!

For wired you can also use the serial connection.

And if you dont want any logic on your arduino, check firmata. It works great with NR

Hi, thanks for reply, can you please explain better it? I had a look but I haven't understand much, which hardware to communicate it uses? Also ethernet? What are the advantages compared to MQTT?
About serial.. the problem is to create a point (Raspberry) - multipoint (different Arduinos) connection, the bus should be shared, so only open collector ports can be connected, can Arduino TX pin be configured as open collector?

If your Arduinos are networked, either ethernet or wifi, MQTT is very simple. It does need a broker - Mosquitto - which can easily run on your Raspberry Pi.
After that, it just works. One machine publishes a message; it is delivered to any machine which has declared an interest (subscribed to the topic).
You don't need to know anything about TCP/IP, busses, ports, pins, number of connections etc.

If you want to learn about MQTT then see this tutorial MQTT Essentials - All Core Concepts explained

Thanks guys, the Arduinos are not equipped with ethernet, but I can buy the interface for them, this looks easier than wire the serial connection and create a polling protocol, also, with IP, I can also ping and monitoring devices.
I'm not afraid of TCP/MQTT and all you mentioned, I know that stuff, I'm evaluating the easiest way. :slight_smile:

I'm curious about Firmata, never heard about it, I would be glad someone answer my questions:
which hardware to communicate it uses? Also ethernet? What are the advantages compared to MQTT?

Before you purchase an Ethernet module for your Arduino, you might like to consider going down the ESP32-S2 Mini route. These units are inexpensive, have WiFi capability (so can support MQTT) and have loads of functionality. Here's a link to one supplier on Ali-Express.

OK - I know it would mean changing horses in mid-stream, but might turn out cheaper in the end.

Thank you for sharing, I haven't bought nothing by now, I can consider WiFi but as I have to power this modules by a battery stable power I can use a cat5e cable and use ethernet too, this will assure me more relyability than wifi.
I would use Arduino also because it assures me compatibility with wiegand libraries for example, to manage external keyboard.

Now I would know more about Firmata and what is involved with, or another possibility like RS485 if there are modules ready, thank you

Considerning the low quantity of bytes I need to transfer and the cheap cost of interfaces, plus avoid to buy an ethernet switch, I'm going to go for RS485 interface, NR will poll regulary each Arduino and waiting for response

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