Magnetic level switch working principle