As a type of solid state switch, MR (magnetoresistive) sensor detects the air cylinder piston’s position in pneumatic control system. The construction and working principle of the air cylinder with MR sensor are introduced. Using 2-D magnetic field finite element analysis (FEA) method, the magnetic field distribution of air cylinder with piston motion is analyzed. Simulation results are given. The magnetic flux density characteristics are compared between piston wear or not.