(Photos taken of the original props at the Harry Potter back stage studio tour)

The aim of the project was to build a clock containing the visual elements of both items. To achieve the authentic ‘who is at home detection’ I used a Raspberry Pi reading WIFI devices. The MAC addresses collected by the Pi were checked against a known list for myself and Philip and used to control the home / away hands on the clock face. I used an Arduino Uno to control the servos and LEDs on the clock face.

There are several different ways that you can connect a Raspberry Pi and Arduino together to share data, you can use USB or make a serial connection. I decided that I would go for a more hardware based approach and used a bank of 3 relays and a Pimoroni Explorer hat to connect the two. I showed a friend the project and he was curious as to why I would use relays for data transfer but another aspect of the project was to use it as a demonstration of data communications between two computers at school. In effect I have built a very simple parallel interface.

The Arduino build:

The Arduino has two servos attached and 4 LEDs. The left hand servo is a positional rotational servo and is used to indicate if the person is home or away. The right hand servo is a full continuous rotation servo and is used to mock up a minute hand which moves every second. I decided that I was going more for visual appeal so the hand moves more than 6 degrees each second.

I use three digital input connections on the Arduino which wait for a switch to be closed. These are activated by 5V relays powered by the Raspberry Pi. The first input checks the status of my mobile phone, the second my sons mobile and thirdly the status of the home internet.

I have used a simple repeating loop to:

Move the second hand for 30 seconds.
Check the status of digital input 1 (my phone) and move the home / away hand accordingly
Move the second hand for 30 seconds
Check the status of digital input 2 (my son’s phone) and move the home / away hand accordingly
Move the second hand for 30 seconds
Check the status of digital input 3 (virgin broadband) and move the home / away hand accordingly

The Raspberry Pi build:

The Raspberry Pi zero has a Pimoroni Explorer hat attached which is used to power the 5V relays. The digital output pins on the hat are really just a controllable path to ground and don’t actually produce any power which comes from the 5V power out. Using the 5V and these digital ‘outputs’ I am able to control the power to the relays and subsequently the signal sent to the Arduino.

The Raspberry Pi code is essentially very straight forward. I scan the network with arp-scan and look for two specific devices in the output. Depending on their presence I switch on the output to the various relays.

Building the case

The case is actually a satsuma crate from Tesco which I covered in an shop replica Marauder’s map. A 12V power supply is used for the Arduino and the Pi is powered separately. I found that powering the relays and the WIFI was too power heavy to power the Pi off the Arduino, although I might refine that in the future.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.