Self Catching Projectile Machine
by NewsonsElectronics in Circuits > Arduino
23 Views, 0 Favorites, 0 Comments
Self Catching Projectile Machine
In this Instructions, I show you how I built an automatic ball-catching machine. This would make a great classroom demonstration if you teach SPH3U or SPH4U Physics — bringing projectile motion and real-world problem solving to life.
Link to the full build video https://youtu.be/eg7z2-UQLCc
Link to the theory video https://youtu.be/ggqOKfbcum0
Supplies
10K pots x 2 → Amazon , Taobao
TCR5000- IR sensor → Amazon, Taobao
MGN12H rail - 1 Meter → Amazon , Taobao
Nidec 24H055M020 Motor →Amazon, Taobao
2GT timing Belt -3Meters → Amazon, Taobao
Contact switch→ Amazon , Taobao
Meter Sticks x 2 → Amazon, Taobao
PVC pipe 21mm dia. 15cm long → Amazon, Taobao
20mm dia. Ball Bearing → Amazon, Taobao
The Cannon
The cannon barrel is made from a PVC pipe with an inside diameter of 21 mm, allowing a 20 mm ball bearing to fit smoothly while minimizing friction during launch.
Start by cutting the PVC pipe to a length of 15 cm and sanding the cut ends smooth. To create the loading slots, I used a laser cutter. The technique I used was to first laser-cut the slot pattern into a piece of wood, creating a positioning jig. The PVC pipe was then placed into the cut-out location, ensuring it was held in the exact position needed for the laser to cut the slots accurately into the pipe.
Refer to the Cannon Slots.dxf file for the slot design and dimensions.
Downloads
3D Printing
everal parts will need to be 3D printed. I try to use wood wherever possible, as 3D printing can take a long time. The STL files included are for the cup, cannon plunger, and end cap.
The end cap holds a TCRT5000 IR sensor, which is used to detect when a shot has been launched. The IR LED inside the sensor is powered from 5 V through a 100 Ω resistor connected to the Din pin. The sensor output is connected to A2 on the Arduino.
Configure A2 as a digital input with the internal pull-up resistor enabled:
Under normal operation, A2 will read HIGH. When the plunger passes the sensor and reflects the infrared light, the sensor output changes state, allowing the Arduino to detect that the shot has been fired.
The Electronics
Next, we need to connect the motor. To do this, we will solder some pins onto the motor connector so it can interface with the Arduino Uno.
For this setup, we are using Arduino pins 10, 9, and 8 for motor control, but you can change these pins to any available digital pins if you modify the code accordingly.
The connections are:
- Motor PFM (speed control) → Arduino Pin 9
- Motor Brake control → Arduino Pin 10
- Motor Direction control → Arduino Pin 8
- IR sensor output → Arduino A2
- Homing switch → Arduino A1
Motor Pins and Connections
Pin 1 – PFM (Speed Control)
Connect to an Arduino digital pin (for example, Pin 9). The motor speed is controlled using tone(pin, frequency).
The operating range is approximately 250 Hz to 26 kHz, where an increase of about 1 kHz ≈ 150 RPM.
Pin 2 – Enable
Connect directly to 12V to enable the motor.
Connecting to GND places the motor into standby mode.
Pin 3 – Brake
- GND = Brake ON
- VCC = Brake OFF
- Connect this pin to an Arduino output if you want to control braking through software.
Pin 4 – Direction
- VCC = Counter-clockwise (CCW)
- GND = Clockwise (CW)
- Connect to an Arduino digital pin to control motor direction.
Pins 5, 6, 7 – Not Used
Leave these pins disconnected.
Pins 8, 9, 10 – Ground
Connect to Arduino GND and the motor power supply ground.
Pins 11, 12 – Motor Power Supply
Connect to a 12V power supply (recommended range: 10–13V).
Make sure the Arduino ground and motor power supply ground are connected together so the control signals have a common reference.
The Rail
For the main assembly, I laser-cut the parts from 3 mm wood panels. Before assembly, the ruler pieces require a few pilot holes to be drilled near the ends, allowing the parts to be securely fastened together using M2 bolts.
The GT2 timing belt is installed by routing it over the motor gear and underneath the slider rail. Make sure the belt is properly aligned and has enough tension so the slider can move smoothly without slipping.
Downloads
The Code
Adjusting the Motor Speed Calibration
The code will need to be adjusted based on your individual setup. Since each motor, spring, and mechanical assembly can behave slightly differently, the PFM frequency values need to be calibrated for your specific system.
I manually tested different motor frequencies and recorded the speed required to consistently hit each target distance. You can repeat this process by testing your launcher and finding the correct PFM frequency values for every 10 cm interval.
My calibrated values were:
The distanceTable represents the target distance (cm), and the pfmTable contains the corresponding motor frequency required to achieve that distance.
You can create your own calibration table by testing your launcher at different frequencies and recording the results.
Adjusting the Initial Launch Velocity
You may also need to adjust the initial launch velocity value in the code. This value depends on the mechanical properties of your launcher, including the spring strength, spring compression distance, and the mass of the ball bearing.
Since each build will be slightly different, you will need to calibrate this value for your own cannon. Adjust the velocity until the calculated projectile path matches the real-world movement of your launcher.
For my setup, I used:
If your spring is stronger, or your ball bearing has a different mass, this value will need to be changed to match your system.
Full code for the machine
Downloads
How It Works
This video goes into more details about the code and the physics on how it works.