Masterless serial communication between multiple arduinos through wireless

I'm working on a project that will have more than 10 arduinos.

I'm looking for a way to have any of the arduinos broadcast a stream of data to any of the other arduinos at any time. when two or more arduinos are in range, they must automatically connect and start communication. it should be two way communication.

The problem with Bluetooth, and other master/slave protocols is the master must ask for the data first. The slaves cant send data to the master if it didnt request anything. Moreover, Bluetooth is connected to limited devices upto 7.

Asynchronous Serial doesnt necessarily have a master role, but Async Serial is really only for communication between 2 devices. no more.

I'm looking for something in between. I dont want the master to have to ask for data first, the slaves should be able to send whenever they like and the intended recipient Arduino will receive/action the data when it can, and I also need to have more than 2 arduinos sending and receiving.

Anyone know of any existing libraries to do this ? or any clues how to make this work with the Serial or software serial libraries? Or, anyone have any better ideas?

Anyone know of any existing libraries to do this ?

A network does provide that functionality, so you can either use an Ethernet Shield to have wired version or WiFi hardware to have a wireless option.
On the protocol side it looks like mDNS provides the functionality you specified (at least to the degree of detail you provided).

You need to provide more information.

  • How many Arduinos do you want this to work for? If I imagine (say) 5 Arduinos labelled A, B, C D and E can you list the patterns of communication that you want to happen between them?
  • Over what distance does the wireless communication need to work?
  • How often will messages need to be sent?
  • How many bytes of data will there be in a message?
  • Why is a master-slave system unsuitable? It would be very easy to implement.

If the distances are not too great it may be possible to do what you want with nRF24L01+ modules. But I need more information to be sure that it would be possible.

url=]Simple nRF24L01+ Tutorial[/url]

Dear Robin, I want to communicate more than 10 Arduinos. I does’t care about communication distance. for example, if 5 Arduinos are connected together and when i bring another arduino close to the transceiver range of these arduinos it should connect automatically and start communication with these arduinos. similarly, when i move it far away, it disconnect.

for initial testing i just want to connect and send only one message.

Actually, i do this project for autonomous computing. Master-slave system is unsuitable because i want every arduino to autonomous body. so that they can control all the activities by itself.

Please see the attachment.

thank you Robin.

You have said;

I does't care about communication distance.

But then said;

similarly, when i move it far away, it disconnect

So we still have no idea of the distances involved, they are clearly significant if you want the link to disconnect when its 'far' away.

Are you designing a real working system or is it a homework exersize ?

Image from Reply #3 so we don't have to download it. See this Simple Image Guide


What you are describing seems to be complex. For example if you are using nRF24 modules there is no communication or connection between them except for the brief period when a message is being sent. That is why I asked about the size and frequency of messages. Your statement "for initial testing i just want to connect and send only one message." is completely unhelpful for the purpose of seeing a solution to your requirement. If you only need two devices and one message the solution is trivial.

There is no easily defined distance at which a wireless device changes from being within-range to being out-of-range. You might get communication at 100m range some times and at only 50m on another occasion.

If several devices are working on the same channel (frequency) as they must if they are to talk to each other then if more than one of them transmits at the same time all the messages will be garbled - that is avoided by having a master to control things.

You may find it useful to study the TMRh20 Network and Mesh libraries - but they are not light reading