Dec 28

Sunrise Alarm Clock, Part 3

With the hardware built, now it's time to put hardware and software together. Using the tutorials mentioned in the previous post, I put together some code to read the time from the real time clock, tell the alarms library what time it is and use the alarms library to create an alarm to turn on the LED strip. I also added a button to turn off the lights (you could just reset the board, but now I have a button that I could use for other things).

Some notes on putting this together.

1. I think I accidentally destroyed digital pins 8 and 7 on the chip I'm using. They don't read anything in when I tried attaching a button to them. Oh well. I am now using pin 2 for a button.
2. I had the 12V power supply powering the arduino while having the arduino board (with the Atmega328p removed) connected to the board. The 5V from the arduino board was not connected to the breadboard, so I shouldn't be running power from my external power supply back into my usb hub. however, the grounds are electrically connected. This is probably sending some weird electrical noise back into my computer. This made my laptop turn off mysteriously and say that it had an error. I may be frying my usb hub. In the future, I should get some optocouplers to isolate my two circuits (my computer and the arduino) since I am using two power supplies (my computer's usb hub and the 12V power supply for the LED strip).

Dec 27

Sunrise Alarm Clock, Part 2

Welcome back. After designing the circuit using adafruit's lovely tutorials, the next step is to build it. I have attached a photo of what the circuit looks like in real life. A few points about why I chose to do certain things.

1. Wire Colors: Using different colors for different wires makes building your circuit and looking for problems much easier. I would suggest using differently colored wires for specific purposes. That way, when you look at your board, you know what wires are supposed to go where and can more easily identify problems. Here is the color scheme that I am using:
Red: I always use red wire for 5 Volt power. If it's red, I know that it's a 5V signal.
Brown: Brown wire is my 12 Volt power coming from my 12 Volt power supply.
Black: I normally use black wire for ground. In this case, I am not using negative voltage, so all black wires are ground.
White: I usually use white wire to transmit signals from the arduino and for my resonator.
Yellow/Green/Blue: This is a generic color for transmitting signals. Normally, as long as two adjacent signal wires are different colors, then it's ok. Normally, I use wires in (sort of) the following order: White/Yellow/Green/Blue. For this project, I chose green, yellow and blue to transmit the signals to my TIP120's so that I know what wires are going out to control each part of the RGB LED's. I can't use red as a signal wire, because I only use red for 5 Volt power.
Note: I didn't show the input power and the wires going to the RGB LED's in the picture below. There are, however, wires sticking up where I will put the RGB wires. The input power is unmarked, but has a brown wire on it already to remind me where it goes.

2. Resistors: I used 10 kOhm (10,000 Ohm) resistors for my button, and 1 kOhm (1,000 Ohm) resistors for my TIP120's. I do not need very much current for buttons, and the TIP120's do not need very much current to turn them on.

3. Capacitors: I used two capacitors for my voltage regulator. This helps to smooth out voltage spikes, which will occur as I turn the LED's off and on quickly. I used the capacitors that I had sitting around. Normally, I use the circuit described in Make: Electronics by O'Reilly. That has a 0.33 microFarad electrolytic capacitor on the input voltage and a 0.1 microFarad ceramic capacitor. If you are interested in learning about the basics of hardware, that is a great book to pick up. The capacitors I had were a little bigger, but it should work fine.

Sunrise Alarm Clock Breadboarded

Dec 17

Building a Sunrise Alarm Clock, 1

Sunrise Alarm Clock: 1

Have you ever woken up at 5:30 am to the most annoying sound on the planet? Yes, the sound that strikes fear in the most peaceful sleeper. The alarm clock sound. That dream crushing sound that jerks you back into reality. If only there was a smoother transition, one where I didn't wake up feeling angry that I was from my dreamscape so ungraciously taken. Enter the sunrise alarm clock.

Bill of Materials:

1. Arduino compatible (bare bones support for Atmega328p)

2. 12V 5A power supply (adafruit part number 352)

3. RGB LED strip (60 LED, adafruit 346)

4. TIP120 x3 (adafruit 976)

5. DS1307 Real Time Clock breakout board (adafruit 264)

Yes, I got a way beefier power supply than I needed. I could power a laptop off that thing. But then again, if I ever want more LED's, a motor, or a solenoid (hey, maybe I want my alarm clock to shoot socks at me in the morning out of my sock cannon? That'll wake me up.).

So, what is all this stuff and what does it do? Together, they make a sunrise alarm clock.

Adafruit has a lovely tutorial on hooking up the RGB LED strip here.

Adafruit has a wonderful tutorial on using the DS1307 real time clock here.

I'm using three PWM pins, 9, 10 and 11. 9 is connected to the green part of the RGB LED, 10 is red, and 11 is blue (see schematic). A diagram of what pins are what for the Atmega chip is shown on the arduino website: Atmega328 pin mapping.

If you follow the above Adafruit links, you will find everything you'd want to know on the parts. Now I need to wire it, code it, and test it.

Dec 07

Sunrise Alarm without a microprocessor, Cool password protected sketchbook, Mechanical Iris

Alrighty then. I came across a video on how to make a sunrise alarm clock using a timer, LED's, and capacitors for the fade in of the light. I thought it was cool, and may be an easier project than making one with an arduino. But then again, if I want to make my alarm clock wake me up with blue light, and put me to sleep with red light, then I'll want to control the color of my RGB LED's. But no matter, this is still a cool project.

Sunrise alarm clock (using passive components and a timer) video.

There was also a really cool password protected sketchbook video posted on adafruit. The video is here: Cool Password Protected Sketchbook. Is it really a password? No. It's a series of dials, buttons, and it even uses the door knock idea (there are many videos by now on knock door openers, you knock in a specific rhythm to open a door. Of all the one's I've seen, this one is the coolest. There's also a capacitive touch sensor version you can use on door knobs. I think some MIT video demonstrates that.). Anyway, this was cool.

Side Note: The link above for the garage door knock opener uses a mechanical iris as the surrounding structure. The DXF files for that are on page 2 of the following thread on the ShopBot forums. The link is here.

Mar 21

The terror of the Snooze Button

Lifehacker posted a video today by ASAP Science (they have a Youtube channel) about how the snooze button doesn't help you get any more sleep and can actually make you more tired. This adds to my convictions that the alarm clock that I make will not have a snooze button. It will wake me up, whether I want it to or not. And as the saying goes, "The me in the morning will have no respect for the me that set the alarm."

Mar 13

Color of light Changes Alertness

NASA has planned an experiment to attempt to help astronauts get sleep on the international space station. According to research, blue light helps wake people up while red light helps people fall asleep. This apparently means that staring at my computer screen before going to bed apparently doesn't help me fall asleep. But it does mean that my alarm clock should be heavy on the blue light to wake me up in the morning, and it could also have RGB LED's that go heavy on the red light as I'm getting ready for bed. That could help mimic the sunrise and sunset and give me a sleep pattern that is either more stable (because it's easier for me to fall asleep and wake up) or that is more easily tuned because I can give my body the necessary light cues to tell it to fall asleep when my work lets me. Either way, I'll need to experiment. And for that, I need the clock.

Article on color changing lightbulbs assisting sleep

NASA ISS color test

Mar 13

Example of a Sunrise Alarm Clock

One of the projects that I'm interested in building is an alarm clock with a variety of alarms to wake a person up. I've though of using LEDs to simulate sunlight, a motor to vibrate my pillow, a speaker to play music, a squirt gun, a spring-loaded mechanism to pull off my sheets, etc. I haven't built one yet, but the project has always been in the back of my head. I cam across a series of alarm clocks that simulate sunrise, and I like the one in the link below, particularly for its great bill of materials. I would use an arduino instead of the Arm processor because I have a few ATMega328p's I haven't found projects for. He also uses all open source products to create the project, which I think is awesome. I haven't dabbled in board layout much, and an open source program would be a great place for me to start.

Sunrise Alarm Clock

Dangerous Prototypes has a sunrise alarm clock that uses a PIC32. I've used one for another class, but since I'm focusing on ease of teachability, for now I'm going to stick with the arduino (very beginner friendly). This one plays sounds back, which is nice, but I can do that with an arduino as well.