magnetic sensor

has bugs, needs fix