Magnetometer is allright for compass usage, but unfortunately too unsensitive for locating anything except very strong magnets at close range. (verystrong=neodyme, closerange=20cm) The "treasure hunters" metal detectors work on different principle; there's a EM coil that's fed with a frequency and another used as pickup, and having metallic objects nearby will affect the mu of the system creating a measurable voltage differential in the coils.