Complete project folder with .STL files, parts list, wiring diagram, build instructions and Arduino code
Project electronic cost estimate: β¬85 or $95
Designed and printed this powerful and automatic tennis ball launcher for our overly active German Shepherd. Because he has enough space to run around here it could be quite a bit of a powerful ball launcher. And that's what it has become! The GIF in the Pictures shows the first test. (Without housing still) That was about 10-12 meters but after a few minor adjustments it now shoots consistently about 30-35 meters. Parts list with internet links, electrical diagrams and Arduino code are all in the folder. If you still run into problems during the build, you can always me via my e-mail. I added my email address in the top line of the Arduino code.
I made the housing from 5mm white foam board in combination with white duct tape. Cheap, easy to work with, light, strong and also a neat finish! The .STEP file of the housing is also in the folder if you need my dimensions.
- Tennis Ball launcher Parts list
Electronics:
1x MG996R Servo
1x Arduino Nano
1x XT60 connector set
2x Brushless motor 5010 β 360KV
2x ESC 30A, 4S
Bearings:
2x Bearing 625ZZ
Screws:
11x Screw M3x10mm
12x Screw M3x20mm
8x Screw M3x30mm
8x Screw M4x20mm
2x Screw M5x25mm
24x Screw M6x30mm
Threaded inserts:
31x M3 brass threaded insert
8x M4 brass threaded Insert
Materials for housing (Optional):
2x Foamboard 5mm, 1000x700mm
1x Roll Duct-tape white, width 50mm
Arduino Code:
#include
// Define the pins for the ESCs and ball stopper servo
const int esc1Pin = 9;
const int esc2Pin = 10;
const int servoPin = 6;
const int sensorPin = 7;
// Create Servo objects for the ESCs and ball stopper
Servo esc1;
Servo esc2;
Servo ballStopper;
void setup() {
// Attach the ESCs and servo to the corresponding pins
esc1.attach(esc1Pin);
esc2.attach(esc2Pin);
ballStopper.attach(servoPin);
// Initialize the ball stopper servo to the initial position
ballStopper.write(0); // Adjust this value as needed to match your setup
// Initialize Serial Monitor for debugging
Serial.begin(9600);
// Setup the sensor pin
pinMode(sensorPin, INPUT);
}
void loop() {
// Read the sensor value
int sensorValue = digitalRead(sensorPin);
// If the sensor is triggered, launch the ball
if (sensorValue == HIGH) {
// Generate a random delay between 5 and 15 seconds
int randomDelay = random(5000, 15001);
delay(randomDelay);
// Launch the ball after the delay
launchBall();
}
// Short delay before the next loop iteration
delay(100);
}
void launchBall() {
// Start the flywheel motors
esc1.writeMicroseconds(2000); // Adjust this value for your ESCs
esc2.writeMicroseconds(2000); // Adjust this value for your ESCs
// Wait for the flywheels to reach full speed
delay(2000); // Adjust this delay as needed for your setup
// Release the ball using the ball stopper servo
ballStopper.write(90); // Adjust this value to release the ball
delay(500); // Wait for the ball to launch
ballStopper.write(0); // Reset the ball stopper
// Stop the flywheel motors
esc1.writeMicroseconds(1000); // Adjust this value for your ESCs
esc2.writeMicroseconds(1000); // Adjust this value for your ESCs
}