Tutorials for building your own Scratchable devices and our source code are forthcoming. However, a top-to-bottom overview of our system follows:
Overview Of Components: When we use the term "Scratchable Devices," we are speaking about both the application of a graphical programming language to end-user device programming as well as the software and hardware that allows these devices to be controlled by Scratch. At the highest level, we are using the BYOB offshoot of the Scratch educational programming language as our user interface. We chose BYOB rather than the base Scratch distribution so that we could create custom blocks, such as "Turn On." In the remainder of this page, we refer to this user interface as "Scratch," rather than the more precise "BYOB," since "Scratch" is the programming language itself.
The programs users write in Scratch update variables that are broadcast over a socket connection to a program running in the Processing language. Processing acts as a middleman, taking updates from Scratch, converting them to "messages" in a custom protocol, and then broadcasting these messages wirelessly over 2.4 GHz RF using an XBee module.
These radio transmissions are received by an XBee module in each Scratchable Device. These modules are connected to Arduino microcontrollers, which are programmed to read messages following our protocol and then perform the necessary hardware actions. For example, a simple Scratchable Lamp would contain a relay, which functions like a switch. When the Arduino microcontroller receives a message from its XBee module telling the lamp to turn on, the Arduino would send a voltage to the attached relay, which in turn allows an AC current to power the lamp.