Arduino LED communication

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
(remove the space between LED and comms! YouTube inserted it apparently).

Duration : 0:0:38





21 responses to “Arduino LED communication”

  1. axel1973w Avatar

    Using simple LED as …
    Using simple LED as a Photodiode ?!? In Blocking direction or what?

  2. jsbach333 Avatar

    very smart.
    very smart.

  3. bazza4288 Avatar

    next you should do …
    next you should do it with lasers 😀

  4. Labortablo Avatar

    Nice! i can’t get …
    Nice! i can’t get the source code, only a 404 error when i follow the lik. Is there any other way to get the source code? Thank you.

  5. Labortablo Avatar

    Nice! I can’t get …
    Nice! I can’t get the source code. When i follow the link i get a 404 error. Is there any other way to get it? Thank you.

  6. dodgedart74 Avatar

    2 year old video …
    2 year old video doubt you even use your arduino anymore.

  7. ipodmacguru Avatar

    It’s actually 2 …
    It’s actually 2 arduinos running the same code and started at different times

  8. danielkachal Avatar

    WOW… i didn’t …
    WOW… i didn’t know that …. nice …..

  9. TopARO Avatar

    Hey! I tried the …
    Hey! I tried the link, no help. Could you send me the code and a short explanation?

  10. hideroma29 Avatar

    awesome !!
    I would …

    awesome !!
    I would like to read this sorce code.
    how can i get this ?

  11. ekhamburg Avatar

    yes, that would be …
    yes, that would be great

  12. cassianorabelo Avatar

    Really nice! …
    Really nice! Unfortunatly the link for the source code is dead. Do you mind sharing it again? Thanks a lot.

  13. sgtkim9 Avatar

    I am trying to make …
    I am trying to make similar things. so I used atmega board and c code. Unfortunately my LED can’t sense another LED light. Should I use more bright LED? give me some advice. sorry for poor English.

  14. randomskk Avatar


  15. thiage Avatar

    Wow, that is very …
    Wow, that is very cool. Nicely done!

  16. blackheart0202 Avatar

    hi buddy…….
    i …

    hi buddy…….
    i wana make it project can u give me some idea plz

  17. randomskk Avatar

    I don’t have a …
    I don’t have a project site for this one, as I started the site after making this, but I do plan to continue the idea and will probably post about the new implementation on my site, negativeacknowledge (google it). I’ve updated the video description to include a link to the source code.

  18. randomskk Avatar

    I use those USB …
    I use those USB boards, arduinos, as I had them handy at the time and was still playing with them. However, it can be done even with just an ATtiny13 or anything with GPIO pins, such as a PICAXE 08 or a PIC12F series.
    The basic idea is to connect BOTH pins of the LED to an IO port, then reverse bias the LED and check it after a fixed period of time, if it’s bright then the LED will read 0 and if it’s dark it’l read 1 – there’s more info on how this works online.

  19. Russoft Avatar

    that is so very …
    that is so very awesome. Any chance there’s a schematic, or do you need those fancy USB boards…whatever they are that you’re using.

    can normal LEDs be used as photodiodes?

  20. jim3uk Avatar

    Nice, I espcialy …
    Nice, I espcialy like the Cybertool in the BG 🙂 do you have a project site for this? I’d love to look over the source and see more pics.

  21. rfmaster93 Avatar

    very good idea, if …
    very good idea, if you can add upon it, to make it be able to push more info through…

Leave a Reply