Friday, 19 September 2008

Wake Up Light - Alarm Clock Triggered Light Bulb

I was thinking to myself the other day how much easier I find getting up in the mornings when it's light outside. I continued to contemplate how similar the light level from a low-power light bulb was. My mental conclusion was: 'meh, fairly'. Now, how do I make a light bulb turn on when I want to wake up? Here's where my previous post, Triac Mains Switching, comes into play. Here is the schematic again:


When I want myself to wake up, I make my alarm clock turn it's radio on. So, after taking my alarm clock apart and probing numerous soldered contacts, which looked like they could provide low-voltage DC power to the radio circuit, I found one (relative to ground) which was at approximately 6V when the radio was on, and 0.5V when it was off. This was great news, 6V is just slightly larger than the logic 'high' for the Arduino Decimilla. With a simple voltage divider, and the equation Vout = (Vin * Rb) / (Ra + Rb),it would be trivial to bring that voltage down to a suitable logic-triggering level; I probably don't even need to.



I have used fairly high-valued resistors to ensure very little current is drawn from the clock's circuitry; that way there's little chance of damaging the clock.

Now I have a low-current, 5V(ish) supply, capable of triggering an Arduino digital pin. I also have a circuit which allows the Arduino to turn 240V mains devices on and off.

Can you see where this is going?

With the two circuits joined together, it is possible to turn the light bulb on when the radio turns on. Mission Completed!

Simple set-up (without voltage divider)

Arduino Code Listing:

byte bulbPin = 12;
byte radioPin = 8;

void setup(){
pinMode(bulbPin, OUTPUT);
pinMode(radioPin, INPUT);
}
void loop(){
if (digitalRead(radioPin)){
digitalWrite(bulbPin, HIGH);
for (int i=0; i<5; i++){
delay(60000);
}
digitalWrite(bulbPin, LOW);
}
}

This code will leave the light on for 5 minutes after the alarm has been turned off. If the delay wasn't required, neither would be the Arduino.

A video of it in action:



Admittedly, this light bulb is quite bright; I'm going to get a 20W pearl bulb soon.

Possible additions:

- Serial communication for triggering, eg:
- e-mail received
- Web based (switch on a website) (with serial-to-Ethernet module possibly)

- Light level (LDR triggering)

- Triggered by a break in laser beam across the entrance to the room, hmm...

Words of warning: Mains electricity is very dangerous; do not do anything like this if you're not sure what your doing. I did a fair amount of research before building my circuit. The components in this circuit can become damaged from transient voltage spikes so I'd advise against using inductive loads with this circuit - the triacs may fuse open (or worse!). Stick with resistive loads!

Have fun,

Comments/Suggestions greatly appreciated...

Chris

6 comments:

Anonymous said...

Great application. Great to see it in action after hearing about it.

joselinadam said...

An immense product from a tiny circuit, it’s amazing! I have also seen an alarm clock with a gentle LED for close range and a powerful Xenon Flash for distance.
shake awake - shake awake clock,shake awake distributors

Appitizers said...

Nice project!!!

Can you guide me on how you lighten up a bulb through Arduino?

chris said...

@Appitizers, this is (basically) it! Just put the bulb where the mains socket would go. Since the Arduino's digital output voltage is 5V, this will switch the bulb on.

If you're not sure what you're doing, it would be safer to postpone building the circuit until you feel comfortable doing so.

Anish Baruwal said...

Hello
I'm currently working on a similar project as part of my A-levels/college and was looking for a circuit diagram to get me started with it.

If its okay, can you please let me have a look at your circuit diagram, so i can get some sort of idea on how to get started
Much appericiated

Thank you

Anish Baruwal said...

Hello
I'm currently working on a similar project as part of my A-levels/college and was looking for a circuit diagram to get me started with it.

If its okay, can you please let me have a look at your circuit diagram, so i can get some sort of idea on how to get started
Much appericiated

Email: b_anish@hotmail.co.uk
Thank you