The anisotropic magnetoresistive (AMR) sensors provide an excellent means of measuring the earth’s magnetic field. Low cost, high sensitivity, small size, noise immunity, and reliability are advantages of AMR sensor over other electrical alternatives. But the sensitivity of constant voltage biased AMR sensor changes greatly with the temperature of surrounding and cross-axis field. In this paper, constant current bias is used in order to reduce the sensitivity temperature coefficient of AMR sensor. At the same time, cross-axis field compensation is taken based on iteration. The results of experiment show that the sensitivity of HMC100x without cross-axis field compensation varies greatly with the variation of cross-axis field, the sensitivity of HMC100x with cross-axis field compensation is stable. It can be seen that proposed sensitivity compensation method is effective. Developed magnetometer is used for vehicle detection. Experimental results show that developed magnetometer is capable of detecting vehicle and its output variation curve shape is different for the ferrous cart moves over sensor along different direction.