This is an Alarm Clock powered by Arduino. It keeps track track of time down to the seconds. Once the alarm time is reached, the alarm goes off for one minute, then shuts off automatically.
For this project you will need a couple things,
16 pin LCD screen
Step 1: Hardware
First you need to wire everything together. Here is the circuit diagram and A picture of my project.
Step 2: Code
Pasted below is the code to the project, upload this to the arduino and un comment the time you need to set.
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
DS3231 rtc(SDA, SCL);
#define buz 11
lcd.print("Arduino Alarm ");
// The following lines can be uncommented to set the date and time
//rtc.setDOW(WEDNESDAY); // Set Day-of-Week to SUNDAY
//rtc.setTime(12, 0, 0); // Set the time to 12:00:00 (24hr format)
//rtc.setDate(1, 1, 2014); // Set the date to January 1st, 2014
t = rtc.getTime();
Hor = t.hour;
Min = t.min;
Sec = t.sec;
if( Hor == 11 && (Min == 32 || Min == 33)) //Comparing the current time with the Alarm time
Step 3: Finished Project
Place the hardware inside a container with the LCD visible. Now the project is finished. The small piezo buzzers won’t work for this project. The voltage this circuit draws is too high and the buzzer won’t receive enough power. Here is the one I used - Buzzer.
Step 4: Problems I Ran Into
While working on this project there were several problems. The code I was using wasn't perfect and I had to change some of it, but the one posted here is my edited version and should work fine. Also, if the buzzer isn't loud enough, there is probably a voltage drop within the circuit. The arduino can handle up to 20 volts worth of input, but most power supplies are 3.2-5v. This isn't enough for the circuit and won't work with the small piezo buzzers. This problem can be fixed with a larger voltage power supply or just a louder buzzer, which is what I used.