Go Down

Topic: Arduino Sunrise Clock Radio (Read 13646 times) previous topic - next topic


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.



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!


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


You connect the DS1307 RTC to your Arduino on I2C, as shown in the datasheet:
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.



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


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):
Code: [Select]
#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:


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?
The art of getting good answers lies in asking good questions.


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: http://code.google.com/p/wiseclock2/downloads/detail?name=BookClockTimeSet.zip&can=2&q=

Go Up