Project showcase
Arduino Ping Pong Ball Cannon

Arduino Ping Pong Ball Cannon © GPL3+

Grab a couple of motors, a servo and build a cannon!

  • 249 views
  • 2 comments
  • 1 respect

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
13,000 rpm 6V DC motor
×2
7.4V 1300 mAh LiPo Battery
×1
Fairchild semiconductor fqu13n06ltu image 75px
Power MOSFET N-Channel
60V 10A
×1
Sg90 servo motor 180 degrees sg90 micro
SG90 Micro-servo motor
Any small servo that can run off the Arduino board 5V supply
×1
Mfr 25frf52 10k sml
Resistor 10k ohm
×1
Fairchild semiconductor 1n4004. image
1N4007 – High Voltage, High Current Rated Diode
×1

Necessary tools and machines

3drag
3D Printer (generic)
Hy gluegun
Hot glue gun (generic)

Apps and online services

About this project

Everyone needs a Ping Pong Ball Cannon!

Here's the Video

I had the desire to build a ping pong ball cannon. Cardboard being such a versatile material, I thought I'd use it for the barrel.

I started with two 13, 000 rpm 6V DC motors and some thin robot wheels. The results were encouraging but inconsistent. Sometimes the balls would shoot 20 feet, sometimes 4 feet.

I thought that wider flywheels with proper rubber treads would help. So I used TinkerCAD to design two 3cm diameter wheels that had a 1cm thickness. The centre was made to receive the gears mounted on the motors. For a tread, I used the thick rubber bands that broccoli comes bound in at the grocery store. They were glued to the wheels with Gorilla Super Glue. I found that without the glue the wheels spun so quickly that the rubber bands flew off!

The barrel is a cardboard 'trough' mounted on a piece of 1x3 wood with two holes drilled to mount the motors. The flywheels fit through the sides of the trough.

A potentiometer is used to adjust the speed of the flywheels.

An auto-feeder is made with a cardboard 'pusher' mounted to a small servo via a short length of reinforced wire as a pushrod.

The Arduino sketch spins up the motors for 2 seconds then the servo pushes the ping pong ball (in this case, practice golf ball) into the wheels and it's flung out of the barrel. The potentiometer allows you to vary the speed of the motors.

Note: The reason that the servo is attached and detached as needed is to reduce the 'chatter' that happens inside the servo when it's searching for neutral. That wastes power and it's also annoying to see the servo jittering while it's idle.

So build your own and start flingin'!

Update: February 6, 2019. Just learned that the cannon officially needs to fire foam practice golf balls. The flywheels with the rubber treads don't work. I removed the treads and cut sawtooth patterns into the wheels which improved performance. I then moved the flywheels about 7mm closer to each other providing more compression of the ball as it passed through the flywheels.

The modification worked very well and I've got about 17+ feet range on the cannon for a 7.4V battery. A 12V high amp hour battery provides marginally more range. So it's a great result overall!

Code

Ping Pong Ball CannonProcessing
Arduino Code to control Ping Pong Ball Cannon
/*
 * Ping Pong Ball Cannon
 * 2019 - Gord Payne
 * 
 */
 #include <Servo.h>

Servo servo;

int motorPin = 6; // flywheel motors
int servoPin = 8; // autofeeder servo
int potPin = A0; // potentiometer for speed adjustment
int potVal;
int speedVal; // scaled speed value for motor (potVal/4);
char theVal;

void setup() {
  Serial.begin(9600);
  pinMode(motorPin, OUTPUT);
  pinMode(potPin, INPUT);

}

void loop() {
  potVal = analogRead(potPin);
  speedVal = map(potVal / 4, 0, 255, 80, 220); // you can adjust as appropriate for your setup
  Serial.print(speedVal);
  if (Serial.available() > 0) {
    theVal = Serial.read();


  }
  switch (theVal) {
    case '1': // If '1' was received
      analogWrite(motorPin, speedVal); // turn the motor ON
      delay(2000);
      feedBall(); // feed a ball into the flywheels
      digitalWrite(motorPin,LOW);
      break;
    case '0': // If '0' was received
      digitalWrite(motorPin, LOW); // turn the motor OFF
      break;
    default:
      break;

  }

}

void feedBall(){
  servo.attach(servoPin);
      delay(20);
      servo.write(10);
      delay(400);
     for (int i = 0; i <= 110; i++) { // push the ball into the flywheels
      servo.write(i);
      delay(5);
      }
      delay(100);
     for (int i = 110; i >= 0; i--) { // retract the feeder for the next ball
      servo.write(i);
      delay(5);
      }
      servo.detach();
}

Custom parts and enclosures

Flywheels
Flywheels attached to the motors to fling the balls
ppb_cannon_wheels_AMFca14Y5T.hfb

Schematics

Cannon Circuit
Theppbcannoncircuit ht7x02x6qc

Comments

Similar projects you might like

Levitate a Ping Pong Ball Using Arduino and Simulink

Project tutorial by DanDoherty

  • 4,706 views
  • 4 comments
  • 11 respects

4D Ping Pong

Project showcase by 4D Makers

  • 1,714 views
  • 0 comments
  • 6 respects

Arduino Ping Pong Pinball

Project tutorial by joesinstructables

  • 4,657 views
  • 4 comments
  • 10 respects

Motion-Triggered Confetti Cannon

Project showcase by circuito.io team

  • 2,274 views
  • 0 comments
  • 13 respects

Magic Arduino Ball

Project showcase by Ruben Zilzer

  • 1,832 views
  • 1 comment
  • 6 respects

RING PONG

Project showcase by aerodynamics

  • 5,679 views
  • 2 comments
  • 14 respects
Add projectSign up / Login