Arduino Sunrise Clock Radio

Hi everyone,

I'm just getting into the Arduino world (I've been playing around with the adafruit uno starter kit), and I was wondering if it's feasible to make an arduino powered clock radio, with sunrise alarm capabilities.

Ideally, the clock would have:

-Led matrix display (specifically the Sure 3208)
-Sunrise Alarm capability: slowly turning on a light over the course of about 20 minutes before audio alarm sounds. Possiby using this Velleman DC dimmer.
-Am (fm too if possible) audio alarm
-At least two alarm settings
-A light sensor to automatically dim the led display when the room is dark

I'm planning on using a Real Time Clock to keep accurate time, but I'm not quite sure how to pull off the other features.

Is this too much for an arduino to control? Would it be more cost effective (or possible) to modify an existing clock radio?

Thanks for your advice!

Is this too much for an arduino to control?

Perfectly within the capabilities of an Arduino.

Would it be more cost effective (or possible) to modify an existing clock radio?

Probably. I don't know about the "at least two alarm settings" part. Also, I did not see a commercial alarm clock with the 3208 LED display yet.

-Sunrise Alarm capability: slowly turning on a light over the course of about 20 minutes before audio alarm sounds.

I built something like that about a million years ago with another microcontroler. It still works great! I built my own dimmer with a TRIAC and a TRIAC-driver opto-isolator. But I took a shortcut, and did not include a real-time clock. It plugs-into an external AC timer-switch ([u]X-10[/u]* controlled). My dim-up time is 10 minutes.

Prior to this, I had built an alarm clock with a switched AC outlet (from an all-in-one) clock/display module. But as best I remember, the sunrise simulator has always run off an X-10 module.

And, since I hate waking-up... I built another little box that plugs-into the same AC timer. It turns-on and does nothing for 10 minutes. After the lamp is at full-brightness, it makes a little-gentle "beep". 30 seconds, it makes another "beep". It beeps every 30 seconds and it counts the minutes, so after 3 minutes I get a "beep-beep-beep" (3 beeps again at 3:30). I think it counts up to 15 minutes and then shuts off.

Of course I could have built both of these functions into one box with one microcontroller, but I had never made a digitally controlled dimmer before and I wanted to keep the projects as simple as possible, even if I had to buy twice as much hardware.

If I were starting-over today, I'd do both functions with one microcontroller, but I'd probably still avoid the real-time clock and I wouldn't build my own radio. To me, it's not worth putting hours-and-hours into building stuff that I can buy rather cheaply.

  • With some of the newer X1-10 or X1-10 compatible modules, I believe you can program them to dim-up slowely, or dim-up in steps over a period of time. In that case, you wouldn't need to build anything! The older modules would always turn-on to 100% and then dim-down to the command setting.

Is this too much for an arduino to control?

The alarm clock part, no. The radio part? Could be challenging. I haven't seen much on the forum about radio shields.

PaulS:

Is this too much for an arduino to control?

The alarm clock part, no. The radio part? Could be challenging. I haven't seen much on the forum about radio shields.

Provided the shield in question has on-board ICs specifically handling the radio tuning and audio generation that can communicate serially with the Arduino, it shouldn't be any more challenging than controlling a serial LCD board.

FM/AM Radio shield
SI4735 AM & FM Receiver Shield - DEV-10342 - SparkFun Electronics?

"Basically it's an entire AM/FM, LW/SW radio in a single chip.

Now that we've mounted it on a shield, you can harness all of that sweet radio-playing power right from your Arduino. Simply stack the shield onto your Arduino board, plug in some speakers (headphones don't seem to work as well without a preamp) and use the library below to control the volume, channel selection, etc. The library also allows you to send a variety of other commands constructed by consulting the Si4735 Programmers Guide."

Thanks for all the replies!

To clarify, by "at least two alarm settings" I meant that I would prefer to have two different alarms, a weekend and a weekday alarm for example, that I could leave set to different times and then be able to switch back and forth without manually changing the alarm time.

@DVDdoug, your clock sounds cool! I agree, I would like to try to integrate everything with one microcontroller. The x-10 modules are interesting, but I'm afraid I know very little about them. Do you know of a specific unit that can slowly dim-up? I tried my luck googling, but I couldn't find the right thing.

@Crossroads: Thanks for the tip on the FM/AM shield. It looks like it's the right tool for the job, if a little pricey.

Does anyone know of any pre-existing code to get some of the pieces working together? For example, how to interface the radio shield with the arduino, some pushbuttons, and to display the frequency on the LED matrix? I'm afraid I'm very new to programing.

Also, I'm not sure what the right approach is to get this project going. Is it a good idea to go step-by-step as I integrate each feature? For example, should I start with the RTC and the matrix, and work on getting the time displayed correctly before adding the sunshine alarm and the radio, or is better to integrate everything all at once? I guess I'm looking for a place to start.

Thanks!

It occurs to me, that rather than trying to do AM/FM radio in the Arduino, that another solution is to use an X-10 controller or an A/C relay switch, and just enabled power to a radio at the appropriate time. You could have various buttons to control the power to the radio in the Arduino.

should I start with the RTC and the matrix, and work on getting the time displayed correctly

This should be a good start:

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.