Two Arduino boards have an LED pointed at each other, and by using the LED as a photodiode are able to detect the other LED flashing.
To start with they both flash briefly and then look for another LED’s flash, if they capture the tail of another flash they immediately flash again, which is detected by the other LED, which flashes again etc.
This leads to very fast backwards/forwards flashing, and at this point the two devices are synchronised and the second red LED lights up.
While synchronised, data can be transferred, by altering the length of the flash. Holding down the button on each arduino transmits a binary 1 instead of the normal 0, which lights up the LED on the other board.
While the software doesn’t yet support longer streams of data, I plan to add this support so that small pieces of data could be sent from one to the other, with all sorts of uses, such as door locks/authentication/etc.
Source code is available at https://randomskk.net/u/code/arduino/LEDcomms.html
(remove the space between LED and comms! YouTube inserted it apparently).
Duration : 0:0:38