Alectruino - An Arduino based alarm clock

As my first large-ish project with the Arduino I’m working on an alarm clock with a sunrise simulation.

I’ve started by getting a real-time clock (a DS1307) set up and displaying the current time on a LCD.

A simple start but hopefully leading to great things.

I’ve also got a post up on my blog with another picture and the very basic code. It’s essentially just a copy and paste from other people so I won’t include it here.

Tell you what. If you should manage to build an alarm clock that wakes me up - reliably - I'll pay for it ;-)

Can I ask where the name came from? Sounds like something that electrocutes you if you don't wake up (although, I suppose that'd be "Electruino") ;D!

Tell you what. If you should manage to build an alarm clock that wakes me up - reliably - I'll pay for it

A bucket of ice-water suspended above your bed, with a stepper motor to wind up a pull cord. Yes, I think we could program an Arduino to manage this. :)

madworm, in my opinion an alarm clock that reliably wakes you up is relatively easy as long as it doesn't need to be pleasant. It's getting something which isn't too unpleasant to work reliably which is the hard bit. We'll see how this approach works.

Edit: Between TchnclFl and PaulS we've definitely got a reliable method of waking up sorted. ;D

TchnclFl, I'm fairly bad at coming up with names spontaneously so frequently look to Greek and Roman gods for inspiration. In this case Alectrona.

TchnclFl, I'm fairly bad at coming up with names spontaneously so frequently look to Greek and Roman gods for inspiration. In this case Alectrona.

Creative!

I probably should've realized that...We're studying The Odyssey in school. Ah well, I love thoughtful names ;).

Ice water, eh ?

There are several problems with this:

a) It's just cruel and could kill me. b) Who fills the bucket ? Certainly not me. c) Even if it should wake me up temporarily, I'd just get a warm shower and go back to sleep. After I've made sure the bucket gets to meet Mr. Sledge Hammer.

Although I might stay awake after having used Mr. Sledge Hammer extensively on the bucket. 365 buckets a year... nah.

But your bedsheets and matress are soaked in cold water.,so it would still be pretty unpleasant.
And about the killing you part, wear a snorkel?
And the filling: the arduino, of course! Just a valve and pipes from a water source.

@madworm: maybe you want to give this one a try ;)

As someone who can also be difficult to fully wake (I've even fooled people who were convinced I was fully up and alert through wake-up phone calls of which I had absolutely no memory), one of the approaches I've considered is adding a keypad. The alarm would only turn off if the user entered a string of random digits shown on the display. That prevents the development of habits that make it possible to shut off the alarm while asleep.

As someone who can also be difficult to fully wake (I've even fooled people who were convinced I was fully up and alert through wake-up phone calls of which I had absolutely no memory), one of the approaches I've considered is adding a keypad. The alarm would only turn off if the user entered a string of random digits shown on the display. That prevents the development of habits that make it possible to shut off the alarm while asleep.

Cool idea! I've also found that when I'm tired, I can't read nearly as well until I get up. That way, one would have to get up for the numbers to be readable :P.

On a side note, I have my alarm across the room, so I'm forced to get out of bed to turn it off ;D!

The alarm would only turn off if the user entered a string of random digits shown on the display. That prevents the development of habits that make it possible to shut off the alarm while asleep.

There is one that makes you do math to get the alarm to stop. http://blog.makezine.com/archive/2008/02/alarm_clock_makes_you_do.html

Uses a PIC but IT could be done with an Arduino.

I set this up with the LED light panel for the first time last night. It seemed to be working well so I left it set up across the room from my bed to go off this morning. It's a lot brighter than I had expected. The brightness of it actually woke me up before my alarm went off.

One thing I have noticed is that the brightness appears to ramp up much more quickly than I am increasing the power. I've heard that the human eye responds exponentially to brightness so I may need to adjust my code to take that into consideration.

As someone who can also be difficult to fully wake (I've even fooled people who were convinced I was fully up and alert through wake-up phone calls of which I had absolutely no memory), one of the approaches I've considered is adding a keypad. The alarm would only turn off if the user entered a string of random digits shown on the display. That prevents the development of habits that make it possible to shut off the alarm while asleep.

There's an app for windows mobile devices called G-Alarm: you can set it to force you to do some arithmetic or guide a ball through a maze before it shuts off.

Nice going Streety.

I am just starting to read up on Arduino for the reason of wanting to build a sunrise alarm clock. Ordered myself an arduino starting package.

Currently I'm only able to solder components to a board, without knowing why they are supposed to go there. But hope to learn from your project.

Any chance you got some more photo's, possibly a components list and a schedule ?

Hello Kaag2000,

It's nice to hear someone else is working on a similar project. At the moment it is set up on the desk across the room from my bed with the circuit spread across two breadboards and the LEDs soldered onto a piece of stripboard. It works well and I've been using it each morning but it isn't practical long-term in its current form. My current priority is getting a suitable enclosure for it.

I don't have the details with me at the moment to give a more complete report but I'll aim to put something more useful together over the next few days.

I'll aim to include a circuit diagram and a list of components. Is there anything else you want to know? Let me know and I'll try to answer/include it.

WOW ! Looking good!

hehe, the starter kit I order includes just a mini breadboard.... Well I do have an old stripboard and LCD lying around.

When you have come as far as transforming thought to a working system, the enclosure should be little trouble for you.

I have 2 solid 30 cm RGB led bars designated for this project and will be mounting them on a narrow plank against the wall above my bed, so the LED's will be aimed at the ceiling. I'll only see the underside of the plank itself and I can work away all components in a box that'll go in the middle of that plank.

The ledbars came with a control unit with a remote control, I'll try to use that remote control to program to set the alarm and turn on / off the light.

One goal I have is to start the lights in a red color, and lettign it shift to blue, simulating sunrise and the other way around in the evening. probably way too complicated, but we'll see how far I'll come.

Your project is a good inspiration.

I was tempted to put a schematic together using fritzing but looks like that is going to take more time than I currently have available so it will have to be photos.

Since my last post I've added an extra breadboard so I can have some buttons. The idea being I'll be able to set the time, alarms etc without plugging the clock into my computer. I've also added a buzzer. I'm at the point now where I'll need to use the serial data pins if I want any more digital pins. Luckily I don't think I need any more. Unfortunately I still want one more to turn the LCD backlight on/off.

This is everything. I'll go into detail for the individual boards below. The LCD panel and the DS1307 I've already discussed and they're just following the tutorials. Note the cunning use of solder to prop up the board. ;)

This the breadboard with the 4 buttons. Each is supplied with 5V through the orange wires. The blue and pink wires connect with the arduino. Each button has a pull-down resistor connected to ground to prevent erroneous readings.

This breadboard has the buzzer and the control circuitry for the LED panel. Both require 12V. This board is connected to the 12V supply directly via the two jumper cables and a couple of resistor or LED legs stuck into the holes. The arduino board is supplied with power from the green and pink wires at the bottom right. The buzzer is controlled with a 2N2222A NPN transistor and the LED panel with a ZTX651 NPN transistor. Each transistor is coupled to the arduino through a 2.2K resistor. I've stuck an electrolytic capacitor into the power rail at the top to, hopefully, prevent any problems with noise.

This panel has 60 LEDs and a number of resistors to ensure the voltage isn't too high for any of the LEDs. Rigging these up on the stripboard was a real pain. I had a number of shorts which burned out some of the LEDs. There is still one broken LED in the circuit which I need to replace. A printed circuit board for this would have been really nice.

So you havent stopped tinkering huh. Any chance you;ll be adding a radio to play you rfavourite station or song when the alarm goes off ?

Hey, thanks for the contribution of this library, in my case it doesn’t seem to be working… Could it be my use of the BBB Freeduino board? Or is it my code? I tried moving the alarm functions for the alarms to the top and bottom with no luck… I can’t get any of the alarms to work without having it spit the time out via serial in void loop(). Am I missing something?

#include <TimeAlarms.h>
#include <Time.h>

int motoUp = 3;
int motoDown = 6;
int downActionTime = 4000;
int upActionTime = 4000;
int upButton = 5;
int downButton = 2;
int upbuttonState =0;
int downbuttonState = 0;
bool upPushed;
bool downPushed;

void MorningAlarm(){
  Serial.println("MORNING ALARM WORKS");
  digitalWrite(motoUp,HIGH);
  Alarm.delay(upActionTime);
  digitalWrite(motoUp,LOW);
}

void EveningAlarm(){
  digitalWrite(motoDown,HIGH);
  Alarm.delay(downActionTime);
  digitalWrite(motoDown,LOW);
}

void setup()
{
  pinMode(motoUp, OUTPUT);
  pinMode(motoDown, OUTPUT);
  pinMode(upButton, INPUT);
  pinMode(downButton, INPUT);
  Serial.begin(9600);
  setTime(20,29,0,1,1,10); // set time to 8:29:00am Jan 1 2010
  // create the alarms
  Serial.println("hey I'm settin alarms");
  Alarm.alarmRepeat(20,29,15,MorningAlarm);  // 8:30am every day
  Alarm.alarmRepeat(17,45,0,EveningAlarm);  // 5:45pm every day
}

void loop(){
  upbuttonState = digitalRead(upButton);
  downbuttonState = digitalRead(downButton);
  if ((upbuttonState == HIGH) && (!upPushed)) {
    upPushed = true;
    Serial.println("Up botton pushed");
    digitalWrite(motoUp, HIGH);
  }
if ((upPushed) && (upbuttonState == LOW)) {
    upPushed = false;
    digitalWrite(motoUp,LOW);
  } 
if ((downbuttonState == HIGH) && (!downPushed)) {
    downPushed = true;
    Serial.println("down botton pushed");
    digitalWrite(motoDown, HIGH);
  } 
if ((downPushed) && (downbuttonState == LOW)) {
    downPushed = false;
    digitalWrite(motoDown,LOW);
  }
}