Security system is the current social development hot spot.This paper designsa new electronic fence with STM32F103C8T6 as the core.Based on flyback topology,the design generates pulses through two boosts and determines whether the system has an intrusion event through feedback.The real-time monitoring of security is real-ized in the area with electronic fence.The design is small in volume,high in sensitivity,can achieve 24-hour mo-nitoring,fully fit the current security system of small,high reliability of the development trend.