A spin based device can be used as a magnetic field sensor. The device
uses ferromagnetic materials for implementing a variable spin resistance
to a spin injected current having a particular spin value. 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 an electron
current of a particular spin orientation.