Introduction: Running Away Alarmclock - ITTT

HKU Project - ITTT (If This Then That) - Jantiene van Drunick, 1B - studentnummer: 3024656

The Running Away Alarm Clock

Have you ever experienced the horrible feeling of needing to get up, but not being able to do so? Are you tired of the fact that you keep pushing that snooze button over and over again and then rushing out the door? I know, you can't help it; we've all done it, but as from this moment NO MORE!

Introducing the 'Running Away Alarmclock' tutorial. This little fella (Let's call him Tony) is gonna help you get up in the early mornings with a happy smile or in an angry, running away style.

With this tutorial I am going to guide you through the process step by step of building your own Running Away Alarmclock. So sit down, let those horrible mornings behind you and get started!

Step 1: The Necessary Materials

Before we actually start, let me explain how the project should work in the end:

You are making a Running Away Alarmclock. What should happen after you get everything right is this:

  1. Tony (the clock) is for one side happy and the other side unhappy.
  2. Tony will light green (the led) in his head if you enter 0 in the code. He is a happy little fella, ready to wake you up.
  3. Entering 1 in the code will activate the alarm. The first call of Tony to wake you up. (It is the time you would have set the night before). If the sound stops, you pressed for the first time the snooze button.
  4. Then, when you change the 1 to 2 in the code, The buzzer activates: Tony becomes a bit irritated and the yellow light in his head should turn on. When the sound stops, you pressed the snooze for the second time.
  5. Entering 3 in the code, the buzzer activates again, the red light goes on in his head, and he starts to rotate about his axes. Then after a couple of seconds, he drives away from you, showing his angry side.

You then have to step out of bed to turn him of the next time the alarm rings.

What are the necessary materials to make the alarm?

Arduino materials:

  1. 1 x arduino yun
  2. 1 x breadboard
  3. 2 x continuous servo motor
  4. 1 x green led (for more light, the bigger ones)
  5. 1 x yellow led (for more light, the bigger ones)
  6. 1 x red led (for more light, the bigger ones)
  7. 1 x piezo buzzer
  8. 4 x 220 OHM resistor
  9. a LOT of jumper wires

Materials to build the clock itself:

  1. thin wood (not too heavy, but sturdy enough to cary all the weight)
  2. square wood stick (for reinforcement)
  3. a plastic ball (big enough for all the technical equipment to fit in)
  4. a transparant plastic cup or small ball
  5. an (old) white T-shirt
  6. paint (I used acrylic)
  7. brushes
  8. textil glue
  9. wood glue
  10. normal glue
  11. double sided tape
  12. Stanley knife

Optional:

You will need two front wheels. (the rear wheels will be the two servo motors).

  1. If you have readymade wheels laying around and with approximately the same size (like lego wheels), you can use those.
  2. Otherwise try making your own wheels with, for example, a fretsaw, wood and a large toothpick.

Step 2: Connecting the Arduino Components

Added to this step is a diagram showing you how to connect all the different Arduino components. Maybe it looks difficult, but with a bit of patient and focus, you'll manage.

Also, on this diagram you can clearly see how many jumper wires you will need.

You can copy this image entirely, but if you don't, make sure to adjust the code accordingly if necessary.

Tip:

Sometimes, components and wires can get a bit loose. Especially if you are gonna cary Tony with you or make him run away a lot. Also, the led lights will be secured on a vertical piece of wood, making it easy to get detached. If you have the opportunity, try to solder wires together. This will minimalize the change of problems caused by loose components.

Step 3: Adding the Code

After you connected all the technical components, it is time to make the code. I already wrote it down, so you can copy and paste it as you like.

#include

int redPin = 0; int yellowPin = 1; int greenPin = 2; int buzzerPin = 8; int distancePin = A0; int servo1Pin = 12; int servo2Pin = 13;

int wekkerStaat = 3;

Servo servo1; Servo servo2;

bool buzzerAan = true; bool draaien = true;

void setup() { pinMode(redPin, OUTPUT); pinMode(yellowPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(buzzerPin, OUTPUT); servo1.attach(servo1Pin); servo2.attach(servo2Pin); }

void loop() { if(wekkerStaat == 0) { digitalWrite(redPin, LOW); digitalWrite(yellowPin, LOW); digitalWrite(greenPin, HIGH); noTone(buzzerPin); servo1.write(90); servo2.write(95); } if(wekkerStaat == 1) { digitalWrite(redPin, LOW); digitalWrite(yellowPin, LOW); digitalWrite(greenPin, HIGH); if(buzzerAan) { tone(buzzerPin, 500); } else { noTone(buzzerPin); } servo1.write(90); servo2.write(95); delay(5000); buzzerAan = false; } if(wekkerStaat == 2) { digitalWrite(redPin, LOW); digitalWrite(yellowPin, HIGH); digitalWrite(greenPin, LOW); if(buzzerAan) { tone(buzzerPin, 500); } else { noTone(buzzerPin); } servo1.write(90); servo2.write(95); delay(5000); buzzerAan = false; } if(wekkerStaat == 3) { digitalWrite(redPin, HIGH); digitalWrite(yellowPin, LOW); digitalWrite(greenPin, LOW); if(buzzerAan) { tone(buzzerPin, 500); } else { noTone(buzzerPin); }

if(draaien) { servo1.write(0); servo2.write(120); } else { servo1.write(0); servo2.write(0); } delay(5000); buzzerAan = false; delay(5000); draaien = false;

} }

Step 4: Making the Belly

Now that you have all the components and code ready and tested, it's time to move on to making the clock itself.

Let's make Tony's belly!

  1. Take the big plastic ball and measure the middle of it. Place a dot there.
  2. Now mark the part which is going to be cut open. This is going to be the hole in the bottom. Caution: all the electronic components (except for the servo motors) need to fit in. It is better to start cutting a small circle and making it, while testing, bigger. Once you cut too much, you cannot go back.
  3. Tip: Try marking the line as straight as possible by measuring from the middle with measuring tape and going around, placing dots every time. Even better would be: adding a needle in the middle and putting a cord through there. From there, it is simple to mark the line.
  4. Take a stanley knife and cut out the marked part.
  5. Check if all the technical components fit inside the ball, by gently putting the ball on top of them. Doesn't fit? Cut a bit more away. Test this over and over again until satisfied with the result.
  6. You cant test how straight the line is by putting the ball down. If every side is on the ground, you are good to go.

You are done when all the components fit inside the ball with a little space left.

Step 5: Making the Wooden Frame

We are now going to make the wooden frame on which everything will stand. The wheels are going to be attached to this frame later in the tutorial.

  1. Take the wood and mark the circumference of the ball.
  2. Take the widest part of the circumference on each side of the circle en mark a square around it.
  3. There must be space on two opposing sides, because that's where the cable to the laptop will be. So, mark these two sides a little more narrow then they were before.
  4. On the other two opposing sides, you add a bit of space. (Around 1 cm). Here, we will add little pieces of wood later to prevent the ball from sliding of the wooden frame.
  5. Make sure the ball fits and that there is enough space for cables.
  6. Cut the form with a saw and test it again.

Step 6: Making the Head

Now we are going to make the head of Tony: where the head needs to be on the body and cutting a hole there.

  1. Mark the circumference of the transparant cap on the bigger ball. This is where the head will be later.
  2. (If you don't have a readymade cup with a hole, you can make one the same way as you did with the larger ball. There needs to be an opening in both balls to add the lights later).
  3. After marking, draw a second smaller circle inside the original circle. About a centimeter apart.
  4. Cut this second circle.
  5. Check if you cut both balls or the ball correct by putting them on top of each other. Is there enough space for the wooden plate with the lights and for the glue? If so, you can go to the next step.

Step 7: Adding the Wooden Plate With Lights

Now it is time to add the wooden plate on which the lights will be attached.

  1. First, measure the center of the wooden plate and mark this with a dot or a cross.
  2. Measure how high the three wooden square pieces must be. It should be high enough to reach about a quarter length in the head.
  3. Saw these three pieces and glue them together.
  4. Saw a fourth piece of the same wood (not the same length). This will be the base on which the other three pieces will be glued. The fourth piece should be a bit longer, so when the three other pieces are put together on the fourth one, there is still space left, on either side of the stick.
  5. Glue this fourth piece on the wooden plate.
  6. Glue the other piece (consisting of three pieces) on top of the fourth. Make sure the body still fits without harming the wooden plate.
  7. Let it all dry.
  8. Add the lights by sticking it to the wood with adhesive tape. Make sure the head still fits without harming the lights.

Step 8: Little Pieces of Wood for Sturdiness

Now we are going to add the square pieces of wood to make the frame and the ball more sturdy.

  1. Measure the two opposing sides (with the 1 cm bigger width).
  2. Measure the same length on the square wooden stick and cut two of these.
  3. Check if the sticks fit on these two opposing sides. Do they? Glue each of them to each of these sides with wood glue.
  4. Now, measure in all four corners the space where you are going to add little wooden pieces for extra sturdiness and for keeping the ball in place.
  5. Cut four of these pieces with the same length and glue them on the wooden frame in the right place.
  6. Check if the ball still fits and if it feels sturdy enough. If so, let them dry.

Step 9: Adding Fabric to Head and Body

In this step you are going to glue the white (T-shirt) fabric to the head and body of little Tony.

  1. Take the head (the smaller ball with hole) and wrap it up in the fabric.
  2. Mark the circumference on the fabric.
  3. Unfold the fabric and draw a second outer circle, about 1 cm wider. (This is where the glue will be).
  4. Cut the second circle you drew.
  5. Glue the inside of the edge of the head with textile glue.
  6. Put the head upside down in the middle of the fabric.
  7. First, glue the four opposing sides by pulling the edge of the fabric over the edge of the head. Hold it there until the fabric stays in place.
  8. Fold every other piece of fabric to the same side and while doing that pull the edges of those pieces up and glue them the same way you did before.
  9. If done correctly, you should not see the markings you made on the fabric.
  10. Let it dry.

Now, do the same for the body of Tony, if you want. (If you want to paint the body like I did, I recommend applying fabric to the body too).

Step 10: Cut the Hole in Body

Cut the hole at the top of the body, which is now covered with fabric, open.

Step 11: Adding the Servo Motors

The servo motors will be the rear wheels of the alarmclock.

  1. Mark the circumference of the servo motors on the wooden frame. This will be the place where they will be glued. (make sure there is enough space between the wood and the wheels of the servo's).
  2. Take the double-sided tape and measure how much you need for each servo motor.
  3. Cut these pieces and stick them on the motors. Now, stick the other side of the tape on the wood between your markings.
  4. Make sure it sticks well.

(To take into account when you start glueing : the place of the wheels and the wiring that needs to go to the arduino).

Step 12: Adding Front Wheels

Now that the rear wheels are in place, we need to add front wheels. These wheels can be either readymade wheels like Lego for example or you can make them yourself.

Lego wheels

If you have Lego wheels, you just add them the same way you did with the motors in the previous step.Make sure to take, if possible, wheels around the same size as those wheels from the servo motors.

Self made wheels

If you have to make them yourself, you can do this in various ways. I tried making two with wood and a toothpick as axle. Readymades are a lot cleaner and so I used those, but you can try this one if you like.

  1. Take a huge toothpick (this will be the axle) and place it where the wheels are going to be.
  2. Mark the width of the wooden frame on this toothpick.
  3. Measure, starting from the middle of the toothpick (I mean middle of his roundness, not length) till the ground. Use a levelling board to make it straight if needed.
  4. Double the measured height (This will be the whole wheel. The axle will be in the middle)
  5. Mark the wheels on wood and cut these out using a fret-saw.
  6. Cut a hole in the middle of each, just a tiny bit bigger then the toothpick.
  7. (I recomment trying out if the wheels and the toothpick are good to go, before glueing them on).
  8. If so, glue the toothpick in place and add the wheels on each side.
  9. Add a small wooden piece at each end to keep the wheels in place.
  10. Let it dry.

Step 13: Painting the Body and Head

Take the belly of Tony and paint the pattern you came up with. You may also use my pattern. If you would like that, please use my pictures of the paint as reference.

You can also paint the head of Tony, but keep in mind that the led lights need to be able to shine through.

If you like, you can of course paint the wooden frame to give it just that extra flair.

Then let it all dry.

Step 14: Glueing the Head and Body Together

And last but not least, after everyting is dry and all electronics are in place: glue the head and body together. If you did everything right at this point, all the loose components should be easy to assemble and easy to re-assemble.

This way, if something breakes, you can easily access all components and try to fix things, but hopefully that isn't necessary.

Now you have made a beautiful little Tony of your own. The days of rushing out the door, because of too many snoozes are gone!

Hope you enjoyed this tutorial and may you now have the knowledge to make a Running Away Alarmclock. If you have remarks or questions, feel free to contact me at jantiene.vandrunick@student.hku.nl

Have fun! :D