Well, I was planing to make a DIY LD mask this weekend, but I changed my mind once I got the lights I was going to use. Ideally the lights would have been dim (so as not to wake me up), but the ones I chose were f***ing bright (7000 mcd, to be exact [see note]). This gave ma an idea: The DreamLamp. You place it on your bedside, and it waits for about 5 hours after you go to sleep, then flashes 5 times every 5 minutes. the light is bright enough for you to see it in bed. I tested my prototype in a dark room, from an arms length away, and I could see the light through closed eyes. The lamp approach also has the advantage of not being uncomfortable to wear, as it sits by your bedside, unlike a mask. It doesn’t need to detect the stage of sleep, due to the timer.
What do you think about this idea?
NOTE: 7000 mcd = 7 × luminous intensity of a typical common candle (Credit: Wolfram|Alpha)
Some notes about the cost:
If you were to make it at home, it would cost about $25 - 30 USD.
If I were to sell them (I don’t plan to), they would cost about $7 - 10 USD.
The price difference is due to the fact that you need a ~$21 arduino to program it, but to run the code, all you really need is a ~$3 ATtiny chip.
TECHNICAL NOTES:
The DreamLamp consists of the following parts:
An Arduino Duemilanove (but any Arduino will work )
A 7000 mcd white LED
I am not yet using, but will include the following parts:
2 Switches
A project housing
A battery of some sort
An ATtiny?
And here’s the code (Spoiler’d for length):
[spoiler][code]
//If you need a license, use the WTFPL. It’d be nice if you showed me your changes though!
//Place a LED on pin 12. Enjoy your LD’s!
boolean remwaitover = false;
int blinktime = 300000; //in milliseconds, the time between blinks. 300000 == 5 mins.
int naptime = 2700; //the number of seconds it will wait for if you press the ‘nap’ button. 2700 == 45 mins.
int remwaittime = 18000; //in seconds, to stop an int overflow during the REM wait. 18000 == 5 hours.
int blinks = 5; //Number of times it will blink each blinktime.
int indblinktimes = 500; //how long each blink lasts in milliseconds.
int outpin = 12; //The led pin. @TODO: Add multi pin support.
void setup() {
pinMode(outpin, OUTPUT);
}
void loop() {
if (remwaitover)
{
delay(blinktime);
for (int i = 0; i < blinks; i ++)
{
digitalWrite(outpin, HIGH);
delay(indblinktimes);
digitalWrite(outpin, LOW);
delay(indblinktimes);
}
}
else
{
for (int i = 0; i < remwaittime; i ++)
{
delayonesec();
}
remwaitover = true;
}
}
void delayonesec() //Used to stop a int overflow during the REM wait. Pauses the script for 1 second.
{
delay(1000);
}[/code][/spoiler]