Yes, hard and soft iron (like in speakers or motors) or any magnetized material can affect the reading of the magnetometer and basically add or distort the magnetic field reading from the earth. Most magnetometers allow you to offset or calibrate the sensor for hard/soft iron (see the datasheet). However, the field needs to be constant in order to easily correct for it, if it changes a lot, then the offsets will be much more difficult to obtain.
↧