WakeUpLight

HI!

At first I am a NOOBIE at this forum and with arduino. So take it easy and try to explain as profoundly as you can.
This is my first project ever and it is a be a big challenge for me, that’s why I am asking for help.

What I am going to do is a wake up light which is attached to the ceiling. At he morning before you wake up it starts to increase the brightness trying to imitate the sunrise. (see attachment) When you should wake up it is very bright. At the day time it should work as a normal lamp. In the evening it should imitate the sunset by fading away. At night it could grow like a night sky… Wake up time and the amount of sleep is set with smartphone via bluetooth. First draft of my idea is attached below.

I am going to do this step by step…At first I have to create a clock, the sunrise and daytime. If I have time I’ll do the sunset and night sky. BUT HOW?
HOW to create a program? What kind of architecture it should have? Help is needed! XD

you can use a light sensor to detect the real sunrise outside, or use a real time clock and an algorithm for day of year - http://forum.arduino.cc/index.php/topic,66426.0.html -

Description is maybe a bit inaccurate (need to fix it)… Purpose is to create such a WakeUpLight that helps you to wake up. Because the light decreases your natural level of melatonin (“sleeping hormone”). Not really follow the real solar cycle.

My idea is to create a real time clock and feed inputs such as amount_of_sleep and wake_up_time with smartphone.
Idea of the code could be like this:

If clock => wake_up_time - 30mins
then go to sunrise mode

If clock => wake_up_time
then go to day mode

If clock => wake_up_time-amount_of_sleep-30mins
then go to sunset mode

If clock < wake_up_time - 30mins
then go to night sky mode

My problem is that I don’t know (yet) how to create a clock, how to communicate with bluetooth, HOW to control LEDs so that it really looks like a sunrise or sunset or night sky…

you can use a light sensor to detect the real sunrise outside,

I don't think that's the idea... The idea is to simulate sunrise when YOU want, while it's dark outside.

This doable, but it's a BIG 1st-time project and you'll have to take it one step at a time.

I built something similar several years ago (with a different microcontroller). I took a couple of shortcuts. I used a programmable [u]X-10[/u] controller so I didn't have to build a clock. And, I used a separate "desklamp" attached to the bed's headboard so this set-up can be independent of the main lighting. (The overhead lamp is also X-10 controlled and it comes-on with a separate X10 command at the end of the 10-minute dim-up period.)

So... I essentially have a dimmer-box the plugs-into a timer, and a lamp that plugs into the dimmer-box. When power is applied to the dimmer-box, it starts dimming-up. Then, it stays on 'till power is removed (by the external X10 timer).

... how to communicate with bluetooth

I've never done bluetooth. There are bluetooth shields and maybe someone else can give you some help & suggetsions.

b]HOW to control LEDs so that it really looks like a sunrise or sunset or night sky

I'm not sure what you want to do for "night sky", but for dimming you have a couple of choices -

There are dimmble LED incandescent replacements that you can buy at a hardware store or home improvement store. (You have to make sure they are dimmable). An incandescent dimmer works by turning-on the AC power for some fraction of the 50 or 60Hz waveform. (That's how my dimmer works.) You need an isolated phase detection circuit and an isolated TRIAC-based power control circuit.

Or, there are special high-power "constant current" dimmable LED power supplies ([u]examples[/u]). There are controlled by a 0-10VDC control signal or by 10V PWM. The Arduino puts-out 5V, so you have to add a transistor or MOSFET (and a 10V supply). The Arduino can also put-out PWM which can easily be filtered to DC if needed. This a LOT easier than building an AC dimmer, and the isolation is built-in, so it's safer to build and experiment with.

Another option would be to build your own constant-current LED power supply, but I wouldn't recommend it.


As you can probably guess. I hate getting out of bed in the morning! :D When I was building the "sunrise simulator" I built another box, controlled by the same timer. It's a little "alarm clock beeper". When power is applied, nothing happens for 10 minutes while the other box is dimming-up the light. Then when the light is fully-bright and it's time to get up, it makes a gentle "beep". 30-seconds later it beeps again. It beeps every 30-seconds, and after two minutes (actually after 12 minutes) it beeps twice, then twice again at 2.5 minutes. At 3-minutes, I get 3-beeps, etc. (I think this can go up to 15-minutes.)

(This could have all been built into the same box with the same microcontroller, but I was learning and trying to keep things as simple as possible.)

CONFESSION: None of this is working right now... The freekin' software to program the X-10 controller won't run under Windows 7 and the timer has drifted-off by a couple of hours... A newer programmable X-10 compatible controller that can dim my other lights is about $300, so when I get around to it I might re-install Windows 2000 to re-program the thing.