Instructables

Voice Activated One Bird Clock

Featured
Picture of 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."





 
 
Remove these adsRemove these ads by Signing Up

Step 1:

Picture of
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:

Picture of
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:

Picture of
one bird07.jpg
Wire up the microphone assembly on the breadboard.

Step 4:

Picture of
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:

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

Step 6:

Picture of
Drill a hole in the servo arm.

Step 7:

Picture of
Fasten the servo arm to the bird with a screw.

Step 8:

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

Step 9:

Picture of
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:

Picture of
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:

Picture of
one bird10.jpg
Cut the end off the cable that comes from the servo motor  (red, black, white).

Step 12:

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

Step 13:

Picture of
one bird15.jpg
one bird16.jpg
Plug all the wires into place.

Step 14:

Picture of
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!
jabujavi2 years ago
schematics? please.
MikeTheMaker (author)  jabujavi2 years ago
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.
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
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!