Go Down

Topic: Arduino Alarm Clock (Read 2 times) previous topic - next topic

seth556

Aug 23, 2011, 05:45 am Last Edit: Aug 23, 2011, 06:13 am by seth556 Reason: 1
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.

magagna

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
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

dc42

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.
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.

PaulS

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.

liudr

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.

seth556

#5
Aug 24, 2011, 12:31 am Last Edit: Aug 24, 2011, 01:04 am by seth556 Reason: 1
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.

liudr


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.

seth556

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.


liudr

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

seth556

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.

Go Up