The use of Arduino Uno-based motion sensors has a significant impact on preventing rat pest attacks in rice fields. This prevention will provide added value for farmers in the productivity of their crops. In addition, the use of motion sensors in this research is considered more efficient and effective. The main problem faced is how to design a mouse midge device on rice plants using a motion sensor and how the working principle of a mouse midge device on rice plants uses a motion sensor. This study aimed to design a rat midges device in rice plants using motion sensors and to know the working principle of a rat midges device in rice plants using motion sensors. The research methods used are literature studies and practical studies. Electrical design using fritzing software. The software installation process uses the Arduino IDE and encodes the Arduino Uno to activate the buzzer and ultrasonic sensor. The research results show that testing a prototype of this rat midges tool uses an ultrasonic sensor based on Arduino Uno, which is a means to make it easier for farmers to repel very disturbing rat pests. With this prototype tool, it is hoped that it will be able to save and streamline time and energy. Based on the black box data above, testing of this prototype tool was declared successful. The condition of the hc-sr04 sensor module and buzzer in detecting mouse movement, with the parameters of the hc-sr04 sensor module ranging between < 4 meters can detect distance. Meanwhile, at a distance of ≥ 5 meters, the HC-SR04 sensor module is no longer able to detect it.