Back to Concepts

Jack Sparrow's Compass

19 Aug 2022
Progress: Design Stages

I'm posting this as a concept, but in actual fact it is an abandoned project I spent some time on many years ago. I'm unlikely to finish it soon.

In the first Pirates of the Caribbean film, we are introduced to a compass that doesn't point north. It points to "the thing you want most".

Screenshot from the film

I'm sure plenty of people were inspired by it, but the particular compass that I'd like to build would point to where I need to be.

Yo ho, yo ho, a biker's life for me

I navigate London on a bicycle for the sole reason that it is the fastest way to travel. Motorbikes may have the advantage in terms of top speed, but that's irrelevant when the limiting factor is so often the traffic. Bicycles have the unique ability to stop being a vehicle: by getting off and walking, you become a pedestrian, and can take the crossings and shortcuts that are available to them. Bikes can even be taken on the overground trains, and some of the underground ones, so if the route makes sense you can hop onto a train for part of it, and cycle at each end. London is not exactly Holland, but I have tried almost every way of navigating the city, and consistently conclude that the bicycle is king.

For a very long time, I navigated using a real, physical compass. I would look at the destination on a map beforehand, then set off in roughly the right direction and figure it out as needed. The Pollock that is London's road layout makes this harder than it ought to be, but I enjoyed the challenge and quite quickly got the hang of it. Finding a new route, getting lost and heading in approximately the right direction until we see something we recognise was all part of the fun. The compass is only really needed if it's very cloudy, or you take a train for part of the way, and upon exiting the station, need a moment to find your bearings, so to speak.

The lack of a grid system makes dead reckoning hard. The wildly varying shapes and sizes of the roads, the inconsistent traffic flows and the scarcity of straight lines mean it's inevitable that we overshoot our target every now and then. At these moments, we turn to our smartphone, the digital maps, the satellite navigation, but for as long as I can remember, all I've really wanted is a simple arrow that says "Your destination is that way". I'll figure out the route. As the crow flies, as the roads weave, as the secret cyclist shortcuts open up to me, I'll find my way.

Cyclist holding up a bike in front of the London skyline

Do what you want 'cause a cyclist is free...

All I ask for is a hint. The real problem with Google Maps is that it doesn't understand my navigational style. Often the suggested route starts by heading away from the destination in order to follow the rules of the local roads, which often don't even apply to bikes. In recent years, they have added bicycle-specific routing modes, which attempt to solve the problem, but I still find it woefully disappointing. The routes make generalising assumptions, that we must avoid main roads at all costs, and only travel on the quietest paths. They never point out the secret passageways, the shortcuts only available to cyclists. They certainly don't account for the mixed-media travelling – such as hopping on a train for part of the route – that makes my transit style so effective.

Way back in 2009, when I first bought a smartphone, one of the first apps I tried to make for it was a virtual version of my dream compass. It should have been very simple, just a big arrow pointing to a GPS location. That phone was the Nokia N900, one of the greatest smartphones to ever exist, but believe it or not the N900 lacked an onboard compass. The app was pointless without it, the whole idea is that you can swivel the phone around and the arrow keeps pointing the way. I'm sure that by now such an app exists, but even modern smartphones have a really difficult time showing a compass. I think it's because the tiny hall sensor is packed in tight with all the other electronics that tend to drown out the earth's magnetic field. I often chuckle when I see people "recalibrating" their phone's compass, drawing the characteristic figure-eight shapes in the air. Jack Sparrow's compass surely didn't need such nonsense.

The design

The idea, as you've no doubt guessed, is to build a replica of the movie prop that points to a GPS coordinate. Naturally it needs to resemble the original as close as possible, with no visible electronics, and no hint that it's powered by anything other than magic.

The control would most likely be over bluetooth, a simple command to set the destination. It could also work in conjunction with a phone app, simply displaying a direction the phone sends to it, but I think it would be better to have GPS and the necessary electronics onboard, so that once the destination is set, the device continues to work without needing to be paired to a phone.

A stretch goal is the "moving target" scenario, where perhaps the destination is another person. They could be sharing their location, possibly via a well-known messaging service, in which case the only practical solution is to stream position updates to the compass over bluetooth.

The most important aspect is to have an accurate compass sensor. There are off-the-shelf combined hall-effect / accelerometer / gyroscope MEMS devices that have built-in kalman filtering, which should be more than adequate, so long as we physically locate it far away from any interfering electronics.

I think it's quite important that the compass needle is real, and controlled by magnetic fields. This turned out to be a pretty big stumbling block because the magnetic field required to accurately position the needle is a lot more powerful than you'd expect. Deep in a box at the back of my shelves, there is a collection of various compasses and coils of wire from my earliest experiments with this.

A compass and a coil of wire

Any field we create needs to completely drown out the earth's magnetic field, or else compensate for it. It also needs to be fairly uniform across the whole compass, in order to catch the needle from wherever it's resting and rotate it into position. My idea was to fit a series of little coils all around the perimeter, maybe twelve or sixteen of them, and modulate their field strengths. Perhaps three or four pairs of coils would be enough, with modulation, but the physical size is a concern. It all needs to fit into the enclosure without giving anything away.

But tiny coils have tiny fields. In order to reliably move the needle into position I needed to pump several watts of power into it, perhaps half an amp at five volts. I tried a number of different coil arrangements but nothing seemed to tick all the boxes. Once the needle is in place, only a small field is needed to keep it there, so maybe some kind of catch mechanism where it rotates the field once fully before trying to point anywhere would work.

At the back of my mind I'm worrying about the field strength affecting our hall sensor. The most logical place to put the sensor is at the top of the lid, as far from everything as possible. When the lid is closed the coils will be unpowered, so the filtering can continue, with the dial ready to read as soon as you open it.

I think the correct direction to take is to build the compass completely from scratch, with the needle/disk resembling the film prop closely. Underneath it we can mount some more substantial coils, and onto the disk we can mount some magnets. The arrangement would then be more like a stepper motor. We could even mount an existing stepper-motor's stator under the disk. This may still take a fair bit of power to drive, but the field should be mostly self-contained. A downside is that we would need to also add an encoder to know what direction it's currently facing. It would also probably be necessary to emulate the smooth motion we desire, instead of rigidly snapping to the new direction.

Another view of the compass from the film

Mounting anything into the lid will take some careful planning, in terms of cable routing at least. With a 3D compass sensor, the angle of the lid shouldn't be too much of a problem, as we only care about the field direction in relation to gravity (which the accelerometer will measure). A little trigonometry will be enough, I don't think we'd need an encoder on the lid position. Funnily enough, the usual way of detecting a lid closing, for instance on a laptop, is to fit a magnet and hall sensor. In this situation we'd obviously want an alternative, such as an IR proximity sensor.

Where to go from here...

It really shouldn't be that hard to turn this idea into reality. There's plenty of room in the enclosure for the electronics, the challenges really aren't that difficult.

Maybe one day I'll make it happen.