A spin based electronic device can be used as a magnetic field sensor. The
device uses ferromagnetic materials for implementing a variable spin
resistance. An external magnetic field can change the magnetization state
of the device by orienting the magnetization of the ferromagnetic layers
to be parallel or antiparallel, thus changing the resistance of the
device to a current of spin polarized electrons.