Functional Weasley Clock (IOT Location Tracker)
by degrooty in Workshop > 3D Printing
7145 Views, 67 Favorites, 0 Comments
Functional Weasley Clock (IOT Location Tracker)
![schoolLOL.jpg](/proxy/?url=https://content.instructables.com/FO9/GSWB/IXGFORAL/FO9GSWBIXGFORAL.jpg&filename=schoolLOL.jpg)
![introPIC.jpg](/proxy/?url=https://content.instructables.com/F3K/AVE7/IXGFSLLX/F3KAVE7IXGFSLLX.jpg&filename=introPIC.jpg)
Christmas is approaching quickly, and now it's time to get on those gifts! For my Mom, an avid Harry Potter fan, I decided to create the ultimate fantasy paraphernalia item: A functional Weasley clock! For those readers who aren't as familiar with the series, this clock has a hand for each family member which points to their location. It most notably appeared during the second wizarding war, when each Weasely was located at their "Mortal Peril." While this project is heavily documented on the internet, I wanted to make my own version with a cheaper and simpler design. I was first inspired to pursue this project after looking slightlygreen's adaption of a location clock. However, he didn't describe in detail how to provide accurate GPS data for the clock to use. To solve this problem, I decided to use my phone as a tracking system! The final product turned out really well, and my Mom loved it!
How It Works
The Weasley clock is powered by an Arduino MKR1000. This chip creates a basic HTML website with six links. Each link rotates the servo to a different position/location. Then, an Iphone with the IFTTT app makes a web request whenever it enters a certain geographical area. This web request will activate the link corresponding to the current location of the phone.
Keep reading for in depth instructions on how to make this "magic" clock!
Materials and Tools
![materialsetc.jpg](/proxy/?url=https://content.instructables.com/F8T/HAN1/IXGFOQ9H/F8THAN1IXGFOQ9H.jpg&filename=materialsetc.jpg)
- Arduino MKR1000 (If you're a nifty maker you could easily substitute this for an Arduino Uno + Wifi Shield or a Particle Photon.)
- Sail Winch Servo (See the note below before you purchase this.)
- jumper wires
- 1/2x8x8in piece of plywood
- Access to a 3d printer
- Access to a laser cutter
- a 2d printer
- a drill
- a stable wifi connection
- an account on the IFTTT site
- an Iphone or Android with the IFTTT app
- a wall to hang the damn thing on!
Continuous rotation/360 degree servos VS. Sailwinch/720 degree servos
You may be wondering what this thing called a sail winch servo is and why a normal old 360 degree micro servo from Adafruit just won't do the trick. Think of a continuous rotation servo as a normal DC motor, but with an easy way to finely control the speed and direction. However, this sort of motor is not able to turn to a specific position and stop like a normal 180 degree servo using the servo.write() arduino command. These servos are often called 360 degree servos even though they have a very different function. Sail winch servos, on the other hand, are made for remote control boats and behave just like a normal 180 degree servo, (you can pinpoint a position), with a larger number of possible of degrees of rotations. This is usually around 720 degrees. This makes sail winch servos ideal for a location based clock! For more information check out this article: https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=56929
Laser Cut and Prepare the Clock Body
![20161222_174026.jpg](/proxy/?url=https://content.instructables.com/FSU/N0DP/IX6FOVXD/FSUN0DPIX6FOVXD.jpg&filename=20161222_174026.jpg)
![20161222_174013.jpg](/proxy/?url=https://content.instructables.com/FV5/KIYX/IX6FOVX5/FV5KIYXIX6FOVX5.jpg&filename=20161222_174013.jpg)
![20161222_171517.jpg](/proxy/?url=https://content.instructables.com/FHV/ODQM/IX6FOVWV/FHVODQMIX6FOVWV.jpg&filename=20161222_171517.jpg)
![5862b4f28852ddf3aa0018b7.jpeg](/proxy/?url=https://content.instructables.com/F2Z/C531/IX6FOW82/F2ZC531IX6FOW82.jpg&filename=5862b4f28852ddf3aa0018b7.jpeg)
The original Weasley Clock from the movie includes 10 locations on the face. However, some of these categories would be nearly impossible to detect, such as the difference between house and bedroom. My final edited down list of toponyms is this:
Home
Prison
Dentist
School
Mortal Peril (Set this to your greatest fear. . .)
Tailor
DESIGN
I designed the body in Fusion 360 and then exported the sketch as a .dfx file. If you are curious how to make or customize your own check out the time lapse above of me designing it. For the rest, the file is attached at the bottom of this step.
ENGRAVE
First, import the .dfx file onto your preferred laser cutting program, I used Corel Draw. Then program your machine to these settings: (Reference the above picture to see which lines are set to each color)
LAYER MODE SPEED POWER
BLACK CUT 200.0 20.0
RED CUT 17.0 72.0
GREEN SCAN 250.0 20.0
The entire process to around a half an hour and turned out really well!
However, after I laser cut the product I realized that I had omitted a central hole for the servo shaft! To deal with this I found the center of the "circle" with a couple rulers, and then drilled a hole. Congratulations! You have finished the clock body!
3d Print and Finish the Clock Hand
![3d Printing the Weasley Clock Hand](/proxy/?url=https://content.instructables.com/FEK/1AX2/IXAQ6FT2/FEK1AX2IXAQ6FT2.jpg&filename=3d Printing the Weasley Clock Hand)
![IMG_4274.JPG](/proxy/?url=https://content.instructables.com/F7M/PB78/IXGFJGRB/F7MPB78IXGFJGRB.jpg&filename=IMG_4274.JPG)
![IMG_4275.JPG](/proxy/?url=https://content.instructables.com/FYB/P0QK/IXGFJGRD/FYBP0QKIXGFJGRD.jpg&filename=IMG_4275.JPG)
![IMG_4280.JPG](/proxy/?url=https://content.instructables.com/FR2/E5ON/IXGFJGRJ/FR2E5ONIXGFJGRJ.jpg&filename=IMG_4280.JPG)
I based my hand on the movie's depiction. First, I 3d modeled the hand in fusion 360 with a space at the rear for a small photograph. However, when I first tried to 3d print it horizontally, the end of the needle collapsed and the rest of the body badly warped. To solve these issues, I split the arrow into two parts and printed both vertically. Finally, it worked! I have attached these files above. Next, I superglued the pieces together with a third hand for support. After it dries, follow these steps to personalize it:
1. Find a picture of yourself either on your phone or computer
2. Crop it so there is nothing else in the background.
3. Before you press print, scale the photo down to a very small size.
4. Print the photo, cut it out, and attempt to insert it into the clock hand.
5. Repeat steps 3 and 4 until the picture fits snugly.
6. Use a small dab of double-sided tape to secure the photograph on the inside of the clock hand.
Program and Connect the Arduino
![Screen Shot 2017-01-01 at 7.33.21 PM.png](/proxy/?url=https://content.instructables.com/F09/FJI3/IXAQ4CZW/F09FJI3IXAQ4CZW.png&filename=Screen Shot 2017-01-01 at 7.33.21 PM.png)
![Screen Shot 2017-01-01 at 7.47.41 PM.png](/proxy/?url=https://content.instructables.com/FFS/Y77S/IXAQ4GGL/FFSY77SIXAQ4GGL.png&filename=Screen Shot 2017-01-01 at 7.47.41 PM.png)
![Screen Shot 2017-01-01 at 7.35.36 PM.png](/proxy/?url=https://content.instructables.com/FV8/JU5I/IXAQ4DNR/FV8JU5IIXAQ4DNR.png&filename=Screen Shot 2017-01-01 at 7.35.36 PM.png)
![Screen Shot 2017-01-01 at 7.37.27 PM.png](/proxy/?url=https://content.instructables.com/F35/0PWA/IXAQ4E8V/F350PWAIXAQ4E8V.png&filename=Screen Shot 2017-01-01 at 7.37.27 PM.png)
![IMG_4299.JPG](/proxy/?url=https://content.instructables.com/FT4/CNL1/IXGFJGM7/FT4CNL1IXGFJGM7.jpg&filename=IMG_4299.JPG)
![Screen Shot 2017-01-01 at 7.38.58 PM.png](/proxy/?url=https://content.instructables.com/FIP/WZHM/IXAQ4ENG/FIPWZHMIXAQ4ENG.png&filename=Screen Shot 2017-01-01 at 7.38.58 PM.png)
![learn_arduino_fritzing_sweep.jpg](/proxy/?url=https://content.instructables.com/F8H/K7NM/IXAQ4GEW/F8HK7NMIXAQ4GEW.jpg&filename=learn_arduino_fritzing_sweep.jpg)
The Arduino sketch I used is largely based off of this MKR1000 introduction tutorial by Charif Mahmoudi. It essentially sets up a basic HTML web page with six links. When each link is pressed, a servo rotates to a different position corresponding with a location on the laser cut clock. I also included lots of comments in the code that should give you an idea of how it works. We will later set up the IFTTT service to make automatic web requests when ever your Iphone enters a certain geographical area. The .ino file is available to download below. To upload the sketch to your arduino follow these steps:
PROGRAM
1. Download the Arduino IDE from arduino.com.
2. Open the .ino file I attached.
3. Go to tools>board>board manager and install the "Arduino SAMD Boards (32-Bits ARM Cortex-MO+)" package.
4. Go to sketch>include library>manage libraries and install the "Wifi 101" library.
5. Physically plug the USB side of a micro-usb cord into your computer and the other into the Arduino MKR1000.
6. Go to tools>ports and select the com input that says "ARDUINO/GENIUNO/MKR1000" or something similar to that.
7. Go to tools/boards and select "Arduino/Genuino MKR1000."
8. Change lines 8-9 of the code to your own Wifi network and password.
9. If you have different locations than mine on your clock you'll want to edit the IF statements appropriately.
10. Upload the code!
11. Open the serial monitor under tools.
12. Write down or take a picture of the website URL.
13. Unplug the Arduino if everything went smoothly!
As for hardware connections, simply follow the basic circuit diagram attached. It is very simple considering there are only three wires to deal with.
TROUBLE SHOOTING
Before anything else, make sure the library and board above have been installed and chosen in the tools menu.
If you still have trouble, their is one main problem that occurred with me. NOT ALL MICRO-USB CORDS ARE CREATED EQUALLY. Make sure your cable supports the transferring of data. When I first attempted to play with my Arduino MKR1000, I used a charging cord from a bluetooth speaker. This cord plugged into everything fine, but simply didn't pop-up in the port selection.
Downloads
Set Up IFTTT
![IMG_4294.PNG](/proxy/?url=https://content.instructables.com/F3N/NPX6/IX6G0DIN/F3NNPX6IX6G0DIN.png&filename=IMG_4294.PNG)
![IMG_4287.PNG](/proxy/?url=https://content.instructables.com/F2X/X4Y3/IX6G0DKB/F2XX4Y3IX6G0DKB.png&filename=IMG_4287.PNG)
![IMG_4288.PNG](/proxy/?url=https://content.instructables.com/FUT/E11R/IX6G0DKL/FUTE11RIX6G0DKL.png&filename=IMG_4288.PNG)
![IMG_4289.PNG](/proxy/?url=https://content.instructables.com/FLD/KBMB/IX6G0DL0/FLDKBMBIX6G0DL0.png&filename=IMG_4289.PNG)
![IMG_4290.PNG](/proxy/?url=https://content.instructables.com/F7C/R1G5/IX6G0DMQ/F7CR1G5IX6G0DMQ.png&filename=IMG_4290.PNG)
![IMG_4295.PNG](/proxy/?url=https://content.instructables.com/FDW/MF5Q/IX6G0DQM/FDWMF5QIX6G0DQM.png&filename=IMG_4295.PNG)
![IMG_4296.PNG](/proxy/?url=https://content.instructables.com/FLM/U39O/IX6G0DQL/FLMU39OIX6G0DQL.png&filename=IMG_4296.PNG)
![IMG_4292.PNG](/proxy/?url=https://content.instructables.com/FLP/9YQM/IX6G0DOX/FLP9YQMIX6G0DOX.png&filename=IMG_4292.PNG)
![IMG_4291.PNG](/proxy/?url=https://content.instructables.com/FZ1/LYFZ/IX6G0DOM/FZ1LYFZIX6G0DOM.png&filename=IMG_4291.PNG)
IFTTT stands for "If This Then That." It is a service which fires an action if some criteria is achieved or "triggered." In this case, if my phone enters a certain location IFTTT will send a web request to the specified URL. Follow the pictures above and these steps to set this up:
1. Open the IFTTT app.
2. Tap on My Applets in the bottom tab bar.
3. Touch the plus icon in the top right corner.
4. Touch the highlighted this link and search for the "location" service.
5. Make the trigger You enter an area and specify that area to your home address.
6. Touch the highlighted that link and search for the "maker" service. The only possible action is Make a web request. Select that.
7. Now it input these settings for the details:
URL: The ip address of your Arduino MKR1000. We took note of this in the last step.
METHOD: GET
CONTENT TYPE: text/plain
BODY: /H (This is what is returned in the arduino code for activating the home link.)
8. Press the Finish button. Ta Da! The applet is complete!
9. Repeat steps 2-8 for the rest of the locations. The only things that should be changed are the specified area in step five and the body of the web request in step seven. If you are confused, the body of each web request is a forward slash and then the first letter of the location. For example Home = /H, School = /S, Prison = /P, etc. Have some fun with it too! Figure out the address of closest prison to you and set MORTAL PERIL to your greatest fear!! My clock ticks to it whenever I'm near the ocean; I'm not a fan of swimming!!
3d Print and Assemble the Electronics/Motor Housing
![IMG_4301.JPG](/proxy/?url=https://content.instructables.com/FDV/TYPB/IXGFOJ08/FDVTYPBIXGFOJ08.jpg&filename=IMG_4301.JPG)
![IMG_4303.JPG](/proxy/?url=https://content.instructables.com/FY4/XSBK/IXGFOJ0G/FY4XSBKIXGFOJ0G.jpg&filename=IMG_4303.JPG)
![IMG_4304.JPG](/proxy/?url=https://content.instructables.com/FIS/CVOM/IXGFOJ12/FISCVOMIXGFOJ12.jpg&filename=IMG_4304.JPG)
![IMG_4305.JPG](/proxy/?url=https://content.instructables.com/FZ0/GLJG/IXGFOJ19/FZ0GLJGIXGFOJ19.jpg&filename=IMG_4305.JPG)
![IMG_4306.JPG](/proxy/?url=https://content.instructables.com/FBL/X2IG/IXGFOJ1E/FBLX2IGIXGFOJ1E.jpg&filename=IMG_4306.JPG)
![IMG_4309.JPG](/proxy/?url=https://content.instructables.com/FH2/GW0N/IXGFOJ1H/FH2GW0NIXGFOJ1H.jpg&filename=IMG_4309.JPG)
![IMG_4310.JPG](/proxy/?url=https://content.instructables.com/FI6/GGTP/IXGFOJ1K/FI6GGTPIXGFOJ1K.jpg&filename=IMG_4310.JPG)
The servo motor and Arduino MKR1000 will be housed in a container that I designed in Fusion 360 the files are available for download below. Follow these steps to prepare the housing:
1. 3d print the "electroMount.stl" file. Remove the raft and supports.
2. Thread the servo wires through the hole in the 3d printed part. Then push the servo down into the bottom of the container.
3. Get a rubber band or hair tie and make a quick knot though the holes. See the pictures above for futher clarification.
4. Push the Arduino under the rubber band into its spot.
5. Find a screw that fits in the hole next to the servo. Screw it in until the motor is snug. Repeat this process for the three other holes.
Downloads
Attach the Electronics to the Clock
![IMG_4314.JPG](/proxy/?url=https://content.instructables.com/FIJ/1HUE/IXGFOK4T/FIJ1HUEIXGFOK4T.jpg&filename=IMG_4314.JPG)
![IMG_4311.JPG](/proxy/?url=https://content.instructables.com/FCA/UJIP/IXGFOK3U/FCAUJIPIXGFOK3U.jpg&filename=IMG_4311.JPG)
![ohyeah.jpg](/proxy/?url=https://content.instructables.com/F7D/K8OE/IXGFOPAI/F7DK8OEIXGFOPAI.jpg&filename=ohyeah.jpg)
![IMG_4313.JPG](/proxy/?url=https://content.instructables.com/FNS/U8HS/IXGFOK4M/FNSU8HSIXGFOK4M.jpg&filename=IMG_4313.JPG)
Time to glue everything together! First 3d print the "servoAttach.stl" file included below. Next, use a powerful super glue or epoxy to secure the clock frame onto the top of the servo. The spindle should now be sticking about half-way through the hole in the center. Now grab the 3d printed servo attachment and stick it through the center of the clock tightly onto the top of the servo. Finally, use more super glue to bind the center of the clock hand and the attachment together.
Downloads
Finish It Up!
![thefinalThing.jpg](/proxy/?url=https://content.instructables.com/FF0/1BLL/IXGFOOEZ/FF01BLLIXGFOOEZ.jpg&filename=thefinalThing.jpg)
![theThing.jpg](/proxy/?url=https://content.instructables.com/FUS/6ZX6/IXGFOO2U/FUS6ZX6IXGFOO2U.jpg&filename=theThing.jpg)
![thatThing.jpg](/proxy/?url=https://content.instructables.com/FM8/3M9A/IXGFOOD6/FM83M9AIXGFOOD6.jpg&filename=thatThing.jpg)
The only thing left to do is add a power source and nail the whole body to the wall! While this project could be easily modified to support a battery pack, I chose to plug the micro-usb cord directly into a AC-USB adapter in the wall. Just plug the other end of the cord into any old phone charger! Then find a nail that fits in the hole above the servo, and pound it in.
I put a lot of time and effort into this project so I would appreciate if you would vote for me in the IOT and Sci-fi Contests! Also, I would love to hear any questions or concerns in the comment section below!
Also, I want to give a shout out to Zposner! Since I don't have a laser cutter he was kind enough to let me borrow his! Thanks Ziven!