Whack - A - Towel (Game for both humans and pets!)
We calculate the final price from your selected file. You review and accept it before payment.
Saved on this device.
Arduino pet game to help keep pets entertained and engaged.
- Rating
- 0 / 5
- Likes
- 3
- Downloads
- 6
- Makes
- 0
- Views
- 157
- Reviews
- 0
Updated at source:
Model information
- Source
- Printables
- Category
- Pets
- License
- Creative Commons — Attribution — Noncommercial
For the past few years, I have been in my school's mechatronics academy learning about STEM. Unfortunately, I wasn't able to do it for my last year of high school, so I figured I needed a new project. A few days before the contest ended, I stumbled upon it and figured it would be a fun project to complete all the things I had created in high school. I wanted to use something new code-wise and create a CAD that challenged me.
So, I made this because our family dog is brilliant but also very hyper. He always gets into things, especially when we leave the house. One of his favourites is the dirty towels in the laundry room (which is where the name came from). So, I'm working on creating a toy that allows him to avoid making a mess of towels while also keeping him engaged. So, I created a smaller, first iteration of a game where he can try to get a piece of fabric or a small toy, in this case, a pom-pom. This first iteration will be much smaller than the finished product, but still be playable to keep him out of trouble in the meantime.
Functions
List the key features and functionalities of the project. Some examples could be:
● Automatic shut-off when not in use to conserve battery
● Customizable prize for pets to attempt to get
● Multiple options for printing - Included is a full model, model needed to be glued together, or screws
● Entertainment and stimulation for hyper pets
Hardware:
- Arduino board (I used an UNO)
- Wires
- Breadboard or Soldering board
- 4 - 220 Ω resistor
- 3 - 1 kΩ resistor
- piezo
- Ultrasonic sensor
- 3 LED lights
- 3 buttons
- 3 servo motors
- glue or screws to assemble
- 3D printed Whack - A - Towel model
Software:
- Arduino IDE - coding in C++
- Tinkercad - schematics
- Shapr3d - modeling
Wiring Diagram
Here is a simplified version

Here is a proper version

/*
Whach - A - Towel
When pet is near the ultrasonic sensor will detect and start the game. The goal is to press the button linked to the reward item/light which is in view. Once the button is pressed another one will be selected. This helps keep pets guessing and engaged.
*///Varibles
//for each compentent to ensure easy to follow code
//Naming and including servo library - servos put reward object into view of pet to motivate them
#include <Servo.h>
Servo servo1;
Servo servo2;
Servo servo3;
//Buttons
const int button1 = 5;
const int button2 = 6;
const int button3 = 7;
//Piezo - indicates button is pushed
const int piezo = 8;
//Ulternate signal to allow pet to detect which button to press
const int led1 = 9;
const int led2 = 10;
const int led3 = 11;
//Ultrasonic sensor to detect when pet is near
const int echo1 = 12;
const int trig1 = 13;
//Output is the random selection varible
int output = 1;
void setup()
{
//Decarling each compnent as an input or output so information is collected or sent
servo1.attach(3, 500, 2500);
servo2.attach(2, 500, 2500);
servo3.attach(4, 500, 2500);
pinMode(button1, INPUT);
pinMode(button2, INPUT);
pinMode(button3, INPUT);
pinMode(piezo, OUTPUT);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(echo1, INPUT);
pinMode(trig1, OUTPUT);
//Set each servo to base position
servo1.write(0);
servo2.write(0);
servo3.write(0);
//Set of serial montior for any debuging
Serial.begin(9600);
delay (500);
}
void loop()
{
//Ultrasonic sensor sending and reciving pulse to discover distance which ensures program is only running when in use
long duration, distance;
digitalWrite(trig1, LOW);
delay(2);
digitalWrite(trig1, HIGH);
delay(2);
digitalWrite(trig1, LOW);
duration = pulseIn(echo1, HIGH);
distance = (duration / 2) / 29.1;
if(distance < 100)
{
//If a pet is near the program will start
start_program();
}
else
{
//If not sets all components to base positions
noTone;
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
servo1.write(0);
servo2.write(0);
servo3.write(0);
}
}
void start_program()
{
//Debuging line, enter in a varible to recive data on montior
Serial.println(digitalRead(button1));
delay(10);
//Progams starts with output = 1, then once button linked to output is pressed a new random one will be selected
if (output == 1)
{
if ((digitalRead(button1) == 0))
{
//Until button is pushed the light is on and servo turned
digitalWrite(led1, HIGH);
servo1.write(90);
}
else if ((digitalRead(button1) == 1))
{
//Once button is pushed components are reset and new output picked
digitalWrite(led1, LOW);
servo1.write(0);
tone(piezo, 6, 1000);
noTone;
delay(100);
output = random(1, 3 + 1);
}
}
if (output == 2)
{
if ((digitalRead(button2) == 0))
{
digitalWrite(led2, HIGH);
servo2.write(90);
}
else if ((digitalRead(button2) == 1))
{
digitalWrite(led2, LOW);
servo2.write(0);
tone(piezo, 6, 1000);
noTone;
delay(100);
output = random(1, 3 + 1);
}
}
if (output == 3)
{
if ((digitalRead(button3) == 0))
{
digitalWrite(led3, HIGH);
servo3.write(90);
}
else if ((digitalRead(button3) == 1))
{
digitalWrite(led3, LOW);
servo3.write(0);
tone(piezo, 6, 1000);
noTone;
delay(100);
output = random(1, 3 + 1);
}
}
Printing Instructions
● Filament Material - PLA or PETG
● Layer Height - 0.2mm or 0.25
● Infill - I printed with 5%, it doesn't really matter for this model
● Supports - Supports may not be needed depending on the printer. I have a stock ender 3 so I printed everything with supports, although I modelled it to minimize wasted material on supports
Assembly Instructions
- Put roof and lid together - with glue or screws
- If using screws loosly fit sides on - If not glues them together
- Slowly screw the front and sides alternating between each screw to ensure proper fit. If gluing, apply glue to the sides and slide the front into place
- Slide base onto the bottom and glue or screw it in
- Put the circuit together
- Buttons - either attach buttons to wire and secure them in button holes, or place buttons on a breadboard and secure them underneath the lid, ensuring the buttons are positioned high enough so the printed buttons can contact them.
- Put the LED in place, then the servos. Attach the ‘reward’, and the pet will try to get to the servo arm. If needed, there is a file for a printed one
Future Changes
- If your pet is not motivated by simply searching or chasing the item, add a treat dispenser for rewarding and training
- An interface to allow controlling while away
- Different modes to allow for training and increased difficulty