Voice Activated One Bird Clock
by MikeTheMaker in Circuits > Clocks
4469 Views, 10 Favorites, 0 Comments
Voice Activated One Bird Clock
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
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
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);
}
}
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);
}
}
Wire up the microphone assembly on the breadboard.
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.
Drill a hole in one side of the bird's "axle."
Drill a hole in the servo arm.
Fasten the servo arm to the bird with a screw.
Twist the bird "axle/servo arm" assembly and screw the arm into the servo motor.
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.
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.
Place double sided tape on the Arduino and breadboards. Stick them to the butter dish.
Cut the end off the cable that comes from the servo motor (red, black, white).
Solder one end of a jumper wire to each end of the servo cable.
Plug all the wires into place.
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!
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!