Introduction: Chicken Wing Alarm Clock
Welcome to my project!
Step 1: What Is It?
Good morning friends,
Are you late for today?
Are you still upset about not getting up on time every morning?
Are you still thinking about why you feel the alarm clock is not ringing every morning?
Congratulations, “your best partner ”—— the chicken wing clock is coming to you!
This is a clock which is named chicken wing clock. This is not an ordinary alarm clock. When the alarm is turned on, it can continually poke with the tip of the chicken wings to make you wake up. The alarm clock is turned off while the chicken wings are stopped.
It is funny but it is useful.
Step 2: Material
a Wood board (22* 34* 0.7 inches)
Fish wire (40inchs)
Hot glues
Wood glues
Insulation tape
an MG995R
an Arduino board DS1307 Real Time Clock (RTC): I2C board
LCD screen
two pushbuttons
registers (220 Ω)
a buzzer
Coin cell battery
an electret Microphone Amplifier – MAX9812a
USB wire
wires
soldering machine
CNC
Sandpapers (220)
Step 3: Design Circuit Diagram
Don't put in the wrong pin.
checking each pin
Step 4: Making the Chicken Wing and Clock Box
(8inchs* 5.5inchs*0.2inchs)
(8.5inchs*8inchs*3.5)
Step 5: Testing Code
- #include "RTClib.h"
- #if defined(ARDUINO_ARCH_SAMD)
- #define Serial SerialUSB
- #endif
- #include
- int pos = 0;
- RTC_DS1307 rtc;
- char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
- const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
- LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
- void setup() {
- #ifndef ESP8266 while (!Serial);
- #endif
- Serial.begin(57600);
- if (! rtc.begin()) { Serial.println("Couldn't find RTC");
- while (1); }
- if (! rtc.isrunning()) { Serial.println("RTC is NOT running!");
- rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); }
- lcd.begin(16, 2);
- pinMode(A0, INPUT);
- pinMode(13, OUTPUT); }
- void loop() {
- DateTime now = rtc.now();
- lcd.print(now.year(), DEC);
- lcd.print('/');
- lcd.print(now.month(), DEC);
- lcd.print('/');
- lcd.print(now.day(), DEC);
- lcd.print(" (");
- lcd.print(daysOfTheWeek[now.dayOfTheWeek()]);
- lcd.print(") ");
- lcd.print(now.hour(), DEC); lcd.print(':');
- lcd.print(now.minute(), DEC);
- lcd.print(':');
- lcd.print(now.second(), DEC);
- lcd.println();
- lcd.print(" since midnight 1/1/1970 = ");
- lcd.print(now.unixtime());
- lcd.print("s = ");
- lcd.print(now.unixtime() / 86400L);
- lcd.println("d");
- DateTime future (now + TimeSpan(7, 12, 30, 6));
- lcd.print(" now + 7d + 30s: ");
- lcd.print(future.year(), DEC);
- lcd.print('/');
- lcd.print(future.month(), DEC);
- lcd.print('/');
- lcd.print(future.day(), DEC);
- lcd.print(' ');
- lcd.print(future.hour(), DEC);
- lcd.print(':');
- lcd.print(future.minute(), DEC);
- lcd.print(':');
- lcd.print(future.second(), DEC);
- lcd.println();
- lcd.println();
- delay(3000);
- lcd.setCursor(0, 1);
- lcd.print(millis() / 1000);
- if (digitalRead(A0) == HIGH) {
- tone(8, 440, 100); delay(10);
- }
- }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include
#include const int inputPin = A0;
const int inputWindow = 100;
unsigned int inputSample;
Servo myservo;
int pos = 0;
void setup() {
pinMode(inputPin, INPUT);
Serial.begin(9600);
myservo.attach(9);
}
void loop() {
unsigned int inputMax = 0;
unsigned int inputMin = 1024;
for (unsigned int i = 0; i < inputWindow; i++) {
inputSample = analogRead(inputPin);
inputMin = min(inputMin, inputSample);
inputMax = max(inputMax, inputSample);
}
Serial.print("Min: ");
Serial.print(inputMin);
Serial.print(" Max: ");
Serial.print(inputMax);
Serial.print(" Diff: ");
Serial.print(inputMax - inputMin);
Serial.println();
if (inputMax - inputMin >= 150) {
for (pos = 0; pos <= 90; pos += 1) {
myservo.write(pos);
delay(3);
}
for (pos = 90; pos >= 0; pos -= 1) {
myservo.write(pos);
delay(3);
} } else {
pos = 0; myservo.write(pos);
} }
Attachments
Step 6: Finally
I am done!