cyborg5 / IRLib2

Library for receiving, decoding, and sending infrared signals using Arduino
GNU General Public License v3.0
384 stars 138 forks source link

Two way IR communication on Arduino/Similar #2

Closed curtpw closed 7 years ago

curtpw commented 7 years ago

Hi. Sorry for abusing Issues. Is fast(ish) two way communication between arduinos possible using this library? Possible in general?

I messed around with this example from your main competitor to no avail: https://github.com/z3t0/Arduino-IRremote/blob/master/examples/IRtest2/IRtest2.ino

Maybe your library can do better?

cyborg5 commented 7 years ago

The problem with 2 way communication is that the IR signals might interfere with one another. You would have to shield the receivers so that they didn't try to detect their own transmissions. Perhaps put them at the end of a long cardboard tube. Still you have the problem that if you cannot simultaneously send and receive. If you're doing some sort of handshaking where only one of the two devices is guaranteed to be transmitting at the same time then you might be okay. But if one is transmitting it cannot receive during the transmission. Any attempt to send, disables reception and you have to reenable it after the send is complete.

Then it also depends on what you mean by fast(ish). A typical protocol will spend perhaps 10000 µs transmitting a header and perhaps 600 to 800 µs per bit to transmit data followed by at least 7500 µs of lead out time between transmissions.

It's not so much a matter of which library you're using but it's the limits of IR technology itself.