Rat infestation remains a major constraint to rice production, causing significant yield losses and threatening food security in many rice-growing regions. Although ultrasonic deterrent systems have been promoted as an environmentally friendly alternative to chemical rodenticides, their effectiveness is often inconsistent due to static frequency emission and rapid behavioral habituation. This study proposes an adaptive scheduling model for ultrasonic frequencies based on real-time environmental data to enhance long-term deterrence effectiveness. The model integrates environmental sensing, stochastic frequency selection, and habituation-aware control within a context-aware scheduling framework. Environmental data were acquired using field-deployed sensors, while the adaptive algorithm dynamically adjusted ultrasonic frequency, emission duration, and interval. Field evaluations compared the proposed system with static ultrasonic control. Results demonstrate sustained spectral diversity, reduced habituation, and significant decreases in rat activity and crop damage, alongside improved energy efficiency. These findings highlight the potential of adaptive ultrasonic control as a scalable and sustainable solution for smart agriculture, supporting chemical-free pest management and precision rice farming.