Simple easy programmable muliti day alarm clock.

I have an Arduino Uno, a 16X4 lcd, a 3X4 numeric keypad.
I need to build an alarm clock that can store different alarm times for each day of the week.
I’d like to be able to set the time via the keypad and have the lcd show the time and date and control the brightness but I would also like to control some sort of radio or mp3 player.

Can this be done with and Arduino Uno.

Yes. Get yourself an RTC chip too, make it even easier. Install it on a protoshield with some transistors or relays to control the radio or MP3 buttons.

Check out my alarm clock on my blog. liudr.wordpress.com search alarm clock. Source code is on the blog.

http://www.youtube.com/watch?v=r7r4W9s27d4

Liudr,

That is so close to what I want.

I went to your site but as I am new to this, I couldn't find the sketch for the project.

lost_and_confused: Liudr,

That is so close to what I want.

I went to your site but as I am new to this, I couldn't find the sketch for the project.

My site no longer host any code. Everything is on google code. Search phi_prompt user interface library in code.google.com and find the code in downloads. I'm typing on an iPad. It's too hard to copy paste you a link. Should have bought a real computer with the money.

While I have you though, couple of questions:

1 - The display looks/seems/is different to the one I bought. I bought the main board - an Etherten - and a display as t was obvious I would need one. But mind is only a 2 line display. In your example it is a 4 line.

2 - As ther is now an RTC available for the Arduino, I want to get one - though just now I realise/think it doesn't have a battery, so what's the point? - I don't know how it would "fit" into what you built.

3 - (I can't count) Is there a "spare pin" which is an "alarm status output"? That is: A pin which goes high when the alarm is active? Actualy a couple of spare pins would be nice. And it begs another question:

4 - How long is the alarm active?

Oh, P.S. This phi_shield....

Which I take it goes between the main board and the display.

I take it I buy it from you?

Thanks, got the Sketch for the clock.

I am really going to make a fool of myself how.

I am reading the instructions at the top of the sketch and it tells me to download the libraries - fair enough - and put them in arduino\sketchbooks\libraries.....

I'm confused.

Slight problem: When I downloaded the arduino program it unzipped into "arduino-1.0" which is in C:\program files The sketchs I make/get/what ever are in "My documents\arduino"

So where do these files go? In the program's directory or the My documents part?

I can try both in the mean time.

Oh, and should I re-name my "main" directory from arduino-1.0 to just arduino?

lost_and_confused:
While I have you though, couple of questions:

1 - The display looks/seems/is different to the one I bought.
I bought the main board - an Etherten - and a display as t was obvious I would need one.
But mind is only a 2 line display. In your example it is a 4 line.

2 - As ther is now an RTC available for the Arduino, I want to get one - though just now I realise/think it doesn’t have a battery, so what’s the point? - I don’t know how it would “fit” into what you built.

3 - (I can’t count) Is there a “spare pin” which is an “alarm status output”?
That is: A pin which goes high when the alarm is active?
Actualy a couple of spare pins would be nice.
And it begs another question:

4 - How long is the alarm active?

  1. Mine has 20X4 characters and your probably has 16X2. No problem. The program automatically fits on your display. All you need to do is to set the display size in two lines of code.
  2. My RTC is on board my phi-2 shield, which has a battery backup so time is not lost even you power off arduino.
  3. Yes, the buzzer pin is turned on with tone() when alarm turns on. You can add other stuff, say turn pin 9 to high and pin 10 to low if you want, in the alarm code in addition to turning on the buzzer.
  4. It’s active until you turn it off, so annoying, yes, that’s the purpose :slight_smile:

lost_and_confused: Oh, P.S. This phi_shield....

Which I take it goes between the main board and the display.

I take it I buy it from you?

If you want a larger display, get the phi-2 shield with 20X4 display you can get it from ruggedcircuits.com or inmojo.com (directly from me):

https://shop.ruggedcircuits.com/index.php?main_page=product_info&cPath=4&products_id=39&zenid=605f54df16ca2b5e432e1d2917cb6519

http://www.inmojo.com/store/liudr-arduino-and-physics-gadgets/item/phi-2-interactive-arduino-shield-2004/

If you want to use a more compact design, get the phi-2 shield with 16X2 display:

https://shop.ruggedcircuits.com/index.php?main_page=product_info&cPath=4&products_id=40

http://www.inmojo.com/store/liudr-arduino-and-physics-gadgets/item/phi-2-interactive-shield-for-arduino/

lost_and_confused: Thanks, got the Sketch for the clock.

I am really going to make a fool of myself how.

I am reading the instructions at the top of the sketch and it tells me to download the libraries - fair enough - and put them in arduino\sketchbooks\libraries.....

I'm confused.

Slight problem: When I downloaded the arduino program it unzipped into "arduino-1.0" which is in C:\program files The sketchs I make/get/what ever are in "My documents\arduino"

So where do these files go? In the program's directory or the My documents part?

I can try both in the mean time.

Oh, and should I re-name my "main" directory from arduino-1.0 to just arduino?

The "Phi_2_project_alarm_clock_v5" folder goes to where you store your arduino sketches, for example (where your arduino 1.0 is)\sketchebookks\ so you will have a (where your arduino 1.0 is)\sketchebooks\Phi_2_project_alarm_clock_v5\ folder with the program files in it.

The libraries go into (where your arduino 1.0 is)\sketchebooks\libraries\ since they are contributed libraries so you will have these folders: (where your arduino 1.0 is)\sketchebooks\libraries\phi_interfaces\ with phi_interfaces.h directly under this folder (where your arduino 1.0 is)\sketchebooks\libraries\phi_prompt\ with phi_prompt.h directly under this folder ...

Just do make (where your arduino 1.0 is)\sketchebooks\libraries\phi_prompt\phi_prompt\, where you have two layers of folders both called phi_prompt.

(We maybe should take this to another post or message eachother.)

Ok thanks.

There was no "sketch" folder made when I unzipped the arduino file, and nothing in the "my documents\arduino" folder either, so I am going to have to do some moving.

The libraries folder is simply in the arduino-1.0 folder not arduino-1.0\sketches.

Anyway, I'll work it out now I hope.

I bought the display - as it was kind of needed when I bought the arduino board for the alarm clock. So as your menu system allows 2 line displays, well, I shall live with that.

I'll look at the links you supplied and get to order the phi-2 shield, and RTC.

I am going to get the code printed out and the libraries so I can read, study and maybe learn what is going on.

This is important to me as my alarm clock is pretty well dead in the water and I need a working alarm clock. Mine is somewhat modified to do extra things which I am sure the arduino can/will do in the future once I get it working.

Yikes!

Well, not really.

Looking at your link, the display withthe Phi-2 board is different.

My display which bought already has the buttons/switches on it. It is a “legitimate” board from freetronics.

I shall get a piccie of the display I have and post it.

In the mean time I may talk to the guys where I got it and see if something can be worked out.

The “buzzer” output is simply a buzzer, not a pulsed output to make the noise - right?
So I could simply unplug the wire to the buzzer and put it else where to do other things.

Liudr,

I went to your site and posted a couple of things there, and they now seem to be gone.

:(

Looking at the Phi-2 instructions, I found a couple of "faults" - luckily minor ones.

I don't think here is the place to specifically mention them, can you help me with a method of pointing them out?

Couple of other questions - I shall hope to buy the shield from you soon, but need more things clarified.

I notice the shield has buttons on it. I bought a LCD shield as I have mentioned and it too has buttons. Kinda defeats the purpose if there are two sets of buttons. I dug up an old LCD display I bought, it is a LCM-5044, or GEB-2294V-0 S. Suffice to say is it a BIG display.

Could/would it work with the adrino and your shield?

The GPS module would be nice and handy to use as a time sync. Every now and then I would/could poll it and get the time and then re-set the clock to the right time. I'll take it that this would be possible, but there is a problem with location. The clock would not be near a window or have a good sky view. So the GPS module would have to be remotely connected. Say 5 metres distance. Cat 5 cable and a small box? I would wire up another RJ45 socket and plug it in - but am looking for thoughts if this woud/could work.

There is also now (I hear) cards to play MP3 sounds from a small SC card. Could one of these also be included to play a sample when the alarm goes off?

I feel there won't be enough I/O lines to do all this, but I would like to get a feel for what the unit can do before I get my hopes up too high.

lost_and_confused: I'll look at the links you supplied and get to order the phi-2 shield, and RTC.

The phi-2 shield includes an RTC :)

lost_and_confused: Looking at your link, the display withthe Phi-2 board is different.

My display which bought already has the buttons/switches on it. It is a "legitimate" board from freetronics.

I shall get a piccie of the display I have and post it.

In the mean time I may talk to the guys where I got it and see if something can be worked out.

The "buzzer" output is simply a buzzer, not a pulsed output to make the noise - right? So I could simply unplug the wire to the buzzer and put it else where to do other things.

It seems like the freetronics shield has a blue display and mine just has a different color but it has more stuff on it, buzzer, RTC, connections to other stuff.

Yes you can connect the buzzer output to say a powerful motor to lift your bed if you want. Make sure you change the code to use say digitalWrite(buzzer,HIGH) instead of tone().

lost_and_confused: Liudr,

I went to your site and posted a couple of things there, and they now seem to be gone.

:(

They are in the pending-review folder. I'll post replies to them after I'm done here on this thread.

Looking at the Phi-2 instructions, I found a couple of "faults" - luckily minor ones.

I don't think here is the place to specifically mention them, can you help me with a method of pointing them out?

Couple of other questions - I shall hope to buy the shield from you soon, but need more things clarified.

I notice the shield has buttons on it. I bought a LCD shield as I have mentioned and it too has buttons. Kinda defeats the purpose if there are two sets of buttons. I dug up an old LCD display I bought, it is a LCM-5044, or GEB-2294V-0 S. Suffice to say is it a BIG display.

Could/would it work with the adrino and your shield?

That display seems to be 40X4 and my code only works up to 20X4. The connection is also slightly different so won't fit.

The GPS module would be nice and handy to use as a time sync. Every now and then I would/could poll it and get the time and then re-set the clock to the right time. I'll take it that this would be possible, but there is a problem with location. The clock would not be near a window or have a good sky view. So the GPS module would have to be remotely connected. Say 5 metres distance. Cat 5 cable and a small box? I would wire up another RJ45 socket and plug it in - but am looking for thoughts if this woud/could work.

Good idea. You have to have the GPS with open sky to lock to a signal. On the other hand, GPS only reports the standard time at zone 0 so you need some conversion to get your local time :) I have not made a "remote" GPS but I suppose it would work. A GPS works at 5V and outputs slow serial data so a few meters it not problem, just don't let the wire near any source of noise, like a halogen desk lamp base. It's a transformer. Every time I turn that thing on, it knocks off my keyboard and mouse, connected to unshielded USB extension wires :))))

You will have to cut the wire to the GPS connector or purchase one connector with bare lids on one end and connector on the other end.

There is also now (I hear) cards to play MP3 sounds from a small SC card. Could one of these also be included to play a sample when the alarm goes off?

I feel there won't be enough I/O lines to do all this, but I would like to get a feel for what the unit can do before I get my hopes up too high.

I will have to look at what MP3 shield you want to use. I'm also a bit concerned with number of pins. I imagine the MP3+SD card shield will use up at least 5 pins, LCD 6 pins, RTC 2 pins, GPS serial 2 pins, buzzer output 1 pin, buttons, 6 pins, upload sketch 2 pins, more than arduino UNO can have. You could, purchase a serial LCD keypad backpack so save the LCD and button pins. My current phi-panel backpack can do that. You will need to modify the program then.

Thanks very much for the reply.

I only mentioned the display I have as a POSSIBlE alternative.

What I was thinking of doing with the GPS is get some wires and "extend" the existing pins and put them onto an RJ45 socket.

That would go onto the side of the box - eventually. Then I get some CAT 5 cable and run that to another small box with the GPS unit in it.

I may probably go with your 20x4 display to keep it simple.

The next project which needs a display may get to use the display I have.

I am still a bit stuck with getting the alarm clock code to compile just for the sake of learning how it all works.

Can't I just put all the files in one directory and compile from there?

lost_and_confused:
Thanks very much for the reply.

I only mentioned the display I have as a POSSIBlE alternative.

What I was thinking of doing with the GPS is get some wires and “extend” the existing pins and put them onto an RJ45 socket.

That would go onto the side of the box - eventually.
Then I get some CAT 5 cable and run that to another small box with the GPS unit in it.

I may probably go with your 20x4 display to keep it simple.

The next project which needs a display may get to use the display I have.

I am still a bit stuck with getting the alarm clock code to compile just for the sake of learning how it all works.

Can’t I just put all the files in one directory and compile from there?

Yes you can put all files in the same folder and change #include <phi_prompt.h> into #include “phi_prompt.h” etc.

Could you give me a screen shot of the directories where you stored your files?

BTW, the cat 5 wires are meant to be crimped to connectors. They are impossible to solder. You will need cat 5 sockets and cat 5 breakout boards inside your external box. At the moment the cat 5 sockets are not included in the phi-2 shield kits. I still have several in stock though. Here is the type of sockets:

https://secure.dipmicro.com/store/TYCO-5555164-1

If you want a few (at least 2 is needed), just order the kit from inmojo.com and order say $2 of custom parts to pay for 2 sockets.

The directories:
Well I un-zipped the files and just had them in a nominal directory.

I then moved them to the “my documents\arduino” directory but that didn’t work either.

Alas I shall have to parse the instruction:
Yes you can put all files in the same folder and change #include <phi_prompt.h> into #include “phi_prompt.h” etc.

a bit more.

As I am not familair with what are actual characters and what are highlites it has me confused.

Don’t worry. I am sure I will make sense of it when I get home.

WRT the CAT-5 connector:

What I was going to do is get some wire - which plugs into the top of the “pins” on the PHI-2 card. Then run them to a CAT_5 socket and crimp them to the FEMALE socket which would then be mounted on the box side allowing the male one to plug in with the GPS module then connected to that.