An Engineer’s Marriage Proposal: Using a Raspberry Pi to create the Pensieve from Harry Potter Sam Rubin Follow Mar 30 · 5 min read

When proposing to my wife, I wanted to create a magical experience that she would always remember. We are both fans of escape rooms, puzzles, and Harry Potter, so I knew I wanted to tie in all three. The custom, hour long escape room I built for her culminated in a real life Pensieve from the world of Harry Potter.

Pensieve from Harry Potter

When she added a vile of liquid to a glowing basin, a video montage of us would play beneath the standing water. She could peer her head over the bowl to watch the video through the liquid. In this post, I’ll detail how I built the Pensieve using a Raspberry Pi and some sensors. To get a final look at the project, take a look at the video below.

Demo of the pensieve in action

Background

For those not familiar with the Pensieve from Harry Potter:

“The Pensieve is enchanted to recreate memories so that they become re-liveable, taking every detail stored in the subconscious and recreating it faithfully, so that either the owner, or (and herein lies the danger) a second party, is able to enter the memories and move around within them.

To bring forth a memory in the Pensieve, one pours the memory from a vile into the basin, a mechanic I knew I wanted to recreate. With a rough idea in mind, I sought to sketch out a first draft of my Pensieve creation.

Pensieve - Draft Sketch

Here’s the basic gist:

Basin is pre-filled with water with a screen beneath it emitting a blue-ish fullscreen background to make the water glow

A hole in the basin, directly above the current water level, leads to a smaller chamber with a water sensor connected via plastic tubing

When water from a vile is poured in, it flows from the main basin, into the plastic tubing, to the secondary chamber with the water sensor

The water sensor is hooked up to a Raspberry Pi, checking for a change in water level every second

If a change in water level is detected, the screen changes from the glowing color to playing a video of our memories that I created

Raspberry Pi and Water Detection

The first part of the project that I tackled was using the Raspberry Pi to detect water level changes. I grabbed a Raspberry Pi, water level sensors, analog to digital converter, a breadboard, GPIO breakout board, jumper wires, a monitor, and a small plastic bowl. Hooking everything together was pretty straightforward and detailed in the GitHub repo. I also added a [python script](https://github.com/smrubin/pensieve/blob/master/pensieve.py) to check for changes in the water level sensor every second. If a significant change was measured, the video would play on the Pi. Below are a picture and schematic of the water level detection setup with the Raspberry Pi.

Water sensor hooked up to breadboard and Raspberry Pi

Fritzing Schematic for the RPi GPIO Breakout Board and Water Level Sensor

The Pensieve

When envisioning the final product, I knew I wanted to hide as many of the electronic components from the eye as possible, to keep it magical. I figured I could mount the basin inside of a wooden fixture so you could view the screen through the basin and water, but not see anything else (i.e. all of the electronics). While the entire project is movable, I ended up sizing it to fit into an armoire I had placed in the escape room. This placement helped mask all of the electronic parts, and also allowed my wife to unlock the Pensieve as the final “puzzle” in the escape room.

I built the Pensieve basin using some wood and a plastic bowl. The lip of the bowl rested nicely on top of the cutout from the wood, making it easy to add and remove the basin when wanting to add or remove water.

Pensieve Basin, sitting inside an armoire

Tying the Basin and Water Detection Together

Now that I had water detection working and the structure of the Pensieve complete, the final step was to connect the two components. I drilled a hole in the side of the plastic bowl, added some plastic tubing, and connected the bowl to the water level sensing chamber. When the water level exceeded a certain height in the basin (i.e. when a vile of water is poured into it), the water would exit the basin and move into the plastic tubing, flowing into the chamber where water level sensing was present, triggering the Raspberry Pi to detect the change and play the video.

Plastic bowl with tubing, resting on pensieve base

Pensieve — Setup and ready for go-live

Go-Live

When it came time for my wife to open the armoire and discover the magic of the Pensieve as part of the proposal, she was able to quickly realize the need to pour in a vile. She loved re-living our memories via the video playing beneath the glowing water.

In the future, I’d love to make the Pensieve less error-prone and also to add the ability to trigger multiple memories without needing to empty the secondary water chamber for each memory; not a large inconvenience, but takes away the magic when demoing to more than one person.

Overall, building the Pensieve was really fun and loved by everyone, especially my wife, who was able to explore the magic behind it. Hopefully others can use this project as inspiration for creating magical experiences via the power of the Raspberry Pi, and engineering. Accio, marriage.

Further Exploring

[GitHub Repo](https://github.com/smrubin/pensieve)