Automated Air Filtration System for Cat Litter Boxes - Universal Fit - Customizable
Automated Air Filtration System for Cat Litter Boxes - Universal Fit - Customizable

This is a universal, Arduino-powered air filtration system designed to be mounted on virtually any cat litter box. The goal of the project is simple: automatically remove odors after your cat uses the litter, all while ensuring maximum safety and minimal disturbance.


At its core, the system is powered by an Arduino UNO and a VL6180X proximity sensor. When your cat enters the litter box, the sensor detects its presence and activates an orange LED to indicate the box is in use. Once your cat exits, the system waits 15 seconds for safety, then activates a 12V fan via a 5V relay, extracting air for 2.5 minutes. If the cat returns during this time, the fan immediately shuts off, and the cycle restarts once the litter is vacated again.
The waiting and extracting times can be customized in the Arduino code
The electronics are built on a perfboard, with all component connections manually soldered. Power is supplied through a 12V PSU connected directly to the Arduino, but it also supports 12V battery power. When running on battery, the corresponding code includes a voltage monitoring system: if the battery drops below a safe threshold, the system automatically shuts down to prevent over-discharge and the orange LED flashes three times quickly to indicate that the battery needs to be recharged.
🌬 PWM Fan Control – A Challenge
During early development, I attempted to use PWM (Pulse Width Modulation) to smoothly ramp up the fan speed, hoping to avoid startling the cat. However, with my Noctua 12V fan, even using the manufacturer-recommended PWM frequency, the fan would never fully turn off it always stayed at minimum speed. For this reason, I switched to relay control, but if anyone has tips for making PWM work reliably with Noctua fans and Arduino UNO, I’d love your input!
🌫 Filter Compatibility
The filter housing is designed to fit Zortrax HEPA + Carbon filters, which I already had available. If you’re using different filters, feel free to remix the filter case to match your specific dimensions.
THE CODE
#include <Wire.h>
#include <Adafruit_VL6180X.h>
const int fanRelay = 8; // Relay pin to turn fan ON/OFF
const int ledRed = 10; // Red LED (blinking when fan is ON)
const int ledGreen = 11; // Green LED (litter available)
const int minDistance = 200; // Detection threshold for cat presence
const unsigned long waitTime = 15000; // 15 seconds (in milliseconds)
const unsigned long fanRunTime = 150000; // 2.5 minutes (in milliseconds)
Adafruit_VL6180X vl6180x = Adafruit_VL6180X();
bool isCatInside = false;
bool isWaitingExit = false;
unsigned long exitTimerStart = 0;
void setup() {
pinMode(fanRelay, OUTPUT);
pinMode(ledRed, OUTPUT);
pinMode(ledGreen, OUTPUT);
digitalWrite(fanRelay, LOW);
Serial.begin(115200);
if (!vl6180x.begin()) {
Serial.println("Failed to detect VL6180X sensor!");
while (1);
}
pinMode(2, OUTPUT);
digitalWrite(2, LOW);
digitalWrite(ledRed, LOW);
digitalWrite(ledGreen, HIGH);
}
void loop() {
int distance = vl6180x.readRange();
if (distance < minDistance) {
if (!isCatInside) {
isCatInside = true;
Serial.println("Cat is inside the litter box");
digitalWrite(ledRed, HIGH);
digitalWrite(ledGreen, LOW);
isWaitingExit = false;
}
} else {
if (isCatInside && !isWaitingExit) {
Serial.println("Waiting to confirm cat exit...");
isWaitingExit = true;
exitTimerStart = millis();
}
if (isWaitingExit) {
unsigned long currentMillis = millis();
while (millis() - exitTimerStart < waitTime) {
distance = vl6180x.readRange();
if (distance < minDistance) {
Serial.println("Cat is still inside");
isCatInside = true;
isWaitingExit = false;
digitalWrite(ledRed, HIGH);
digitalWrite(ledGreen, LOW);
return;
}
delay(500);
}
Serial.println("Cat has exited");
isCatInside = false;
isWaitingExit = false;
digitalWrite(ledRed, LOW);
digitalWrite(ledGreen, HIGH);
Serial.println("Starting air filtering...");
digitalWrite(fanRelay, HIGH);
unsigned long fanStartTime = millis();
bool ledState = false;
unsigned long lastBlink = millis();
while (millis() - fanStartTime < fanRunTime) {
if (vl6180x.readRange() < minDistance) {
Serial.println("Cat detected again, turning OFF fan...");
digitalWrite(fanRelay, LOW);
digitalWrite(ledRed, HIGH);
isCatInside = true;
digitalWrite(ledGreen, LOW);
return;
}
// Blink red LED every 500ms
if (millis() - lastBlink >= 500) {
ledState = !ledState;
digitalWrite(ledRed, ledState);
lastBlink = millis();
}
delay(10); // Small delay
}
Serial.println("Stopping fan...");
digitalWrite(fanRelay, LOW);
digitalWrite(ledRed, LOW);
}
}
delay(500);
}
To change the waiting and fan operation time you can easily change the value in millisecond of const unsigned long waitTime and const unsigned long fanRunTime in the first potion of the code.
This is the code for power supply operation, but in the download section, you can also find the one for battery use.
⚠ Note: The code for battery use requires an additional part in the circuit to read the voltage. This version, with battery monitoring implemented, can be used both with a battery or a power supply.
➡ The electronic schematics are available in the Downloads section!
🛠 Project Development with PCBWay’s Support
A massive thank you to PCBWay for helping bring this project to life.
PCBWay specializes in PCB, PCBA, CNC, and 3D Printing, and has (in my experience) the best support & the widest amount of options for manufacturing.





They also have a PCBWay+ Store where I purchased everything needed for this project, including the VL6180Xproximity sensor, Jumper Wires for prototyping, and a Multimeter to test circuit connections. You’ll also find the Relay Module compatible with Arduino.
In addition to the essential components for this build, range of electronic parts and accessories at great prices, with an easy checkout process and fast, well-packaged shipping.

🔧 Print Settings
Layer Height: 0.2mm
Infill: 30–50%
Perimeters: 2–3
Supports: Not required
Material: PLA or PETG recommended
🖨 Print Files & Quantities
1× Electronics Case
1× Electronics Case Lid
1× LED Diffuser (in transparent material)
1× Sensor Case (Bottom)
1× Sensor Case (Top)
1× Fan Mount & Filter Case
1× Filter Housing (Zortrax compatible)
1× Filter Safety Clip
🔩 Hardware Required
1× Arduino UNO
1× VL6180X sensor
1× 12V 120mm fan
1× 5V relay module (or compatible MOSFET switch)
⚠ Note: I used a basic relay controlled directly from a digital pin, but I highly recommend using a dedicated relay module to protect your Arduino from excessive current draw.
1× 3mm Green LED
1× 3mm Orange/Red LED
2× 220Ω Resistors
1× 12KΩ Resistor (optional)
1× 4.7KΩ Resistor (optional)
1× 4-pin JST XH Board Connector Set (or similar)
1× 4-pin Header Strip
1× 1-pin Header Strip
1× Perfboard (up to 6,9 x 4,5 cm)
1× 12V 1A DC Power Adapter
1× 12V Battery (optional)
1× Zortrax Hepa + Carbon Filter SET
1× Digital Multimeter
Screws and Zip Tie (type and quantity inside BOM)
22AWG Solid Core Wire for circuit wiring and connections to Arduino ports
A full Bill of Materials (BOM) and a step-by-step assembly guide are available in the Downloadssection.
🖥 Serial Monitoring for Smart Integrations
The Arduino code includes serial messages to indicate the system’s current state. This opens the door for remote monitoring, integration with smart dashboards, or logging battery performance over time, great for further development!
💡Expansions and Integrations
If your litter box is very large and you’re concerned that the cat might not be properly detected by the sensor, you can modify the project by adding one or more additional sensors to achieve full coverage inside the box. Alternatively, you can increase the waiting time as needed, to give your cat enough time to do its business even if it’s in a spot not covered by the sensor.
🔁 Share Your Make & Remix!
I’d love to see how you build and customize this project. Your feedback is incredibly valuable and helps me improve my designs.
If you create improvements, remixes, or alternate modules, share them with the community!
🐾 Follow for More
Don’t forget to follow 3D KIMBA for more projects, creative ideas, and helpful tools for makers!

Automated Air Filtration System for Cat Litter Boxes - Universal Fit - Customizable
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(4)
-
preslee Burdette
Jul 08,2025
-
Engineer
May 04,2025
-
Engineer
Apr 30,2025
-
3D KIMBA
Apr 21,2025
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by 3D KIMBA
-
The Portable DJ Rig for Mixing on the Move! -for DJ Control Mix-
The Portable DJ Rig for Mixing on the Move!Get ready to mix anywhere with this innovative DJ rig des...
-
Gravity Holder: Minimal Design, Maximum Hold
Elevate your organization with the Gravity Holder, a sleek and innovative solution designed to secur...
-
Pocket Tic Tac Toe: Fold & Play Anytime, Anywhere - Print in Place
Get ready for on-the-go fun with Pocket Tic Tac Toe, where timeless strategy meets portability. This...
-
Magnetic Tool Bar for Festool workbench MFT
The Magnetic Tool Bar is a modular solution designed for Festool MFT workbenches, providing secure a...
-
Compact Pipe Cutter: Precise and Versatile Tool for PVC, Copper, and Aluminum Pipes
This Compact and Robust Pipe Cutter is designed for precision cuts on PVC, copper, and aluminum pipe...
-
NPT Pipe Plugs & Testers: Essential Protection for Pipes During Maintenance
These NPT pipe plugs offer a simple yet crucial solution for protecting hydraulic and pneumatic pipe...
-
BSPP Pipe Plugs & Testers: Essential Protection for Pipes During Maintenance
These BSPP pipe plugs offer a simple yet crucial solution for protecting hydraulic and pneumatic pip...
-
MagSafe Charging Station – Put Your Phone to Sleep in Style!
Introducing the Phone Bed, a charming and functional MagSafe charging station designed to give your ...
-
Thread Gauge Tester: A Handy Tool for Measuring NPT Hydraulic Pipe Threads
Product Description:The Thread Gauge Tester for hydraulic pipe threads offers an essential tool for ...
-
Chroma Mixer - A Tool to Explore Color Mixing
The Chroma Mixer is an innovative educational tool designed to help users understand color mixing pr...
-
AirPod Sport Lace – A Secure Solution for Dynamic Activities
The AirPod Sport Lace is a must-have accessory for active AirPod users, designed specifically for th...
-
Scalp Massager – Stimulator and Stress Reliever
Introducing the Scalp Massager, a simple yet highly effective tool designed to stimulate your scalp ...
-
Tiny Back Scratcher Hand – Extra Long Finger Extension
Introducing the Tiny Back Scratcher Hand, a clever and practical tool designed to help you reach tho...
-
Garden Tap Adapter: 3/4 Inch to M24 for Water Diffusers and Filters
Introducing the Garden Tap Adapter, designed to convert your 3/4 inch garden tap into a compatible c...
-
Complete Modular Sorting System with Stackable Twist-Lock Storage Box
Download the Compatible Twist-Lock Stackable Containers - HERE -Product Description:Introducing the...
-
Cylindrical Stackable Containers: Organize Your Loose Items with a Twist
Introducing the Cylindrical Stackable Containers, the ultimate solution for organizing your loose sc...
-
Stencil Book: Organize Your Creativity with Ease
Introducing the Stencil Book, the definitive solution for anyone looking to keep their stencils orga...
-
HexDish SignalBoost: Amplify Your Phone Signal Outdoors
The SignalBoost HexDish is a modular parabolic reflector designed to enhance cell signal reception i...
-
-
ARPS-2 – Arduino-Compatible Robot Project Shield for Arduino UNO
1537 0 5 -
-
A Compact Charging Breakout Board For Waveshare ESP32-C3
2051 3 7 -
AI-driven LoRa & LLM-enabled Kiosk & Food Delivery System
2087 2 0 -
-
-
-
ESP32-C3 BLE Keyboard - Battery Powered with USB-C Charging
2239 0 1 -







