https://github.com/IanDBallard/CatScarer
Project Overview
CatScarer is a Arduino-based cat deterrent system that uses motion detection, multiple deterrent mechanisms, and IR remote control to keep cats away from designated areas. The device operates using a state machine with four distinct operational states, providing both automated and manual control capabilities.
🏗️ System Architecture
Core Components
- Arduino Nano (ATmega328P) - Primary microcontroller
- PIR Motion Sensor (HC-SR501) - Motion detection
- PWM Fan - Physical deterrent mechanism
- Piezo Buzzer - Audio deterrent with siren mode
- RGB LED - Multi-color status indicator
- TSOP1838 IR Receiver - Remote control input
- 3D Printed Enclosure - Professional housing
State Machine Design
🔧 Technical Implementation
State Machine States
1. WARMUP State
- Duration: 45 seconds
- Purpose: PIR sensor calibration and baseline establishment
- Visual Indicator: Blue LED flickering (500ms intervals)
- Interruptible: Yes - IR power toggle can force transition to INACTIVE
- Logic: Monitors PIR initialization status, transitions to STANDBY when complete
2. STANDBY State
- Purpose: Ready for motion detection
- Visual Indicator: Solid green LED
- Behavior: Continuously monitors PIR sensor for motion
- Interruptible: Yes - IR power toggle transitions to INACTIVE
- Transitions:
- Motion detected → ACTIVE
- Power toggle → INACTIVE
3. ACTIVE State
- Purpose: Deterrent mechanisms active
- Visual Indicator: Solid red LED
- Duration: Configurable (default: 5 seconds)
- Deterrents:
- PWM fan at full speed (255/255)
- Buzzer siren mode
- Interruptible: Yes - IR power toggle immediately stops deterrents and transitions to INACTIVE
- Timer Refresh: Motion continues to refresh activation timer
- Transitions:
- Timer expires → STANDBY
- Power toggle → INACTIVE (immediate stop)
4. INACTIVE State
- Purpose: Device disabled, ignores all PIR input
- Visual Indicator: Solid yellow LED (red + green)
- Behavior: Completely ignores motion detection
- Interruptible: Yes - IR power toggle transitions to STANDBY
- Use Case: Manual disable for maintenance, testing, or temporary deactivation
Carlos Barrera
QBFreak
luma
jean-noel.simonnet