Arduino sketch programs its peers


George wrote up an Arduino sketch that can detect and program other Arduinos connected through serial. He demonstrates the functionality above by writing a sort of serial-synchronized version of the well-known “Blink” sketch –

It is an implementation of the STK500 protocol within an Arduino sketch. STK500 is used by avrdude and the Arduino IDE to write sketches to AVR chips.

A normal sketch (‘BlinkSync’ is used in the video) is first compiled and then converted from the Intel Hex format to a series of bytes written in C (by a Python script), which can be inserted into the Copier sketch as the data to be written to the destination Arduinos.
Afterwards, the Copier sketch and the BlinkSync sketch are stuck together, resulting in a sketch that performs both the original task and the copying of that task to other boards.

Quite cool – reminds me a bit of the Illuminato X Machina project demo. Now we just need to get Arduino writing it’s own code ;-]

12 thoughts on “Arduino sketch programs its peers

  1. sburlappp says:

    Yes folks, it’s the first Arduino Virus!

    1. says:

      I was just thinking the same thing. The beginnings of virus programming for the Arduino.

  2. GadgetMerc says:

    If skynet runs on arduino I will will not be apart of the resistance. I love my arduinos too much to fight back.

  3. bohne says:

    Nice work. Have a look at LumiNet:

    LumiNet has a “Vector node” that infects the LumiNet network. Each node can infect its four direct neighbors. Each node can also be infected by each one of its direct four neighbors…
    The program code that is stored in flash memory is transmitted to the neighbors… this is possible because LumiNet runs on attiny microcontrollers and they don’t have a dedicated bootsection.
    I patched the official Arduino 0014 release in order to add support for this “programming by infection” bootloader and some other features. The user does not see a difference between programming an Arduino and a LumiNet network. Everything is done within the Arduino IDE, no python scripts.

    Have a look at it :)
    There is more information in this thread of the Arduino forum:


  4. George Caley says:

    I’ve uploaded the code:

  5. Brian says:

    Is the a first version Arduino virus?

Comments are closed.

Discuss this article with the rest of the community on our Discord server!