In a warm and sunny Saturday morning, you are laying in bed, dreaming of all the sweet things in the world. Suddenly, you alarm clock starts to scream, piercing through your brain, forcing you wake up. You reach your hand to find the snooze button, but ended up knocking everything down, and the clock still screams. Well, fear no more! I came up with a modified alarm clock that triggers the "snooze" function, which will stop beeping for four minutes, when you raise your hand before the clock. To completely stop the alarm, just raise your hand before the clock for five full seconds. This is my very first Instrucable, so there might be some details that I will miss. Please let me know if you spot them. Let's get started!
Here are the materials you need:
- Arduino Board (Preferably Leonard or Uno) x1
- Buzzer x1
- Ultrasonic Sensor HC-SR04 x1
- Real Alarm Clock x1
- Resistor 82 ohm x1
- Several wires
- Soldering Iron x1
- Hard Card Board
- Breadboard x1
Step 1: Making the Circuit
I recommend using a breadboard to make the circuit first for testing. The circuit outline looks like the image above. Follow the picture and put the components together (except for the alarm clock itself, which I will explain later).
Step 2: Solder the Clock
Since the alarm clock does not belong to Arduino components, we will have to solder the clock with wires. The way how the clock and Arduino work is simple. Normally, when the clock hand reaches your alarm time, the clock sends off an eletric signal to its buzzer, causing the alarm to trigger. What we do here is to remove the original buzzer, direct the electricity to the arduino board, so it will sets the Digital Pin to HIGH when the time is up. On the first image you can see how the wires is connected to the board before soldering. The next two pictures feature how I arrange the wires, and the final picture is the full picture of the prototype with the soldered alarm clock (Click on the picture to see additional detail).
Step 3: Making the Container
Making the container out of cardboards is not an easy task. You have to be specific in the measure of each sides.
Here is the measure:
- Top & Bottom: 20.1 cm x 12.5 cm
- Left & Right: 12.5 cm x 5.5 cm
- Front & Back: 20.1 cm x 7.5 cm
After cutting all the sides out, it's time to drill some holes to fit the transmission wire and ultrasonic detector in. For the USB hole, drill the hole on the left panel 1.8 cm from the left and 1 cm from the bottom. For the detector, drill holes 3.8 cm from the bottom with the give size:
- USB Hole: 1.5 cm x 1.5 cm (second pitcture)
- Ultrasonic Detector Hole: 1.7 cm diameter circle x2 with 1 cm between (third picture)
Step 4: Assemble the Clock
Finally, it's time to assemble the parts together. Make sure you can hold the box tight before stick the components together with hot glue. Your final product should look like the last image. If you want additional decoration, feel free to add whatever you like to your clock.
Step 5: Code
The code is provided here. I have written explanations in the file. Feel free to adjust the code for your need. Defalty, the snooze interval is five seconds, which is really short because of testing. You should change the time longer if you want to make it work. I hope you enjoy this Instrucable and feel free to ask any questions!