2x UNO R4 Wifi communication flow

Hi, is it possible to program two UNO R4 Wifi to communicate between each other? Is it possible we get sensor data to one, then it sends wifi signal to the other arduino, which further sends data to computer through wifi also...
Thanks,

  • Joao

Absolutely.

1 Like

have a look uno-r4-wifi/wifi-examples

Should I use CAN Bus method? Or is there an easier way with this new R4 Wifi?

no need for Canbus the UNO R4 WiFi has builtin WiFi capability use that

instal the WiFiNINA library and seletct Tools>Board "arduino UNO R4 WiFi"
then under File>Examples>WiFiS3 you will see some example programs, e.g. try running ScanNetworks then the WiFiChatServer

you can run TCP or UDP server/clients to pass data between the R4s

e.g. one of your R4 boards could read the sensors and publish the values using a WebServer - the other R4 could connect to the Websever to download the senors

experiment with the examples under File>Examples>WiFiS3

I don't have a UNO R4 WiFi I prefer to use ESP32 microcontrollers directly, e.g. installing-the-esp32-board-in-arduino-ide-windows-instructions

Serial is the easiest method. CAN is probably the most difficult. WiFi and bluetooth are wireless. Which you choose depends mostly on the details of the project that you haven't shared.

I will try to build a solution that captures various sensor data, like 8 sensors, send each message to different arduino by cable (I will have also 8 arduino, 1 for each sensor), then send the message to another arduino through wifi, then the second arduino sends message to laptop through wifi again.
The sensor data will be used to control software like Blender or Touchdesigner.
Is it really necessary to have a second arduino in serial?

what cable? TTL serial, I2C, RS485, canbuss? what are the '8 arduinos'
how far apart are the sensors? what are the sensors? what interface ADC, SPI, I2C, etc ?

That's a lot of Arduinos. Sounds expensive. Is there a particular reason you don't just have 1 Arduino read the sensors and communicate with the computer?

I get really tired of trying to help with mystery projects with descriptions like "8 sensors sending messages". Tell what you're actually building and you can get some good help. Keep being vague and you'll get some guesses but they may not be right for you.

Cable: dupont cables
Arduino: 9 Arduino R4 Wifi https://www.amazon.es/dp/B0C8V88Z9D?psc=1&ref=ppx_yo2ov_dt_b_product_details
Sensors 1: https://www.amazon.es/dp/B0CL5ZKLW9?psc=1&ref=ppx_yo2ov_dt_b_product_details
Sensors 2: https://pt.aliexpress.com/item/1005005611426114.html?spm=a2g0o.cart.0.0.11517f06sz0DsK&mp=1&gatewayAdapt=glo2bra
Power supply: https://www.amazon.es/dp/B0B4NXMGQT?ref=ppx_yo2ov_dt_b_product_details&th=1 + 9v batteries
Sensors are being placed in an installation, it will have variable distances, ranging from 5-10 m

I'm sorry I'm not trying to hide anything. The thing is I intend to make an art installation.
Sensors will sense people in a room and this sensors will trigger modulations and effects inside software like Touchdesigner or Blender.
From laptop, software will output image to a projector where people will see the changes they are doing to the model inside Touchdesigner.
I already bought two R4 Wifi, sadly from Amazon where they are more expensive. Yes it's a big expense but I will try to apply to a funded open call.
I bought two of them last Sunday just now I remember to come here and ask... I will try to connect both. One question is: Is it possible to connect more than on R4 to a single "Master" R4? Is it worth?

So you need multiple boards because the sensors will all be far apart? How far apart will they be? The wired communication methods all have some maximum distance over which they are reliable.

I don't think I'd get a whole R4 WiFi just for one sensor. There are lots of smaller and cheaper boards that will do once you know what you need. Definitely stop buying boards until you get a design figured out.

Cable: dupont cables
Arduino: 9 Arduino R4 Wifi https://www.amazon.es/dp/B0C8V88Z9D?psc=1&ref=ppx_yo2ov_dt_b_product_details
Sensors 1: https://www.amazon.es/dp/B0CL5ZKLW9?psc=1&ref=ppx_yo2ov_dt_b_product_details
Sensors 2: https://pt.aliexpress.com/item/1005005611426114.html?spm=a2g0o.cart.0.0.11517f06sz0DsK&mp=1&gatewayAdapt=glo2bra
Power supply: https://www.amazon.es/dp/B0B4NXMGQT?ref=ppx_yo2ov_dt_b_product_details&th=1 + 9v batteries
Sensors are being placed in an installation, it will have variable distances, ranging from 5-10 m

Can I connect multiple R4 Wifi to a laptop? How many? Maybe I don't need a Master board like I was mentioning
At the same time, can I get multiple R4s to control different parameters inside the same software?
What other boards do you suggest?

Yes. How many USB ports do you have? You can get USB expanders.

That depends on the software and how it's being controlled. But surely the answer is yes.

Without knowing the details of your project I cannot suggest anything.

What type of sensors? How arranged? What sort of output do you need to the computer? There are a ton of details that you need to figure out before you choose hardware.

You are an artist? Imagine I came to you and said I wanted to paint a picture. What type of paint should I buy? Can you answer without knowing what sort of picture and what I want to paint it on?

you could consider ESP8266 WiFi modules cost about £5 on EBAY in UK - possibly running ESP-NOW
someting to watch out for - when using a HC-SR501 PIR sensors on Raspberry Pi micros I found the RPi WiFi caused spurious trigger events on some PIRs - in the end disabled the Wifi

I don't want to use USB. I intend to connect them through wifi.

The problem with ESP is I don't want to use USB, so I gotta have the R4s connected to battery.

Ok. You can do that too. Again, it would really help if I could envision what you're creating.

Why can't you connect an ESP to a battery?

Isn't ESP usb? How do I connect batterires to it? I bought this connectors