The quickest way to wake up is having a cup of cold water poured on your head. Thanks to this new alarm clock, you can wake up with this refreshing start each day! It's perfect for those that have trouble getting out of bed, and always want 5 (50) more minutes.
Step 1: Gather Your Materials
I made this alarm clock with
- Arduino MEGA
- 1-9 Number pad (the kind I used is in the picture)
- 16x2 LCD Screen (the kind I used is in the picture)
- Small Servo, or a small motor with 4 5.5k resistors and 4 npn transistors
- Large Prescription pill bottle
- Small Metal Shelf
- Lots of Tape
- 10 foot Telephone Cable
Step 2: Assemble the Circuit for the Arduino
The Arduino circuit uses a lot of wires, so it can get a little messy.
- Connect LCD Screen. It has 16 pins all right next to each other, so it can be tricky. I you are using my code, use this guide for connecting your LCD.
LCD| Ard Pin
1 | GND
2 | +5V
3 | Middle of Potentimenter (ends of POT are to +5v/GND)
4 | 8
5 | GND
6 | 9
11 | 10
12 | 11
13 | 12
14 | 13
15 | +5V
16 | resistor GND
- Next hook up the keypad. Using my code and the same type of keypad, the connections are as follows.
KeyPad (1 side to A side) -- ARD Pin
- Now you have to connect the servo. This is simple, just connecting the servo + and - to power and ground, and connecting the signal lead to pin 51. If you are like me, your servo will break right when you are about to finish. I had to switch to a small high torque hobby motor, controlled by 4 npn transistors acting as switches. I connected the collectors to +5v through a resistor, the bases to pins 4, 5, 6 and 7, and the emitters all to a single node leading to the terminal of the motor. The other motor terminal went straight to ground. The schematic is seen in the picture at the top of this page.
Step 3: Write the Code for the Arduino
I coded my Arduino to take input on the current time and the desired alarm time. The LCD screen then displayed the current time and the time for which the alarm was set. When it was time for the alarm to go off, I told the servo to spin, tipping the bottle of water over and letting gravity pour it onto my face. You can find my code here. My servo then broke, so I did it again with a small motor. The code is almost the same, but you can find it here.
Writing the Arduino code involves three basic steps:
- Receiving input from the user about the current time and desired alarm time
- Keeping track of and displaying time
- Pouring the water at the correct time
1. To receive the input, I have the Arduino running in a loop waiting to receive a keystroke from the keypad. If it does, the Arduino checks if it is a number. If it is, It saves this as the current hour. If the next input is a number, it would multiply the first number by ten, and add the new one (input 1,2,# gives 1*10+2=12). If that input was #, it prints : and the user can enter the current minute. I do a similar process to receive the current minute. The Time library that I downloaded from here was very useful. I used it to set the current time. I received the alarm input the same way, and just saved it.
2. The Time library is super easy to use for keeping track of and displaying the time. I did this in the loop(); portion of my code. Every ten seconds I check the time and print it to the lcd, and if it matches the alarm time then I call the function to pour the water.
3. This is the easiest part of the code, and the shortest. It is contained in the function wakeup(); I started the code by setting my servo to 0 degrees. When the time comes to wake up, I rotate it down to 90 degrees, and since it is connected to the cup the cup also rotates, and I get wet. After five seconds the cup returns to its original upright position to be ready for its next use. After I got done, my servo died, so I had top replace it with a high torque hobby motor. in the wake up function I then applied a voltage to the base of the transistors, allowing current to flow through the motor snd spin it, causing the cup to spill. Then the user has to manually push it back up to the starting position.
This is just one way to write the code-It can be done many different ways. For example, you could make it so you only set the time once, then ca re-set the alarm as much as you like. Or you could have it go as a timer instead an alarm clock. Feel free to experiment with it and share!
Step 4: Assemble the Water Pouring Device
This part is fun!
- First, test out your cup to see how far it will dump the water. You may need to add a spout to get full coverage of your sleeping area.
- Attach the servo to the cup, making sure it is very strong so you don't accidentally end up soaked at 2:00 AM due to a mechanical failure. I used a command strip and some Duck Tape.
- Attach the servo to the shelf. The sturdiness of this connection is equally important. I used another command strip and more Duck Tape.
- Attach the shelf above your bed. This part will vary a lot depending on your set up. I live in a college dorm so there is a strip of moulding near the ceiling off of which I hung my shelf. This connection is just as important. You can use screws or nails or picture hangers or anything. I used (you guessed it) Command strips and duck tape.
Step 5: Put It All Together
This is the fun part. Put up the shelf, and find a good spot for the Arduino. Then measure how much of the telephone cord you'll need. For the servo you'll use three of the four wires inside, or for a motor you'll only need two. Cut through the cord to get at the wires inside, and strip enough insulation to have an inch or two of exposed wire. Then connect the stripped wires to the servo on one end and to your output pins from your Arduino circuit. Tape it all up, make sure it's sturdy, and you're ready to go!