Scientists are using tiny flaws in diamond, called nitrogen-vacancy centers, as very sensitive magnetic detectors. The spins of trapped electrons act like tiny magnets that respond to nearby magnetic fields.