Alarm Clock with Tetris to Prove You're Awake

 by nolte919
Featured
SANY2877.JPG
This is an Arduino powered alarm clock that after hitting snooze twice the alarm will not cancel until the user has cleared 4 lines in the game Tetris. You physically turn the clock sideways, so the screen is vertical, to play Tetris.  It's never fun to wake up in the morning but playing a little Tetris is at least somewhat enjoyable and quite effective.

Feel free to vote for me in the microcontriller contest if you like my project.  It would appear that contest might be specific to making things move.  So what does this move?  It moves the student who stayed up too late doing homework, it moves the parent with a new born child, it moves the Instructables author who was compelled to finish their project against all common sense.  It moves what can often be the most immoveable of objects... you.


Steps 9 and 10 have additional videos.

Some key features:
-Any button press will silence the alarm for 30 seconds so you’re not listening to the buzzing while playing Tetris.
-User can select how long the snooze interval is (with second granularity), how many times you’re allowed to hit snooze (0-255), and whether the snooze interval is from the time the alarm went off or the time the snooze button (any button) is pressed.
-Two separate alarms: One is a traditional alarm that will go off when that time is reached and then disabled for the following days. The other is what I call a “persistent” alarm that goes off at the same time Monday through Friday so isn’t disabled for the following days.
-It uses large numbers for which I was inspired by this Instructable and he got the idea from here .
-It gets power from a base that it sits on but has a rechargeable battery backup so you can tilt the clock without being encumbered by wires. The switching to and recharging of the NiMH battery happens automatically.
-It has a physical key to silence the alarm which is given to your spouse/roommate/parents so the alarm can be silenced with having to play Tetris
-The backlight brightness is user controllable through software and the backlight is turned off when not on the base to conserve power and indicate that external power is absent.
-You can cancel the alarm at any time, even before the snooze intervals have passed, by playing Tetris.
-Four different styles of Tetris, details Step 8.
-When setting the time and alarms instead of the typical adjusting of hours and minutes the user can adjust tens of hours, hours, tens of minutes, minutes, tens of seconds, seconds, tenths of seconds, hundredths of seconds (yes, really) and day of the week. This allows for quick time setting and ability to synchronize easily with another time source. See Step 9 for details.

Other points of possible interest:
-Use of interrupts, Step 4.
-The best (in my opinion) way to debounce switches, Step 5.
-Use of PROGMEM to store strings to save on memory, Step 7.
-Precise and simple instructions for using the Sparkfun FTDI Basic Breakout board and making a barebones Arduino board, Step 13.
-Keeping time with an Arduino without a separate real time clock, Step 2.
-How to deal with the fact that the Arduino function millis() wraps back to 0 every 50 days or so, Step 2.

This is my very first Arduino project and I have to say it’s a pretty slick environment.
 
Remove these adsRemove these ads by Signing Up

Step 1: Parts

SANY2891 cropped.jpg
SANY2892.JPG
SANY2852.JPG
buzzer cropped.jpg
SANY2858.JPG
board cropped.jpg
wires.jpg
buttons.jpg
-An Arduino or an ATMega328 with the Arduino bootloader. Sparkfun sells them ready to go or save a buck and buy it from Digikey part number ATMEGA328-PU-ND . If you buy one without the bootloader you’ll have to program it yourself. I used a UsbTiny from Adafruit and the process was super easy thanks to the Arduino IDE. ($5.50)
-A way of programming the Arduino. I used Sparkfun’s FTDI Basic Breakout item number DEV-09873 . I had a surprisingly hard time figuring out how to hook up the programmer so I have instructions for that in Step 13. ($22.00)
-A crystal and accompanying capacitors. This and the above two items are all that’s required for a bare bones Arduino. A ceramic resonator won’t work in this application because we’re keeping track of time. I got mine from Digikey part number 300-8437-ND . ($0.63)
-A backlit standard (HD44780) 16x2 LCD display. I got mine from Sure Electronics part number DE-LM12111 . ($5.99)
-Four buttons. I used tactile ones from Digikey part number SW404-ND . ($0.35)
-A buzzer. I used one from Digikey that I got a long time ago for another project so I forget the part number.
-A rechargeable 9v NiMH battery. I got mine from harbor freight part number 97865 . ($9.99 although they have a cheaper, lesser capacity one that was out of stock the day I went)
-A 9v battery clip-style holder, I got mine from Digikey part number 71K-ND . ($0.44)
-A 9v battery contact, I had a couple on hand but I’m pretty sure I originally got them from Digikey.
-A ICL7673 backup battery IC, a wonderful device that automatically switches between two power supplies without an interruption in power to the device and even indicates which power source is currently being used. I got mine from Digikey part number ICL7673CPAZ-ND . ($2.08)
-A 5v voltage regulator, I used a Low Drop Out variety from Digikey part number MC7805CT-BPMS-ND . ($0.56)
-A couple diodes, one for recharging the batter and one to insure against reversing supply power. I used one from Digikey part number 1N4148FS-ND and one from my parts box. Two of the ones from Digikey should work just fine. ($0.14)
-A slew (6 or so) of 0.1uF ceramic disk capacitors. I got mine from Digikey part number 478-5741-ND . ($0.13)
-Various resistors, I got mine from Digikey and from my parts box which was originally stocked from a very worthwhile Radio Shack purchase part number 271-312 . ($9.99)
-A project enclosure from Radio Shack (6x3x2") part number 270-1805 . ($3.99)
-Veroboard (stripboard ), I got mine off Ebay, you can used your favorite board making material from etching copper clad to perfboard .  Consider getting some stripboard and the tool for cutting the traces together off of eBay if you're going that route.
-I also used a breadboard for initial testing and cardboard to mock up the enclosure.
-Soldering iron, solder, wire strippers, a rotary tool to make the enclosure, typical stuff.

PICme says: Sep 18, 2012. 8:52 AM
What a great project, I especially like the large digits on the 16x2 display. Not sure about having to clear 4 lines of Tetris though. Thanks for sharing.
waterlubber says: Aug 11, 2012. 3:14 PM
um..bit outdated?
try arduino 1.0.1
waterlubber says: Aug 11, 2012. 3:12 PM
Is there a "simple" version, with all the wires, blah blah, with just a 'duino and a tetris fliptop?
kentso says: Mar 12, 2012. 3:53 AM
I enjoyed reading your code. I thought the button handling code was downright elegant :-) A neat hack. Thanks for posting it. I've used Adafruits DS1307 i2c breakout board in my own projects to good effect.
64bitgenius says: Jul 16, 2011. 6:19 PM
now to make it so we can play halo XD!!!!!!!!!!!!!
Upir says: Jul 12, 2011. 9:03 PM
My er... kids... yeah kids, so need one of these...
nickjohnson says: Jul 10, 2011. 8:19 AM
This reminds me of a math alarm clock I built a few years ago. I still use it, and it still works great: http://www.cheaphack.net/2008/01/turing-alarm-clock.html

I see you're keeping time with a crystal. That will work, but it will be a minute or so fast/slow per day. Try a PLL on mains frequency for better time keeping.
nolte919 (author) in reply to nickjohnsonJul 11, 2011. 5:43 PM
Did you mean a minute or so fast/slow per year? Mine is off by less than a second per day. That's part of the reason I made it easy to synchronize with another time source so I could check that out. In order to synchronize with the mains I'd have to have a way to detect the mains sine wave which would add an additional circuit to the design since I use a standard wall-wort style power supply. Also, since I made the clock removable from the base there would have to be additional connections for that sine wave indicator from the base to the clock. Thanks for the suggestions though.
BearGrills says: Jul 5, 2011. 8:30 AM
Cool thing man! When I read the name I laughed so much! :D Your idea is as brilliant as it is simple! When I have the opportunity I will try to make one for myself :)
mischka says: Jul 3, 2011. 12:18 AM
Wow, really cool clock, but I guess I am too tired in the morning to play tetris ;-)
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!