Weasley Clock Project showing the location of family members





I wanted to surprise my wife for Christmas. She is a redhead, a Harry Potter fan, and also a mother; all of this inspired me to create the Weasley watch. I came up with the idea in February, so I had 10 months to develop and create the project.



For people unfamiliar with Harry Potter and the Weasley family, I will explain that the Weasley wizard family has a magic clock that does not show the time, but the location of family members, for each of which has its own arrow. Here is an excerpt from Harry Potter and the Goblet of Fire (J. Rowling, 2000):

, . . , , – - . , . , , . «», «», «», « », «», «», «»; , «12», « ». «», , , «».



«, !» – , . , «» « », «» , , .


It took some research work to turn magic clocks into real ones. I have a lot of programming experience, but I have only recently started writing code that moves something in the physical world. In 2018, I started running our local FRC robotics club from FIRST , and got to know the world of motors and encoders.





The flowchart for updating data on the Weasley watch:

Users on smartphones have the Life360 app running -> The

app tracks users' location and speed ->

HA tracks users and calculates the state of the watch. Sends updates via the MQTT protocol to the Raspberry Pi ->

A special weasleyclockd process is running on the Raspberry Pi, which monitors the MQTT stream and controls the clock servos ->

Any sufficiently advanced IoT integration is indistinguishable from magic.




I split the project with the clock into several sub-projects that could already be worked with, and started by tracking the location. At first, I used Apple's Find My Phone mobile app, since all of my immediate family members use iPhones. But then I switched to Life360, because their API turned out to be more user-friendly for third parties, and allowed me to add my wife's relatives who live with us and use Android phones. Even before starting building and programming, I had to convince all of them to install Life360 and use it. Fortunately, everyone agreed. My wife did it for security reasons, never learning about my secret plan to make a complicated surprise for Christmas.



The next challenge was the creation of a watch with multiple hands. I naively assumed that such things existed, and I would only have to buy something similar and just cram my own motor controllers in there. I ended up using concentric brass tubing from hobby shops. I attached gears to the pipes with clamps from ServoCity.com.



For turning the arrows, I decided to use servo-winches with the possibility of multiple turns. I bought from Adafruit and soldered a 16-channel Raspberry Pi Servo HAT expansion board and started prototyping. And around that moment, I was overwhelmed with excitement as I realized that it was all going to work.



Then I needed a program that converts the raw location data into specific states of the Weasley clock. I decided to make the Home Assistant automation system an intermediary between the location data from Life360 and the calculation of the clock state. This complicated the system as a whole, but allowed me to shift the burden of Life360 integration (and potential API changes in the future) onto the shoulders of Home Assistant. Tracking people's specific WiFi hotspots allows me to more accurately pinpoint their location in the house. When, for example, someone's phone connects to a street router, the system knows that the person is in the “garden”.





Home Assistant Panel



Having written the rules for Home Assistant, I got a control panel, where all the states of the Weasley clock were listed. Now I only needed to use this data to move the clock hands.



Home Assistant is an open source home automation project with a focus on local storage and management. This is in contrast to most IoT automation systems that require an internet connection and store your data in the cloud.



Given that the clock states were already calculated on the Home Assistant itself, and the Raspberry Pi and servo controllers stood in the clock, I needed to figure out how to transfer data from the Home Assistant to the Weasley clock. I chose the MQTT protocolpopular for IoT use and well supported in Home Assistant. I added automation to Home Assistant to send MQTT messages whenever the watch status changes. On the listener side, I wrote a Python daemon, weasleyclockd , that listens to the MQTT event stream and moves the arrows accordingly.



I added some information to the watch face so that there was more data than just "at home" or "lost." In the sectors "lost" and "on the way" the position of the arrows from the indicated values ​​is proportional to how far from the house the person is. You can understand at a glance whether a person is close to home, or he is in the nearest store, or a hundred kilometers away.



To make it easier to read, the arrows are staggered to avoid crowding in sectors such as the "house". The house sector is divided into two parts - the main house and the second building, the workshop.



In the project, an important part is occupied by the drawing of the dial. I found a beautiful Weasley clock poster by Minalima . This author has drawn many of the official drawings for the Harry Potter films.



Making this watch, I tried to imagine what their case should be. I realized that it would be best to reuse an antique clock. Or you could have made the case yourself, but I had no experience of working as a cabinetmaker. In principle, it was possible, but I knew that the results of my first job would not suit me. The mantel clock I saw in local antique shops in Snohomish, Washington was too small for the clock mechanism and dial. And then luck smiled at me.



My wife and I drove to Whidbey Island and wandered into the Good Cheer Thrift Store in Langley. They sold a grandfather clock, the size of which, at first glance, was suitable for both the mechanism and the dial. However, I was not at all ready to buy them. I didn't have with me the dimensions of the dial and movement. And with me was my wife, for whom this surprise was intended. So I just remembered this moment, and decided that I definitely needed to buy such a clock



at Home, armed with all the measurements, I began to comb eBay in search of a grandfather clock. This was not an easy task. Working hours were expensive. Nobody wanted to send them. As soon as I found some suitable watch, it turned out that they were sold by self-pickup from Florida.



Three months later, my wife and I decided with the whole family to go to Whidbey Island again. We dined at Langley again, and I quickly darted to that store. The grandfather clock was still there! They were even discounted to $ 165. Such a fortunate coincidence could not be overlooked, so I asked my wife not to ask questions, as it was all part of the surprise. I bought a watch and we loaded it into an already packed Honda Odyssey van. Now she already understood that something was planned.



It turned out to be an even more difficult task than the watch case to figure out how to make the hands. I initially wanted to either 3D print them or cut them out of brass. I am fortunate to have a couple of my own experts on this matter at home. Seeing the stunning printed arrows on Printable Props, I decided on 3D printing. Our son Alex just finished his high school Advanced CAD course and passed his Solidworks certification exam with excellent marks. I loaded it up with making arrows and they came out great. My father-in-law Ron was in charge of 3D printing. He works with a 3D printer on our robotics team, and serves as our local expert on the subject. To finish off the arrows, I painted them with metallic paint and added black for contrast.





Family movements during the day





Distance from home



I really wanted to brag about the capabilities of the watch, but in the midst of self-isolation, no one went far from home. To solve this problem, I wrote a program that sends recorded sequences of MQTT messages. I could simulate events and make the clock hands move as if people were driving back and forth.





Completed clock





Put it in the kitchen



In the end, I managed to keep the whole project a secret. But I didn't have time with him for Christmas. Therefore, during the holidays, I had to demonstrate the clock in a non-working, static state. I managed to bring the outer polish, and my wife was surprised and delighted.



Another two months were spent on the final finishing work - printing the components on a 3D printer, installing the mechanism, printing and painting the arrows, and adjusting the software.



The project seems to be complete, but I want to make a few more improvements. I plan to assemble a clock with six or seven hands and automate the striking of the clock.



To paraphrase Arthur Clarke: "Any sufficiently advanced IoT integration is indistinguishable from magic."



In the second generation of Weasley watches, I would like to change the following:



  • Design and print gears that cling to brass rods directly.
  • Use motors with encoders.
  • Cut the arrows out of the brass to make room for more arrows.


Links to my development log, photos and programs:






All Articles