Sensing by using magnetic means