Luo Yi Tan – Assignment 10 Automaton

It’s a rather unhappy cat looking at a bird.

Since it was the first time I was making something like this, I wanted to make it simple. At first I just wanted a mechanism to make a figure move back and forth in a linear way. I wanted to use a cam, but needed full rotation to do so, and my DC motor had problems, like not spinning as slow as I wanted it to, and stopping when I tried to slow it down. So I switched to trying to make a rack and pinion instead.

I went through several prototypes before settling on this, mainly because I spent most of the time figuring out how the automino kit works and looking up various rack and pinion setups online.  Several problems I had was getting the gear to rotate along the rack without slipping, and getting the gear on the rack at just the right height. Lots of tinkering was involved to get it to run by itself without me holding onto any of the parts.

The cat was the result of me needing a weight to hold the servo for the rack and pinion in place, and shaping it from some clay I had. I thought it was only natural for it to be looking at a bird.

Here’s the Fritzing diagram:

And the code:

Servo servo1, servo2;  // servo control object
int button = 2;
int period = 500;

void setup()

void loop() {
  if(digitalRead(button) == LOW) {
    for (int angle = 0; angle  0; angle -= 1) {
      delay (10); 
  else {

Post a comment