We have prepared a reliable magnetic field sensor based on a Co-based Schottky heterojunction with the possibility of finding practical application when the current–voltage (I–V) characteristics of the heterojunctions were modified by the external magnetic fields. For this purpose, the heterojunctions based on ferromagnetic thin films Co were deposited on Si (100) substrate via ultra-thin Pt films. The structural and magnetic properties of the heterojunctions were demonstrated, the crystal structure and the saturation magnetization of heterojunctions significantly increased with the increase of annealing temperatures. The electrical properties of the Co/Pt/Si heterojunction were investigated using temperature-dependent I–V characteristics, the rectifying properties were observed in the whole temperature ranging from 233 K to 283 K. Based on a simplified energy band structure, the magnetic field transport properties of Co/Pt/Si heterojunctions were investigated by taking into account the effects of spin and magnetic field on the potential barrier height of Co/Pt/Si heterojunctions. The results showed that the experimental ratio of current measured in a magnetic field B and in zero magnetic field (I(B)/I(0)) is linearly with the magnetic field B and almost independent of the applied voltage. The sensitivity and linearity of the magnetic field sensor were measured. The sensitivity of the sensor can reach 72.09 μA/T at an applied voltage frequency of 2000 Hz, which indicates that the linearity and sensitivity of the sensor are improved with the increase of the applied voltage frequency. The proposed sensors would be easy to integrate with current semiconductor processes with simple structure and they could be suitable for geological applications such as energy exploration.