Inspiration

Struggling with waking up during quarantine was the main inspiration for this project; our product reinforces making an active effort to get up and out of bed.

What it does

There is a built in clock that displays time, without using an RTC for the Arduino. It uses an passive buzzer to function as an alarm at a time inputted by the user; it includes an ultrasonic sensor to detect deviations in distance (indicating movement, i.e. waking up) which notifies the alarm to terminate the buzzer. Unless motion is detected, the alarm will keep buzzing.

How We built it

We used different sensor components included in the Arduino kit to receive inputs; we coded programs for displaying time, taking in inputs, and integrating functions based on those inputs to solve the problem we isolated. We used the Arduino library to learn from and code our programs.

Challenges We ran into

We weren't able to test for the effectiveness of the ultrasonic sensor because the noise of the alarm was upsetting our teammate's dog (our mascot).

Accomplishments that We're proud of

We are really proud of being able to take our very beginner level of coding and introduction to Arduino to a higher level in the timespan that we were given to come up with an idea and implement what we know; honestly, we were just having a great time working together and bonding.

What We learned

We learned a lot about reading, identifying and editing errors, and maximizing efficiency in our codes. Moreover, we learned to just have good time!

What's next for Get Out of Bed

Probably just editing and refining our program/code; possibly have a project that improves the functionality of it in the future.

Built With

Share this project:

Updates

posted an update

include "LiquidCrystal.h"

// This defines the LCD wiring to the DIGITALpins const int rs = 2, en = 3, d4 = 4, d5 = 5, d6 = 6, d7 = 7; LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

// Digital LCD Constrast setting int cs=9;// pin 9 for contrast PWM const int contrast = 100;// default contrast

int h=12; int m=0; int s=0; int flag=0; //PM

int button1 = 0; int button2 = 1; int button3 = 8;

int alarmHour = 0; int alarmMinute = 0;

int buzzer = 11; double duration, distance;

// Backlight Time Out const int Time_light=1000; int bl_TO=Time_light;// Backlight Time-Out int bl=10; // Backlight pin const int backlight=120; // no more then 7mA

static uint32_t last_time, now = 0; // RTC

void setup() { lcd.begin(16,2); pinMode(button1,INPUT_PULLUP); pinMode(button2,INPUT_PULLUP); pinMode(button3, INPUT_PULLUP); analogWrite(cs,contrast); analogWrite(bl,backlight); now = millis(); Serial.begin(9600); }

void loop() { lcd.begin(16,2); lcd.setCursor(0,0); lcd.print("Time: "); if(h<10)lcd.print("0"); lcd.print(h); lcd.print(":"); if(m<10)lcd.print("0"); lcd.print(m); lcd.print(":"); if(s<10)lcd.print("0"); lcd.print(s);

if(flag==0) lcd.print(" AM"); if(flag==1) lcd.print(" PM");

lcd.setCursor(0,1); lcd.print("Alarm Clock ");

Serial.print("Please enter hour of desired alarm: "); if (Serial.available() > 0) { alarmHour = Serial.read(); Serial.println("Please enter minute of desired alarm: "); alarmMinute = Serial.read(); Serial.println("AM or PM?: "); if (Serial.available() == "AM"){ flag = 1; } else{ flag = 0; } }

for ( int i=0 ;i<5 ;i++) { while ((now-last_time)< 200) //delay200ms { now=millis(); } last_time=now;

button1=digitalRead(button1); button2=digitalRead(button2); button3 = digitalRead(button3);

bl_TO--; if(bl_TO==0) { analogWrite(bl,0); bl_TO++; }

if( ((button1==0)|(button2==0) | (button3 == 0)) & (bl_TO==1) ) { bl_TO=Time_light; analogWrite(bl,backlight); // wait until Button released while ((button1==0)|(button2==0) | (button3==0)) { button1=digitalRead(button1); button2=digitalRead(button2); button3 = digitalRead(button3); } } else

{ if(button1==0){ h=h+1; bl_TO=Time_light; analogWrite(bl,backlight); }

if(button2==0){ s=0; m=m+1; bl_TO=Time_light; analogWrite(bl,backlight); }

/* ---- manage seconds, minutes, hours am/pm overflow ----*/ if(s==60){ s=0; m=m+1; } if(m==60) { m=0; h=h+1; } if(h==13) { h=1; flag=flag+1; if(flag==2)flag=0; }

if((button1==0)|(button2==0))// Update display if time set button pressed {

lcd.setCursor(0,0); lcd.print("Time "); if(h<10)lcd.print("0"); lcd.print(h); lcd.print(":"); if(m<10)lcd.print("0"); lcd.print(m); lcd.print(":"); if(s<10)lcd.print("0"); lcd.print(s);

if(flag==0) lcd.print(" AM"); if(flag==1) lcd.print(" PM");

lcd.setCursor(0,1); lcd.print("Time: "); } if (button3 == 0){ lcd.setCursor(0,0); lcd.print("Alarm set for: "); if(alarmHour < 10){ lcd.print("0"); } lcd.print(alarmHour); lcd.print(":"); if(alarmMinute < 10){ lcd.print("0"); } lcd.print(alarmMinute); lcd.print(":");

if(flag==0) lcd.print(" AM"); if(flag==1) lcd.print(" PM"); } } } // outer 1000ms loop

s=s+1; //increment sec. counting

// ---- manage seconds, minutes, hours am/pm overflow ---- if(s==60){ s=0; m=m+1; } if(m==60) { m=0; h=h+1; } if(h==13) { h=1; flag=flag+1; if(flag==2)flag=0; } // Loop end

if((h==5)&&(m==50)){ tone(buzzer, 1000); // Send 1KHz sound signal... delay(1000); // ...for 1 sec noTone(buzzer); // Stop sound... delay(1000); // ...for 1sec

digitalWrite(13, LOW); delayMicroseconds(2); digitalWrite(13, HIGH); delayMicroseconds(10); digitalWrite(13, LOW);

duration = pulseIn(12, HIGH); distance = (duration*.0343)/2; Serial.print("Distance: "); Serial.println(distance); delay(100);

if ((distance < 5.0)){ noTone(buzzer); } } }

Log in or sign up for Devpost to join the conversation.