I stumbled upon this idea by reading this great article by Travis Deyle about electro-permanent magnets. These magnets are programmed (on off) with a current pulse. No static energy is required. Changing the magnetic field does require energy and is in the hundreds of mJ for our purposes. These electro-permanent magnets are just as strong as Neodymium magnets.
pdf link to the PHD thesis covering this is on the project page
there been a lot of concern of magnetic interfence with the compass, so here is the spiel
there should be no external field since the field lines are closed through the cargo iron in the on state or through the iron in the device itself.
in the prototype the iron goes beyond its saturation, the thickness should 1mm not 0.5mm same goes for the target. looking at the theoretical performance and the prototypes performance about half the field leaks, eg are not going through the metal. i expect the leakage to go down to below 10%.
a laser cut iron cover covering the magnet itself with some distance in the 5mm range, less 0.1mm thick will absorb the rest of the leakage. we should have a factor of 100 maybe 1000 that we can reduce the external field before one has to invent crazy things. mu metal might give us a few orders of magnitude more, but since its low saturation and some other factors i need to the math to get a quantitative idea on its performance.
long story short simple easy to implement shielding with proper construction should allow one to mount the compass right on top of the magnet
I hope you like my project and am looking forward to some feedback