Abstract:To address the issues of low current detection accuracy and susceptibility to interference in switching power supplies under high-frequency environments and weak current conditions, a digital fluxgate current sensor system has been designed. The system employs dual microcontrollers working in tandem, with the STM32F1 responsible for peripheral circuit control, performing periodic sampling of the fluxgate-sensed voltage, and transmitting data to the STM32F4 for backend processing. During data processing, effective signal denoising is achieved through a combination of wavelet transform and Savitzky-Golay filtering algorithms. The Goertzel algorithm efficiently extracts the amplitude of the second harmonic component as a characteristic indicator reflecting the current state. Experimental testing demonstrates that within the measurement range of -3A to +3A, the sensor exhibits a sensitivity of approximately 0.57V/A with linearity error below 1%, maintaining stable output even under interference conditions. Results demonstrate that the system meets the real-time and accuracy requirements of power electronic devices such as switching power supplies, exhibiting promising engineering application prospects.