A magnetic tunnel junction, MTJ, based sensor device, the device comprising: a MTJ element comprising a free layer, a pinned layer, an elastic layer, and a tunnel barrier, the free layer being spaced apart from the pinned layer by the tunnel barrier and the elastic layer, wherein the elastic layer is configured to bend, flex and/or change thickness in response to mechanical shock and vibration; and processing circuitry configured to: measure a resistance at the MTJ element; and determine whether mechanical shock and vibration has occurred based on the resistance at the MTJ element, characterized in that, the tunnel barrier is a first tunnel barrier, wherein the first tunnel barrier is spaced apart from a second tunnel barrier by the elastic layer, wherein the elastic layer is arranged below a lower surface of the first tunnel barrier and spaced apart from a first edge of the lower surface of the first tunnel barrier, and wherein the elastic layer is arranged above an upper surface of the second tunnel barrier and spaced apart from a first edge of the upper surface of the second tunnel barrier, or the free layer is spaced apart from the tunnel barrier by the elastic layer, wherein the elastic layer is arranged below a lower surface of the free layer and spaced apart from a first edge of the lower surface of the free layer, and wherein the elastic layer is arranged above an upper surface of the tunnel barrier and spaced apart from a first edge of the upper surface of the tunnel barrier, or the tunnel barrier is spaced apart from the pinned layer by the elastic layer, wherein the elastic layer is arranged below a lower surface of the tunnel barrier and spaced apart from a first edge of the lower surface of the tunnel barrier, and wherein the elastic layer is arranged above an upper surface of the pinned layer and spaced apart from a first edge of the upper surface of the pinned layer. a MTJ element comprising a free layer, a pinned layer, an elastic layer, and a tunnel barrier, the free layer being spaced apart from the pinned layer by the tunnel barrier and the elastic layer, wherein the elastic layer is configured to bend, flex and/or change thickness in response to mechanical shock and vibration; and processing circuitry configured to: measure a resistance at the MTJ element; and determine whether mechanical shock and vibration has occurred based on the resistance at the MTJ element, characterized in that, the tunnel barrier is a first tunnel barrier, wherein the first tunnel barrier is spaced apart from a second tunnel barrier by the elastic layer, wherein the elastic layer is arranged below a lower surface of the first tunnel barrier and spaced apart from a first edge of the lower surface of the first tunnel barrier, and wherein the elastic layer is arranged above an upper surface of the second tunnel barrier and spaced apart from a first edge of the upper surface of the second tunnel barrier, or the free layer is spaced apart from the tunnel barrier by the elastic layer, wherein the elastic layer is arranged below a lower surface of the free layer and spaced apart from a first edge of the lower surface of the free layer, and wherein the elastic layer is arranged above an upper surface of the tunnel barrier and spaced apart from a first edge of the upper surface of the tunnel barrier, or the tunnel barrier is spaced apart from the pinned layer by the elastic layer, wherein the elastic layer is arranged below a lower surface of the tunnel barrier and spaced apart from a first edge of the lower surface of the tunnel barrier, and wherein the elastic layer is arranged above an upper surface of the pinned layer and spaced apart from a first edge of the upper surface of the pinned layer. measure a resistance at the MTJ element; and determine whether mechanical shock and vibration has occurred based on the resistance at the MTJ element, characterized in that, the tunnel barrier is a first tunnel barrier, wherein the first tunnel barrier is spaced apart from a second tunnel barrier by the elastic layer, wherein the elastic layer is arranged below a lower surface of the first tunnel barrier and spaced apart from a first edge of the lower surface of the first tunnel barrier, and wherein the elastic layer is arranged above an upper surface of the second tunnel barrier and spaced apart from a first edge of the upper surface of the second tunnel barrier, or the free layer is spaced apart from the tunnel barrier by the elastic layer, wherein the elastic layer is arranged below a lower surface of the free layer and spaced apart from a first edge of the lower surface of the free layer, and wherein the elastic layer is arranged above an upper surface of the tunnel barrier and spaced apart from a first edge of the upper surface of the tunnel barrier, or the tunnel barrier is spaced apart from the pinned layer by the elastic layer, wherein the elastic layer is arranged below a lower surface of the tunnel barrier and spaced apart from a first edge of the lower surface of the tunnel barrier, and wherein the elastic layer is arranged above an upper surface of the pinned layer and spaced apart from a first edge of the upper surface of the pinned layer.