Pages: 1 [2] 3   Go Down
Author Topic: Simple easy programmable muliti day alarm clock.  (Read 5799 times)
0 Members and 1 Guest are viewing this topic.
Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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().
Logged


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

Liudr,

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

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

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

Quote
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 smiley 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 smiley)))

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.

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


Oz
Offline Offline
God Member
*****
Karma: 4
Posts: 703
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?


Logged

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

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


Oz
Offline Offline
God Member
*****
Karma: 4
Posts: 703
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

The cat 5 wires are relatively hard to handle compared regular hookup wires. My suggestion is to mount a cat 5 female socket on phi-2 shield, mount another one on a cat-5 breakout board inside the box with the GPS and run a cat 5 wire with connectors on each end. You can get cat 5 wires with connectors relatively cheap on ebay or on local craigslist.
Logged


Oz
Offline Offline
God Member
*****
Karma: 4
Posts: 703
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Argh, this is frustrating.

Dr Liu,

I worked out what you meant and so went in and edited the SKETCH.

I changed the < > to " " and clicked compile.

Alas this is what I got - well I got a lot more, but this is the part of interest just now:

C:\Program Files\arduino-1.0\libraries\Phi_2_testing_v2\DS1307.cpp:7:24: error: WProgram.h: No such file or directory
In file included from C:\Program Files\arduino-1.0\libraries\Phi_2_testing_v2\DS1307.cpp:9:
C:\Program Files\arduino-1.0\libraries\Phi_2_testing_v2\/DS1307_1.h:12:25: error: WConstants.h: No such file or directory
In file included from C:\Program Files\arduino-1.0\libraries\Phi_2_testing_v2\DS1307.cpp:9:

Alas the .cpp files are text, but opening them with NOTEPAD is painful.
I shall have to try and get WORDPAD to open them, but this is not as easy as I would like.

Anyway:
WProgram.h

Ok, went looking.

No where.

Attached is a screen shot of all the libraries I have.  Don't worry about the path, this is just one of my copies.

Not trying to be difficult, but I am puzzled by how these < > and " " work.

Ok, " " around the INCLUDE makes the program to look in that directory for the files - relative.
And < > seems to point it.....   Where?
Where is this path specified?
Can I change it?



* Arduino libraries.JPG (176.58 KB, 1152x864 - viewed 22 times.)
Logged

Oz
Offline Offline
God Member
*****
Karma: 4
Posts: 703
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry for the multiple replies.

I am posting as I find problems.

In your reply about the buzzer output you said:
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().

Looking through the code I can't find the:  tone() function.

Obviously it is in another file, but which one?  (Semi-rhetorical.)

I shall have to work out how to make WORDPAD the default program for these files.

Logged

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

OK, I don't see the phi_2_alarm project code. Did you download it yet?

http://code.google.com/p/phi-prompt-user-interface-library/downloads/detail?name=Phi_2_project_alarm_clock_v5.zip&can=2&q=

I see that you downloaded the phi-2 testing v2. It was not compatible with arduino 1.0 but don't worry. I just made it compatible with the V3 so discard the V2 and get the V3:

http://code.google.com/p/phi-prompt-user-interface-library/downloads/detail?name=Phi_2_testing_v3.zip&can=2&q=#makechanges

The arduino IDE upgrade to 1.0 has put a lot of work on all library writers. I have half a dozen library code and sample codes are still being updated.
Logged


Oz
Offline Offline
God Member
*****
Karma: 4
Posts: 703
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, it is my lack of understanding of where to put things which is not helping.

If you see from the screen shot, I do have that SKETCH, but it is up a few levels.

Somewhere I read that the libraries need to be in "sketchbooks/libraries/....."

So that is where I put them.

I didn't resolve where to put the actual SKETCH, so I just put it in the arduino directory.  Yeah, they probably should go in the sketchbook directory but I haven't got my head around the names/paths part yet and obviously am still having trouble.

So reading the reply, I need to put the alarm sketch in the sketchbook directory and compile from there - standbye.

Well, that didn't work.  Same error.  This WProgram.h file is still missing.

Here is a better layout of the directories.
You can see the arduino/sketchbooks/ and the alarm clock directory (the bottom arrow) and the libraries with the PHI libraries in there.

I'm really not getting the directory layout part I know.




* alarm clock path.JPG (215.85 KB, 1152x864 - viewed 22 times.)

* Directory structure.JPG (117.26 KB, 1152x864 - viewed 21 times.)
Logged

Oz
Offline Offline
God Member
*****
Karma: 4
Posts: 703
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good news!

I can compile the sketch.

Now, I just have to buy the PHI-2 and display and actually start to build it.

Logged

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

Good news!

I can compile the sketch.

Now, I just have to buy the PHI-2 and display and actually start to build it.



Good for you! I've been busy with my work and didn't have time to do a screen shot of my folders.
Logged


Oz
Offline Offline
God Member
*****
Karma: 4
Posts: 703
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Way back near the top a "variable brightness" was mentioned for the LCD.

I am about to complete building my alarm clock and have the same problem.

On the PHI-2 shield, there is a position for the backlight brightness resistor.

What I am thinking of doing is building a VCO which is controlled by a LDR.

As it gets darker, the frequency reduced.  As it gets lighter/brighter, the frequency increases.

That way the backlight adjusts to the ambient light.

The "VCO" would simply be a 555 as an astable oscillator with the LDR controlling the frequency.

Logged

Oz
Offline Offline
God Member
*****
Karma: 4
Posts: 703
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a couple of piccies of the project to date:

Yes, it isn't fully built - as in there are no switches, or LEDs, but it "works" - as in the display shows things and the menus work.

The time, however, doesn't work.

Excuse the blurriness, but camera shake happens.

The board is a "UNO COMPATIBLE" and so I hope that the straps are correct.

Notice the time!  Weird.

I compile the sketch with the correct-ish time set and send it to the board.  Then re-compile it and send it again with the clock init() thing disabled.

Same result.

Going through the motions of setting the time doesn't change anything.


Other notes:
For now there is no EPROM, no RTC chip and no battery.

Do I really need these to simply make the clock work?


* The straps.JPG (112.13 KB, 1024x768 - viewed 22 times.)

* The time.JPG (92.46 KB, 1024x768 - viewed 18 times.)
Logged

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

I need to see under the display. The jumpers were in the right places already. Was that you who posted on my blog saying inserting an EEPROM solved the problem? I'd like to that if that was you. There's no need for such optional part. The EEPROM that stores alarm was inside your arduino.
Logged


Pages: 1 [2] 3   Go Up
Jump to: