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.