Active pest control for basement, attic, or crawl space


This is a humane pest control system for enclosed spaces such as attics, basements, and crawl spaces.  It uses passive infra-red(PIR) sensors to detect motion, and activate ultrasonic alarms and blinking LEDs to irritate pests and hopefully encourage them to go somewhere else.


Ultrasonics and Animal hearing range


  • Deer
  • Bird
  • Human
  • Cow
  • Horse
  • Pig
  • Rat
  • Mouse
  • Dog
  • Cat
  • Raccoon
  • Opossum
  • Bat



  • Detect motion: Multiple PIR sensor detect motion, and sets off alarm
  • Activate on a regular interval (100m), and sets off alarm
  • Alarm
    • LED blinks: 4 blinks, pause, 4 blinks, pause, ...
    • Sound: beeps at 25kHz while LED blinks, pause. beeps, pause, ...
    • Repeats: 20 times


  • Arduino Mini Pro 16MHz/5V
  • 12V/5V power supply
    • Can be done with only 5V,
      • but some LED arrays are V > 5V
      • and piezo speakers are louder when driven with higher voltage
  • Bright LEDs
  • Ultrasonic piezo speakers
  • PIR sensors
  • MOSFET or BJT trasistor (for driving piezo speaker, and turning on/off LED arrays



You can buy 12V LED modules for car light  replacements for pretty cheap, that are bright and multi-directional or you can make your own.

  • Using a transistor driven by the MCU to switch on/off the LEDS


Piezo Speakers

General Specifications

  • Rated frequency 40kHz (I actually used 25kHz)
  • Max Vp-p = 30V, works fine with 5V (10-100dB, I used my smart phone to measure), 12V is louder
  • Impeadance: (2pF - 1MΩ)
  • Filter: 12nF capacitor in series, cuts out lower frequency harmonics, 1kΩ resistor in parallel, recomended somewhere
  • Driven by transistor from the MCU using arduino "tone()" function


Passive Infra-red sensor (PIR)