I'm looking for a wireless communication option to send three brightness values (0 to 255) from one master Arduino to several other slave Arduinos as quickly as possible. Most important is speed, I'd like to be able to have the packets be received at a maximum of 36ms apart since somewhere around that point is where smooth fades become jittery. Whether every packet that is sent is received does not matter as long as the slave Arduinos manage to act on one complete packet every 36ms or less, and I only need communication in one direction. Basically I want one Arduino screaming out numbers as quickly as possible, and several slaves just grabbing and acting on whatever they happen to catch as quickly as possible.
I can either send the data as a byte array or a long, but the long might actually be larger than a three byte array. Another possibility would be to have it send integers with an identifier for which channel it is controlling baked into the integer.
I would prefer to be able to have the master Arduino up to 100m away (roughly clear line of sight, possibly people between the units) while keeping the slaves as small as possible (wearable). However, if that is not possible, as long as the master can be made also down to a wearable size, then it could be kept within a few meters of the slaves.
Does an NRF24L01 sound like the proper wireless unit for what I'm asking for?I've found some for just over $1 a piece on Amazon.
Is what I'm asking for something an Arduino is even capable of?
Would using an adapter with an external antenna on the master only allow the range I would like?
I think you'd need a higher-power module with external antenna at the base location.
See some possibilities HERE:
Thanks for the link, one question I have that isn’t answered there though, could I use one of the stronger ones as the transmitter, but still use the smaller ones as receivers? I’m not sure how well a dipole antenna would match up with the PCB trace antenna though.
could I use one of the stronger ones as the transmitter, but still use the smaller ones as receivers?
Yes, some people do that..
This Simple nRF24L01+ Tutorial may be of interest.
If you just want one-way transmission and don't need an acknowledgement get all the slaves listening on the same address and turn off the autoAck feature.
Your requirement for updates at 35msec intervals seems strange. Can you not program the slaves to apply a change at 36msec intervals if you just send a number to them representing the target value to change to. For example send 240 and it will know to increment in steps at 36msec intervals from wherever it happens to be up to 240. That sort of arrangement would greatly reduce the amount of data that needs to be sent and would allow for an overall more reliable system with individual messages for each slave and acknowledgements.
I'm trying to keep a few sets of lights synced up with random(ish) controls. The master won't know more than the current brightness it needs to command.
The 36ms is more or less at what point I started to notice sharp jumps (I set up an exponential decay function based on millis(), threw a variable delay into the program, and increased delay until the lights weren't smoothly fading anymore).
Although, your comment about sending values at set intervals and smoothly fading between them does bring up an interesting idea. If I tolerate some lag between what the desired brightness is, and the commanded brightness I agree that would be a more robust system. I'm just not sure how much lag time between command and response will feel acceptable.
Edit: Bookmarked your tutorial. Looks good.
I am sure you already are aware the "perception" of brightness is not a linear function, just like all our senses.
Although, your comment about sending values at set intervals
I had not actually suggested that but it may be a good idea - send a value even if the number is the last time.