Pages: [1]   Go Down
Author Topic: Arduino Alarm Clock  (Read 1999 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would like to construct an alarm clock that can be programmed to go off at different times depending on the day of the week. For example I don't have class until the afternoon on Monday so I can sleep in, but on Tuesday I need to be up at 7:45 and Wednesday I need to be up at 6:45. Basically I want an easy way of programming the alarm clock so it knows what time it should ring depending on the day of the week.

Right now I know I'll need:
LED display
Arduino
Box to put it in
buzzer or speaker
usb ports, one to plug it into the wall and another 2 to plug in my cell phone and kindle to charge, should be simple
buttons for control

I'm not sure what else I'll need or where to start on the code, I'll draw out the design of the physical stuff in a few minutes and post that up.


* alarmclock.jpg (156.86 KB, 2004x946 - viewed 61 times.)
« Last Edit: August 22, 2011, 11:13:30 pm by seth556 » Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This looks good. Arduinos by themselves aren't great at long-term time accuracy, so you should add a real time clock chip. Most people use the DS1307:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235070596

this will also give you battery backup for the clock.

The code in the link above uses the ds1307 library directly, but I think it's easier to use the new Time library

http://www.arduino.cc/playground/Code/Time

and let it deal with the chip so I don't have to.

Good luck,

Chris
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6614
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If your Arduino has a crystal rather than a ceramic resonator, you can get away without using an RTC if you code carefully. However, you will lose the date/time whenever the power is disconnected or the device is reprogrammed. Therefore, using an RTC is highly recommended for this sort of project, because it provides battery backup.

There is another tutorial on using the DS1307 at http://www.ladyada.net/learn/breakoutplus/ds1307rtc.html.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49270
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
usb ports, one to plug it into the wall and another 2 to plug in my cell phone and kindle to charge, should be simple
An understand of what a USB port is, and how the Arduino interacts with them would be useful, too.
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a complete alarm clock project. Maybe you can take a look at my code. It has all the different alarms, such as weekdays weekends, once or else, plus super size numbers etc. Should be able to expand to what you need.

http://liudr.wordpress.com/shields/phi-2-shield/

All project codes are in the middle of the page under "Complete projects with code to get you started:"

You can either use loose parts, LCD, RTC, buttons, on a breadboard or get a phi-2 shield at ruggedcircuits.com or inmojo.com, which has everything on the shield. The shield comes in two sizes, 16x2 display and 20x4 display.
Logged


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks guys, I'll look into the RTC chip and figure out all I'll need to do with that. I think I'll just build it all on a breadboard and stick that in the box, probably the easiest and no need to make it super fancy.

Also, just to clarify, the USB ports are just for providing power to other devices and nothing more. I don't want to take up 3 power ports when I just need to take up one.

I also attached my list of things I need for the build, I already have an Arduino to donate to it and should have a box around here too. I was also thinking about doing a lexan box to put it all in, thought it might be pretty neat looking.


* alarm clock list.PNG (48.9 KB, 741x348 - viewed 29 times.)
« Last Edit: August 23, 2011, 06:04:57 pm by seth556 » Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks guys, I'll look into the RTC chip and figure out all I'll need to do with that. I think I'll just build it all on a breadboard and stick that in the box, probably the easiest and no need to make it super fancy.

Also, just to clarify, the USB ports are just for providing power to other devices and nothing more. I don't want to take up 3 power ports when I just need to take up one.

I also attached my list of things I need for the build, I already have an Arduino to donate to it and should have a box around here too. I was also thinking about doing a lexan box to put it all in, thought it might be pretty neat looking.

You will need some cabling to make the display loose from the breadboard for the breadboard is heavy or big and quite awkward for mounting inside a box. You can use an old 40-wire 40-connection IDE hard drive cable to free the display from the breadboard.
Logged


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I ordered everything and also a temperature sensor. I think I'm going to use original code for the most part, does anyone know of a program that I can use to virtually check my circuits and run the code? Basically to mock it all up.

Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't know. I suggest you test each part separately. What do you meanby original code? Yoi have something you didn't show us?
Logged


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just original code as in I'm not going to copy and paste someone elses code and call it done. I'd like to have a good coding exercise and do it up exactly how I want.
Logged

Pages: [1]   Go Up
Jump to: