Introduction: Voice Activated One Bird Clock

Firmly say "Time" and this bird will count the hours by bobbing forward and the minutes (in multiples of five) by bobbing backward.  He does a little "wobble" between hours and minutes so that you will know, "the times, they are a changing."





 

Step 1:

An Arduino "listens" for sounds and operates a servo motor to display the time.

Major materials needed:

Arduino    Radio Shack
small servo motor     amazon.com
drinking bird     amazon.com
acrylic butter dish     homeandwine.com
breadboard     jameco.com
2n2222a      jameco.com 
2 microfarad capacitor     jameco.com
9 volt dc power supply     jameco.com
microphone    jameco.com

Step 2:

Above is an abbreviated flow diagram for the software.

Software:

#include <Servo.h>

int ledPin = 13;
int minute=0;
int hour=7;  //start time at 7
int valm=0;
int valm1=0;

Servo myservo;

static unsigned long lastTick = 0; // set up a local variable to hold the last time we moved forward five minutes
// move forward five minutes every 300000 milliseconds

void setup() { //set outputs and inputs
myservo.attach(5);
pinMode(ledPin, OUTPUT);

}

void loop() {


if (millis() - lastTick >= 300000) {
lastTick = millis();
minute++;


}


// move forward one hour every 12 five minute intervals
if (minute >=12) {
hour++;
minute = 0; // reset minutes to zero
}

if (hour >=13) {
hour=1;
minute = 0; // reset minutes to zero
}
valm=analogRead(0);
if(valm>400){
   delay (10);
   valm=analogRead(0);
   if(valm>300){
     digitalWrite(ledPin, HIGH);
     //bird dunk
     if(hour == 1) {
       myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     }
   if(hour ==2) {
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
   }
  if(hour == 3) {
   myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
  }
if(hour == 4) {
  myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
}
if(hour == 5) {
myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
    myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
}
if(hour == 6) {
  myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
}
if(hour == 7) {
  myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
}
if(hour == 8) {
  myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
}
if(hour == 9) {
  myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
}
if(hour == 10) {
  myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
}
if(hour == 11) {
  myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
}
if(hour == 12) {
  myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
     myservo.write(10);
     delay(500);
     myservo.write(90);
     delay(500);
}
//separate movement between hours and minutes
myservo.write(80);
delay(500);
myservo.write(100);
delay(500);
myservo.write(80);
delay(500);
myservo.write(100);
delay(500);
myservo.write(90);
delay(500);
if(minute ==1) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
}
if(minute ==2) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
}
if(minute == 3) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
}
if(minute == 4) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
}
if(minute == 5) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
}
if(minute == 6) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
}
if(minute == 7) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
}
if(minute == 8) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
}
if(minute == 9) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
}
if(minute == 10) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
}
if(minute == 11) {
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
  myservo.write(170);
  delay(500);
  myservo.write(90);
  delay(500);
   }
   digitalWrite(ledPin, LOW);
   }}

  


valm1 = analogRead(1);    // add five minutes when pressed
if(valm1<800) {
minute++;
delay(250);
}
 


}

Step 3:

Wire up the microphone assembly on the breadboard.

Step 4:

Separate the drinking bird from his legs.  Drill a couple of holes on one side of the leg assembly and glue the servo motor (I used Gorilla glue) to the legs.

Step 5:

Drill a hole in one side of the bird's "axle."

Step 6:

Drill a hole in the servo arm.

Step 7:

Fasten the servo arm to the bird with a screw.

Step 8:

Twist the bird "axle/servo arm" assembly and screw the arm into the servo motor.

Step 9:

Twist the bird/arm into its final position.  Tape the end of the arm to secure it and prevent slippage.  I used aluminum duct tape.

Step 10:

Connect the Arduino to your computer and upload the software.

Place double sided tape on the Arduino and breadboards. Stick them to the butter dish.

Step 11:

Cut the end off the cable that comes from the servo motor  (red, black, white).

Step 12:

Solder one end of a jumper wire to each end of the servo cable.

Step 13:

Plug all the wires into place.

Step 14:

Plug the clock in--it will default to seven o'clock.  

Each press of the red button will advance the clock five minutes.  If the time is 8:15, press the red button 15 times.

You may want to stop occasionally and say "Time" to the bird--making sure you don't overshoot your target time.

That's it--enjoy!

Comments

author
jabujavi (author)2012-01-07

schematics? please.

author
MikeTheMaker (author)jabujavi2012-01-07

Step 3, the first image is the schematic. Try clicking on the small "i" in the upper left corner of the drawing, then you can choose the large size and see it more clearly.

author
jabujavi (author)MikeTheMaker2012-01-07

Sorry, I begin to see it in the 10th step because I came from a search. Sorry me and thanks you to quick reply. Good job

About This Instructable

4,026views

7favorites

License:

Bio: I am an author and a maker. My current project is Santa's Shop. I'm working on a science fiction type book--more later. @EngineerRigsby
More by MikeTheMaker:Happy FaceJittery Servo RepairAutomated Climbing Bear
Add instructable to: