Auto Kitty Litter
This device is actuated by two touches to a touchpad sensor. Once actuated the drum is meant to be rotated and dump excrement into a hidden compartment
Supplies
Main components
- Arduino
- DC Hobby Motor
- Touch Sensor
- Motor Driver
- Housing
- Grate
- Drum
- Mat
- Jumper wires
Code
#define button_pin 2
#define AIN1 13
#define AIN2 12
#define PWMA 11
int button_press_count = 0;
int button_state = 0;
int prev_button_state = 0;
void setup() {
delay(100);
Serial.begin(9600);
pinMode(button_pin, INPUT_PULLUP); // Set button pin as input with pull-up resistor
pinMode(13, OUTPUT);
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(PWMA, OUTPUT);
Serial.println("Button Count:");
}
void loop() {
button_state = digitalRead(button_pin);
if (button_state != prev_button_state) {//count number of touches
if (button_state == HIGH) {
digitalWrite(13, LOW);
} else { // Button press
digitalWrite(13, HIGH);
button_press_count++;
Serial.println(button_press_count); // Print the count
}
delay(50);
}
prev_button_state = button_state;
if (button_press_count == 2) {
// if two presses counted Run DC motor in one direction for 3 seconds
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, LOW);
analogWrite(PWMA, 255);
delay(3000);
// Reverse DC motor direction for 3 seconds
digitalWrite(AIN1, LOW);
digitalWrite(AIN2, HIGH);
analogWrite(PWMA, 255);
delay(3000);
//stop spinning
digitalWrite(AIN1, LOW);
digitalWrite(AIN2, LOW);
analogWrite(PWMA, 0);
delay(3000);
// Reset button press count
button_press_count = 0;
}
}
Build
- Secure down the stand for the motor and situate where Arduino bored will live with extra 9v battery
- attach the drum to the DC motor I used a wheel that came with my Arduino kit centered it and attached the two together
- create a roller to prop up the barrel and reduce the friction
- make a grate that will sift the litter
- also underneath the drum should live an excrement box where everything falls into once the drum rotates
- cut a hole in the drum that aligns with the hidden excrement compartment
- wire everything
- create housing to cover everything
Video Link
example of how mine functioned:
https://mediahub.ku.edu/media/t/1_3pha8toc
For the Future
Future changes:
•Housing
•Research of large touch sensors or
motion sensor
•Friction reduction
•Stronger DC motor/Replace with
strong servo