30-Second Bird Timer

Justin Kufro – Fall 2018

The 30-second bird timer is a fine, hand-made decorative sculpture and functional timer.

Once plugged in to a power source, the bird will flap its wings once per second for a total of 30 seconds. The sculpture is intended to be placed on a shelf in someone’s home (because of its outstanding aesthetics) until on a rare occasion it is needed as a timer. Its rigid cardboard figure (sourced from Amazon) is fastened together with only the highest-quality standard staples and office tape.  Accentuated flaps give the user confidence in its time measurement ability. The smooth rearing back of the wings provides an astoundingly visually accurate millisecond measurement between flaps. Use of its timer functionality will augment the user’s ability to perceive the passage of time over short periods on an as-needed basis.

Arduino Code

#include <Servo.h>

// CONSTANTS
const int SERVO_PIN = 9;
const int MS_IN_S = 1000;
const int TIMER_SECONDS = 30;
const float SERVO_BASE_ANGLE = 120;
const float SERVO_DEVIATION = -40;

// initialize other variables
bool is_over = false;
Servo my_servo;

void setup() {
  my_servo.attach(SERVO_PIN);
}

void loop() {
  int curr_ms = millis();
  int curr_s = curr_ms / MS_IN_S;

  // write a calculated angle if the timer is not finished
  if (curr_s < TIMER_SECONDS && !is_over) {
    
    // flap factor is always between 0 and 1
    float flap_factor = (curr_ms % MS_IN_S) / (MS_IN_S * 1.0);
    float servo_angle = SERVO_BASE_ANGLE + (SERVO_DEVIATION * flap_factor);
    my_servo.write(servo_angle);
    
  } else {
    
    // don't continually write to the servo,
    // as it will make an annoying buzzing noise
    if (!is_over) { 
      my_servo.write(SERVO_BASE_ANGLE); 
    }
    is_over = true;
    
  }
}