A very cheap and simple repellent can be used for rats, mice and other animals can be built using electronic diagram below.
The circuit uses a CMOS integrated circuit type 4047 connected so as to function as a relaxation oscillator whose frequency can be adjusted between 5 kHz and 30 kHz, with the potentiometer P1. Outputs Q and Q are each in part, are applied each to an non-inverting amplifier 4050 type, IC2 and IC3. The six stages of each integrated circuit are connected in parallel to allow direct attack transistors T1/T2 respectively T3/T4 T1 and T4 or T2 and T3 conducts simultaneously. These pairs of transistors are able to attack a piezo speaker.
Circuit can be supplied with a DC voltage between 15 and 18 volts.