Arduino Sunrise Clock Radio

BTW, an alternative to the RTC if you have the Arduino on your network (either with an ethernet shield or wifi) is to use the Network Time Protocol: http://arduino.cc/en/Tutorial/UdpNtpClient.

an alternative to the RTC if you have the Arduino on your network (either with an ethernet shield or wifi) is to use the Network Time Protocol

That would also make the project at least $30 more expensive :slight_smile:

florinc:

an alternative to the RTC if you have the Arduino on your network (either with an ethernet shield or wifi) is to use the Network Time Protocol

That would also make the project at least $30 more expensive :slight_smile:

Yes, but if the OP has his music collection stored in a format that can be easily delivered to other PCs in the house, you could eliminate the AM/FM radio, and just play random tunes. Or you can stream the broadcast from various radio stations.

"Is it a good idea to go step-by-step as I integrate each feature?"

Yes indeed. Be easier to learn as you go that way also. May end up backing up & re-doing stuff, all part of the learning process.
The AMFM radio shield had links to software to go with it.

Okay, thanks for all the tips guys. I've ordered the RTC and the LED matrix, so I'll get started on putting those together once they've arrived.

At this point I'm leaning more towards the radio shield, as I often prefer to wake up to the news, and I don't want to have to rely on an internet connection. Also, while the x-10 idea is tempting (and I'm not ruling it out), ideally I want to keep the system fairly self-contained.

Again, thanks for the info/links.

I'm sure I'll be back with more questions.

I want to keep the system fairly self-contained.

Even with X10, you can use this wireless X10 transmitter:
http://www.arduino.cc/playground/X10/CM17A

Hey everyone, I have an update, with more questions. Let me know if this is the wrong venue for these questions!

I successfully acquired my RTC, LED matrix, FM Shield, and a few other things, and now I'm working on getting the RTC and the Matrix to play nice together.

I'm using Florinc's Bookclock code, which seems like a good jumping off point (link here). But I'm wondering which pins in that code are meant to be hooked up to the matrix? I've used this resource to successfully test the matrix before, but I do not know if I should change which digital pins I'm using.

Also, can anyone tell where the buttons need to be hooked up to? I'm a novice at deciphering code.

Thanks!

TopTube:
Also, can anyone tell where the buttons need to be hooked up to? I'm a novice at deciphering code.

In the code you linked to, the buttons are on pins 16 and 17 which are alternative names for A2 and A3 (since the Analog Input pins can also be used for general digital I/O). The button on A2 (pin 16) is the incrementing button, while the one on A3 (pin 17) is the menu button.

Thanks, should I use a pull up or a pull down resistor with those pins?

I'm also wondering how to make the RTC be recognized by the arduino, as it seems the Wiseduino for which this code is meant for has the RTC integrated, and therefore doesn't specify which pins it needs to be hooked up to. Any advice would be greatly appreciated!

MichaelMeissner:
BTW, an alternative to the RTC if you have the Arduino on your network (either with an ethernet shield or wifi) is to use the Network Time Protocol: http://arduino.cc/en/Tutorial/UdpNtpClient.

Another alternative (if you live in Europe or North Americas) is a time signal receiver, for example http://www.pvelectronics.co.uk/index.php?main_page=product_info&products_id=2.

TopTube,
You connect the DS1307 RTC to your Arduino on I2C, as shown in the datasheet:
http://datasheets.maximintegrated.com/en/ds/DS1307.pdf
SDA and SCL are pins A4 and A5 of your Arduino, respectively.
You need 10k resistors as pullups on these 2 pins. Backup battery is also necessary, as is a 32kHz crystal.

@dc42

Thanks for the tip, a time signal receiver would certainly be cool, but I'm pretty committed to going the ds1307 route.

@florinc

Thanks! I now have the RTC displaying the correct time on the serial monitor! So far I haven't been able to get the matrix to light up (besides with test code). I don't have a tilt switch of any kind hooked up, and the serial monitor reads "current state is 0". Could that be preventing the display from lighting? I also haven't been able to upload the "quotes" text file (I'm on a mac). Maybe that's the issue?

I'm also having trouble with the setup buttons, should I wire them (with pull-up or pull-down resistors) as always high or always low? I couldn't tell from the code. Thanks for your help!

Connections to the display are as follow (copied from the code):

#define HT1632_DATA     6    // Data pin (pin 7 of the display)
#define HT1632_WRCLK    7    // Write clock pin (pin 5 of the display)
#define HT1632_CS       8    // Chip Select (1, 2, 3, or 4 of the display, depending on the ON switch)

You can force the position of the tilt in the code, in function loop().
The buttons are on pins A2 and A3. These 2 pins should also have 10k pullup resistors to Vcc.
I think the first thing for you is to get the display working. You could use this (simpler) test program:
http://code.google.com/p/wiseclock2/downloads/detail?name=Test_3208.pde&can=2&q=#makechanges

florinc is correct the resistors should be in pullup configuration, and 10ks will be fine.

I now have the buttons hooked up properly (I believe), and I connected the arduino anolog zero pin to vcc, which seemed to calm the endlessly scrolling "current state = 0" in the serial monitor.

I'm still not having any luck with the led matrix. The test code you posted won't work for me, I got a number of errors when trying to compile it, one of which is that "DEBUGPRINT is not declared in this scope" Am I missing libraries for it? The normal bookclock code compiles and uploads without issue.

I have had success with the test code found on this page, with the outputs changed to match the pins used by the bookclock.

Here are some pics of the serial monitor and my breadboard setup, if they're any use.

Delete the line(s) with DEBUGPRINT.
Did you set correctly the switch (on the back of the display) for CS2?

Thanks for the reply! Yeah, I did select the correct chip on the matrix (tried a few different configurations, too). I'm still having trouble with the test code, I deleted all the DEBUGPRINT lines, but now I have this error: "Documents/Arduino/libraries/myfont/myfont.h:9: error: expected initializer before 'myfont'"

I wish I knew what that meant, should I edit the myfont document somehow?

Hey everyone, I thought I would unearth this thread to ask for some more guidance. I recently had time to work on the project again, and I'm still having issues with the code.

I managed to get florinc's test code working for the 3208 (so the matrix works), but I still get nothing from to bookclock code that I'm using. The bookclock code compiles, and the time is displayed in the serial monitor, but the display still refuses to light up.

Anyone have any ideas?

Anyone have any ideas?

Post your code?

I'm using Florinc's Bookclock code, on a arduino uno rev. 3. The code is too long to post in a forum reply, but here's a link to it: Google Code Archive - Long-term storage for Google Code Project Hosting.