To protect any instrument from external magnetic field it is put inside an iron box as iron is a ferromagnetic substance it will not get magnetize by the magnetic field due which there will not be any effect of magnetic field on the instrument.