Strategies for wirelessly networking multiple Arduinos

Hello, I'm interested in learning how to wirelessly network multiple arduinos together over wi-fi in conjunction with other sensors, lights, servos, motors, and MIDI controllers.

I'm working on a project that will require a specific network configuration, and to give you a better sense of my plans, I've outlined the connections and signal paths as a diagram (see attached pdf). Here's a listed tech spec breakdown of all the pieces that will be involved in the networking aspect of this project as of the latest design plan:

• (1x) Arduino Mega 2560
• (4x) Sparkfun Arduino Pro Mini 328 - 3.3V/8MHz
• (4x) Sparkfun Bluetooth Mate Silver
• 2 MIDI control sources (one is physical controller connected to computer, other is TouchOSC from iPad over WiFi)
Some kind of software and/or hardware networking solution to facilitate multiple simultaneous channels of MIDI to serial communication between multiple Arduinos and MIDI controllers.

I've gotten these outlined communications working in isolation (MIDI controller to Mega, TouchOSC on iPhone controlling Arduino Pro Minis, etc.), but don't currently have the knowhow to scale it up and incorporate all communication connections simultaneously over wifi network. That's the goal.

In regards to MIDI to serial communication (and vice versa), I'm currently using 'hairless MIDI to Serial bridge' (The Hairless MIDI<->Serial Bridge). This works great for one channel of two-way communication between Arduino and MIDI controller, but won't facilitate the amount of independent serial and MIDI connections my project will require. I came across this software called junXion (http://steim.org/product/junxion/) which looks like it might allow me to transmit MIDI communications to multiple arduinos, but haven't used it yet. Has anyone ever used this software in a similar context to what I'm trying to do?

Also, I am open to integrating a Raspberry Pi (or perhaps the soon-to-be-released Arduino Tre) into my larger setup to act as a networking hub for four Arduino Pro Minis, Mega, MIDI controller, TouchOSC, and associated MIDI to serial communications between them all. Any thoughts on this?

Looking forward to hearing your feedback and any ideas you may have about the simplest tools to accomplish this project. Thank you!

NetworkPlan_1.pdf (81.1 KB)

In your diagram you are saying that

<<<Serial In/Out over Wi-Fi.

But the module represents "Bluetooth Mate Silver."

If you want to use Wi-Fi, then go for the RN171-XV module available at https://www.sparkfun.com/products/10822

You can have multiple modules in which one can be used as AP and all the other can connect to it.

The most simple thing in using those modules is that:-
Whatever data you send on RX/TX of Wi-Fi module, that data is broadcasted on port 2000. So you can simply listen to that port at the AP.

Since you are using multiple modules you can configure the module to broadcast at any number (that port should be available for general use.)

Say you have 5 modules configured to transmit at ports x1,x2,x3,x4,x5.
So in your AP you can listen to all these ports. And process the data received to control your mega board.

If you want to send data from AP to say module at port x1, you might have to follow these steps.

  1. Put AP in command mode,
  2. set the broadcast port to x1.
  3. Exit the command mode.
  4. Send the data via serial comm.
  5. Put AP in command mode,
  6. Set the precious broadcast port.
  7. Exit the command mode.
  8. Listen to all x1 to x5 ports.

I hope that this might be helpful to you.

Does it have to be WiFi? NRF24L01+ modules would be much cheaper.

Paul

Thank you for the helpful info about these wireless modules. I'm fairly new to using wireless modules in my Arduino projects, so I wasn't aware these devices existed, very cool stuff.

@ Paul: I really like the small form factor of the NRF24L01+ modules, but it seems they would only facilitate wireless communication between MCUs and not between a computer and an MCU, correct? Currently I require a computer in my setup which acts as a central hub that retransmits MIDI signals from an app on my iPad to the Arduino Pros, and it doesn't appear that these devices would facilitate this. I'm open to figuring out a way to transmit MIDI signals directly from my iPad to the Arduino Pros w/out the need for a computer, but I think that would still require some kind of Bluetooth or WiFi module connected to the Arduino Pros.

@ kulkarniparag4: Yes you're right, sorry about the mislabeling in my diagram, it should read as "<<< Seral In/Out over Bluetooth." That's how things are currently configured, but I'm intrigued by your recommendation of the RN171-XV modules. I appreciate how they're a little cheaper than the Bluetooth modules I'm using, but I'd need to do some tests to determine if they'll be able to fit nicely into my current dimension constraints for the Arduino Pro enclosures I'm using. Do you think it would be an issue if the module's antennae is entirely surrounded by a plastic enclosure?

My big question right now still pertains to figuring out some kind of software solution which can convert MIDI signals into serial data (and vice versa) and also allow me to easily configure multiple channels of MIDI to serial communication between the two MIDI control sources I'm using (a physical MIDI keyboard controller and an app on an iPad) and all the Arduinos in the network as outlined in my original diagram. Does anyone have any experience with doing something like this?

Thanks again for your input!

stooby:
@ Paul: I really like the small form factor of the NRF24L01+ modules, but it seems they would only facilitate wireless communication between MCUs and not between a computer and an MCU, correct?

Depends on what you consider to be "between MCUs and not between a computer and an MCU.

You can use one Arduio to connect to a PC, and that Arduino can be the central node in a star-configured network using the nRF24L01 mocules. In the star network, the central node can directly communicate with 5 other nodes, and each of those 5 nodes can communicate with 5 more, and so on. This means that you can send MIDI data inward to the central node, or outward to any node, with the number of "hops" depending on the number of nodes between the central node and the target node.

With the appropriate sketches, you can route data between any two nodes on the network, so you are not limited to inbound-only or outbound-only traffic..

Yes, like lar3ry says, I was thinking something like a Pro Micro connected to the PC via USB and equipped with a high power NRF2401L+ PA LNA to act as "base station". This would increase the range and reliability of comms to the other low power NRF modules.

PaulRB:
Yes, like lar3ry says, I was thinking something like a Pro Micro connected to the PC via USB and equipped with a high power NRF2401L+ PA LNA to act as "base station". This would increase the range and reliability of comms to the other low power NRF modules.

One thing to keep in mind is that since any module can communicate with any other module through "hops", you may be able to communicate over longish distances if you have the freedom to place sensors such that they can also act as relay nodes.

I am (slowly) planning out my network, and envision things like a driveway monitor, garage door opener (combination and RF remote), garage door status sensor, cloud sensor, and more, all of which can be placed such that they need only be low power.

lar3ry:

stooby:
@ Paul: I really like the small form factor of the NRF24L01+ modules, but it seems they would only facilitate wireless communication between MCUs and not between a computer and an MCU, correct?

Depends on what you consider to be "between MCUs and not between a computer and an MCU.

You can use one Arduio to connect to a PC, and that Arduino can be the central node in a star-configured network using the nRF24L01 mocules. In the star network, the central node can directly communicate with 5 other nodes, and each of those 5 nodes can communicate with 5 more, and so on. This means that you can send MIDI data inward to the central node, or outward to any node, with the number of "hops" depending on the number of nodes between the central node and the target node.

With the appropriate sketches, you can route data between any two nodes on the network, so you are not limited to inbound-only or outbound-only traffic..

Thank you lar3ry for breaking things down like this. This sounds like it might just be the answer I'm looking for! Because I'm planning to have the Arduino Mega connected to my computer via USB cable, this could also serve as the central node in my network and communicate with the four other Arduino Pro via NRF2401L+ modules. I would be sending MIDI data from a physical MIDI controller and a MIDI control app on an iPad to my computer, into the Mega, and out to the corresponding Arduino Pros. And the analog input signals from the piezo elements connected to the Mega would be able to be transmitted to the Arduino Pros too. I'll order a few of these modules to test them out soon and will keep you posted about how things go.

Many thanks for your continued input!

Make sure you buy the newer "+" version. They havd the additional lower 250KHz rate with slightly longer range and reliability, and the have 8-way connectors, not 10-way.

Thanks for the heads-up. I will purchase that version for testing. 8)

stooby:
My big question right now still pertains to figuring out some kind of software solution which can convert MIDI signals into serial data (and vice versa) and also allow me to easily configure multiple channels of MIDI to serial communication between the two MIDI control sources I'm using

Hi Stooby, did you achieved it ?
I'm working far or less on same kind of project, and i'm using Max for Live, it's Max / Msp / Jitter within Ableton Live.
My project will use several arduinos (for servos, and RGB strip led) and I want to use wifi too. I'm waiting to meet some "arduino masters" in my fablab in Montpellier but I started to write my application with Max.
So, maybe we could help each other...