Matthew Kaney at ITP

(Specifically, Automata projects)

Morse Code



For this week’s exercise with solenoids, relays, and other electromagnetic switches, I’ve been working on using a relay to control an 125V AC current load from the wall with the Arduino. For now, I was mostly just making sure I understood how the relay circuit worked, so I just focused on blinking a light.

This program takes the light-blinking hardware and allows the user to type text through the serial monitor, which is then blinked in Morse code. It’s kind of like an Aldis lamp, in spirit, if not in actual functionality.

Here’s the code:

// Length of the shortest unit (a dot, pronounced "dit") in millis
int ditLength = 100;

// Output pin
int lamp = 10;

// Pull in one character at a time
char buffer[1] = {' '};

// Table of all valid morse code values
int codeTable[36][5] = {{1,3,0,0,0},  // A
                        {3,1,1,1,0},  // B
                        {3,1,3,1,0},  // C
                        {3,1,1,0,0},  // D
                        {1,0,0,0,0},  // E
                        {1,1,3,1,0},  // F
                        {3,3,1,0,0},  // G
                        {1,1,1,1,0},  // H
                        {1,1,0,0,0},  // I
                        {1,3,3,3,0},  // J
                        {3,1,3,0,0},  // K
                        {1,3,1,1,0},  // L
                        {3,3,0,0,0},  // M
                        {3,1,0,0,0},  // N
                        {3,3,3,0,0},  // O
                        {1,3,3,1,0},  // P
                        {3,3,1,3,0},  // Q
                        {1,3,1,0,0},  // R
                        {1,1,1,0,0},  // S
                        {3,0,0,0,0},  // T
                        {1,1,3,0,0},  // U
                        {1,1,1,3,0},  // V
                        {1,3,3,0,0},  // W
                        {3,1,1,3,0},  // X
                        {3,1,3,3,0},  // Y
                        {3,3,1,1,0},  // Z
                        {3,3,3,3,3},  // 0
                        {1,3,3,3,3},  // 1
                        {1,1,3,3,3},  // 2
                        {1,1,1,3,3},  // 3
                        {1,1,1,1,3},  // 4
                        {1,1,1,1,1},  // 5
                        {3,1,1,1,1},  // 6
                        {3,3,1,1,1},  // 7
                        {3,3,3,1,1},  // 8
                        {3,3,3,3,1}}; // 9

// Basic setup stuff
void setup() {
  pinMode(lamp, OUTPUT);  

void loop() {
  // Check if there's incoming data
  if(Serial.available()) {
    // Read in one byte
    Serial.readBytesUntil('/', buffer, 1);
    int currentCharacter = buffer[0];
    int currentIndex = -1;
    // Check valid character ranges and find the corresponding index
    // in the morse code table.
    if((currentCharacter >= 'a') && (currentCharacter <= 'z')) {
      currentIndex = currentCharacter - 'a';
    if((currentCharacter >= 'A') && (currentCharacter <= 'Z')) {
      currentIndex = currentCharacter - 'A';
    if((currentCharacter >= '0') && (currentCharacter <= '9')) {
      currentIndex = currentCharacter - '0' + 26;
    if(currentIndex != -1) {
      // Serial feedback stuff
      Serial.print("  ");
      for(int i = 0; i < 5; ++i) {
        // Loop through until we hit a '0' in the letter sequence
        if(codeTable[currentIndex][i] != 0) {
          // First, print a dot or dash for serial feedback
          if(codeTable[currentIndex][i] == 3) {
          } else {
          // Now, flash the light on and off 
          digitalWrite(lamp, HIGH);
          delay(codeTable[currentIndex][i] * ditLength);
          digitalWrite(lamp, LOW);

          // Wait one dit between flashes
        } else {
          // We finished the letter early
      // Wait two more dits between characters
      delay(ditLength * 2);
    } else if(currentCharacter == ' ') {
      // If we've got a space, wait four more dits (7 total) between words
      Serial.println(" ");
      delay(ditLength * 4);
  } else {
    // For serial feedback: if we just finished printing characters, add a
    // blank line between this and the next thing the user wants to write out
    if(buffer[0] != ' ') {
      Serial.println(" ");
      buffer[0] = ' ';

Automata Prototype: Owl 1



Prototype 1

This week in Automata, we’ve started working with stepper motors. As part of this, I’ve been experimenting with an ultrasonic range finder mounted on a motor to control rotation. After initial tests with a rough mockup (above), I built a small, wooden character to house my mechanism. Because of the shape of the range finder and the head-turning rotation I was trying to create, I immediately thought of an owl as a design motif.

The basic algorithm is to stand still until something passes through the owl’s field of “vision” at a close enough range. The owl then waits for the object to move away, at which point it sweeps left and right for increasing amounts of time, trying to find another object (or the same object) within the close enough range. If it goes too long without finding anything, it will give up and wait for something else to pass by.

So far, the head moves slowly and sometimes triggers randomly. I think I need to fine-tune the mechanism so that the head doesn’t tilt and shake around so much. In addition, my current design limits the full span of the head turn. Perhaps with an improved design, the owl can make a more complete rotation.

Owl Automata Test 1 from Matthew Kaney on Vimeo.

Concept: Paper Automata


Paper Automaton Illustration

As a starting point in my Automata class, I’m exploring the concept of two-dimensional paper automata. I’m drawing inspiration from the types of articulated paper puppets often used for shadow puppetry or animation. Because they lie essentially flat, I’m interested in the mechanical challenges posed by this form. I’m also interested in cut paper (either laser cut or die cut) as an especially accessible form of digital fabrication, and am curious to see how sophisticated of mechanisms can be produced in 2d paper with these technologies.

I’m envisioning a series of animated figures who could perform as part of a larger narrative. The illustration above describes a modular system for these figures, where the figures could be designed as self-contained paper constructions with an exposed gear. This paper construction could then be slotted in to a machine box, where an internal motor and gear would connect with the paper gear and drive the motion.

As an initial experiment with the material (and as a means to get comfortable with common mechanisms, I prototyped two mechanisms in card stock. In order to create joints, I considered various approaches, but ultimately settled on a circle of paper cut into a star shape, with the points of those stars folded through matching holes in other components and then glued down. I started with a series of crossed levers (motion No. 144 in 507 Mechanical Motions) in order to get the joints working.

Scissor Levers

Scissor Motion

Overall, the prototype worked quite well. The joints were strong, but allowed full motion with minimal friction. When kept flat (either holding by hand or by resting on a tabletop), the paper had plenty of strength for the mechanism to work. However, if I wasn’t careful, the paper had a tendency to bend, which completely wrecked the motion. This was clearly pushing the size limits for the card stock I was using. For better structure, I’ll probably try a combination of stiffer paper and smaller individual components in the future.

The crank mechanism (motion No. 92), worked as well, if not better. After some trimming, the motion was smooth, and the main structural piece was the only piece that tried bending. With wheels, cranks and levers working, the next major challenge will be gears. Gears are fundamentally three-dimensional in their operation, so the question stands whether the design can be modified into shapes that consistently interleave while still lying flat.


Circular to Linear Motion