AN-1140 Ultrasonic Pest Repeller using GreenPAK™

This application note will describe the implementation of motion trigger-able Ultrasonic repeller. The design uses a SLG46140V GreenPAK4 CMIC. The input from a PIR (Passive Infra-Red) will be connected to a digital input pin and the output of an Oscillator will be from a digital output pin. The pulse input from the PIR will be delayed and the output from an Oscillator running at 2000kHz will be scaled down to 21kHz and 24kHz producing 2 alternating tones that are irritating to pests.

Ultrasonic Transducer Background

Animals respond to Ultrasound and avoid its presence. Small mammals like Dogs and Cats respond to 22-25 kHz, Rats to 60-72 kHz, Insects like Mosquitoes & Flies to 38-44 kHz. Ultrasound is biologically safe to human beings according to scientific information. But Ultrasound frequency close to 30kHz can be sensed by children to a certain level. So it is recommended not to use such devices continuously near children below 5 years (Kumar, n.d.).

The Piezoelectric ultrasonic transducer design features a piezo ceramic disc that is resonant at a nominal frequency of 20 –60 KHz and radiates or receives ultrasonic energy.

They are distinguished from the piezo ceramic audio transducer in that they produce sound waves above 20 KHz that are inaudible to humans and the ultrasonic energy is radiated or received in a relatively narrow beam.

The “open” type ultrasonic transducer design exposes the piezo bonded with a metal conical cone behind a protective screen. The “enclosed” type transducer design has the piezo mounted directly on the underside of the top of the case which is then machined to resonate at the desired frequency. (Corp, 2005).

When an electrical potential is placed across the Piezo material, the geometry changes thereby disturbing the acoustic surface. When an oscillating electrical potential is placed across the Piezo material, the acoustic surface generates an acoustic signal. When receiving an ultrasonic signal, the ultrasonic waves strike the acoustic surface thereby compressing the Piezo material.

Piezoelectric materials vibrate in response to alternating voltages of certain frequencies applied across the material. Piezoelectric elements are similar to common analog capacitors in that piezo elements generally include two electrodes separated by a piezoelectric material that functions as a dielectric, shown in Figure 1 and the sensitivity with respect to frequency is described in Figure 2 (Corporation, 2006).

Dimensions in mm (Corporation, 2006)

Figure 1. Dimensions in mm (Corporation, 2006)

Sensivity/Sound Pressure Level (Tested under 10Vrms @10cm)

Figure 2. Sensivity/Sound Pressure Level (Tested under 10Vrms @10cm)

PIR Detector

The PIR (Passive Infra-Red) Sensor is a pyroelectric device that detects motion by sensing changes in the infrared (radiant heat) levels emitted by surrounding objects. This motion can be detected by checking for a sudden change in the surrounding IR pattern. When motion is detected the PIR sensor outputs a high signal on its output pin. This logic signal can be read by a microcontroller or used to drive an external load (inc, 2014). Refer to PIR Sensor part number: 555-28027 datasheet for complete technical specifications. Figure 3 shows a typical circuit to interface this PIR detector, where Vcc can be in the range of 3.0V to 6.0V DC and P0 is the output. The PIR Sensor requires warm-up time which can be up to 40 seconds.

PIR Detector and schematic

Figure 3. PIR Detector and schematic

Implementation of triggered Ultrasonic Transmitter using GreenPAK Designer

Figure 4 shows the Green PAK designer schematic and its external connections to the PIR detector and piezo buzzer (ultrasonic transmitter).

Green PAK schematic with external connections

Figure 4. Green PAK schematic with external connections

Figure 5 shows the configuration setting for the 2000KHz oscillator and 108Hz oscillator. The pulse output from PIR detector is connected to digital input pin 6 of the GreenPAK device.

Green PAK schematic with external connections

Figure 5. Configuration of Oscillators

In this application two counters are used to divide clock output from RC OSC which is 2000kHz to produce 21kHz and 24kHz.

The CNT0/DLY0 is a 14-bit counter and it divides the clock by 45, resulting in 43kHz clock which is further divided by a DFF 4 to produce ~21kHz. Similarly CNT1/DLY1 8-bit counter is configured to divide the clock by 40, which is further divided by DFF5 to produce 24kHz. The 108hz output from LF OSC is also divided by CNT3 to generate a 2Hz clock which is further divided by a DFF latch to generate 1Hz that is used to toggle select input of the Mux 3-L2. The Mux inputs are connected to 21kHz and 24kHz sources. The delayed PIR trigger is ANDed with Mux output. The configuration settings of the Oscillators and Counters are shown in figure 5 and 6.

Whenever PIR detects a pest’s movement in front of its region of sensing, the Green PAK device will produce annoying 24Khz and 21 Khz alternating sounds which has proved to be irritating to both cats and dogs.

14-bit and 8-bit Counter configurations

Figure 6. 14-bit and 8-bit Counter configurations

SLG46140V Oscillators

The SLG46140V has two internal RC oscillators (25kHz or 2MHz, user selectable), as well as one Low-Frequency oscillator (1.9kHz) and one Ring oscillator (25MHz). In this application only two oscillators will be used: RC OSC whose clock frequency of 2MHz will be divided down and used to drive the transducer, and clock frequency of 1.743 Khz output from LF OSC will be used as reference clock to create delay in the 8-bit CNT1/DLY1 as shown in figure 5.

Both of these Oscillators RC OSC and LF OSC can be turned on by:

  • Register control (force power on);
  • Delay mode, when delay requires OSC;
  • ADC;

Counters/Delay Generators (CNT/DLY)

There aretwo configurable counters/delay generators in the SLG46140V. One of the counter/delay generators (CNT/DLY0) is 14-bit,and the other counter/delay generator (CNT/DLY1) is 8-bit. In this application CNT/DLY1counter/delay is used which has one input from the connection matrix, which has a shared function of either a Delay Input or an external clock input. As shown in figure 7, if a DLYOUT is required which is delayed output of the falling edge of DLYIN, Delay Time can be set as shown in figure 5 configuration. This delay time is increased or decreased using Counter data. For this application it is set to 50 which creates a delay time of 29.8 ms.

SLG46140V Counter and Delay Generator (Silego Technology, 2016)

Figure 7. SLG46140V Counter and Delay Generator (Silego Technology, 2016)

Testing Ultrasonic Repeller

Figure 8 shows the testing setup for this application. The PIR detector has been connected to work at +5.0V as shown in figure 4. The Oscilloscope channel 2 is connected to the PIR output whereas channel 1 is connected to PIN 9 of the GreenPAK device. The GreenPAK emulator is turned on to observe the output. Figure 9 shows the Proto-board wiring of PIR supply.

Testing of Green PAK development board (Ultrasonic repeller)

Figure 8. Testing of Green PAK development board (Ultrasonic repeller)

Proto-board setup of the PIR supply connections

Figure 9. Proto-board setup of the PIR supply connections

Figure 10 shows the Oscilloscope screenshot of the PIR pulse output.

PIR output

Figure 10. PIR output

21 and 24Khz square wave

Figure 11. 21 and 24Khz square wave

Figure 12 shows the output when PIR detects movement multiple times. Notice the response is only on the positive edge of the PIR pulse.

PIR movement detection

Figure 12. PIR movement detection

1Hz output to toggle MUX select input captured from Digital output PIN10 , rising edge of the 1Hz clock, and output from PIN9 shows combined output of 24kHz and 21kHz alternating.

Figure 13. 1Hz output to toggle MUX select input captured from Digital output PIN10 , rising edge of the 1Hz clock, and output from PIN9 shows combined output of 24kHz and 21kHz alternating

Refer to pin labelled “1st_Freq” in figure 4 Schematic.

Further improvements and modifications

This application can modified to include more than two frequencies that can ward off other pests like Deer and also repel insects. The settings for effective Ultrasound is as follows: 38-44kHz for Mosquitoes, Fleas, House Fly, Spiders, Cockroaches. 52-60kHz for Lizards. 60-72kHz for Rats (Kumar, n.d.). To make this application more effective, additional ultrasonic emitters and PIR sensors can be designed in, as can be laser perimeter detectors. Power efficiency for outdoor versions can be achieved by recharging the batteries of a small unit with solar cells.


The small size and low power consumption of GreenPAK SLG46140V makes it ideal for a small size module that can be installed more easily, and be less visually obvious. The usage advantage of GreenPAK is flexibility to tune, modify, enhance the circuit, and zero coding for a robust design.


1. Corp, P.-W. E. (2005). Selection and use of Ultrasonic Transducers. AN050830, 8.

2. Corporation, P. W. (2006). Air Ultrasonic Ceramic Transducers. 250ST/R160.

3. inc, P. (2014, 3 27). Parallax inc.Retrieved from PIR Sensor:

4. Kumar, D. M. (n.d.). Electro Schematics. Retrieved from Ultrasound and Insects:

5. Silego Technology, I. (2016, August). Retrieved from

About the Author

Name: Ahmed Asim Ghouri

Background: Ahmed Asim Ghouri graduated from Staffordshire University (U.K) in 2000 with a M.Sc in Electronics Engineering and 2012 completed certificate course in DSP Systems Engineering from UCLA, Irvine. Since then he has been working as FPGA/Embedded design engineer, he is the Project Lead at Embedded Strings inc. working on hardware implementation of DSP functions for Biomedical Applications, Audio signal processing and Image processing.



See full list of Application Notes