Projectile Launcher a Light-Guided System || Electromechanical Project
by kg658 in Circuits > Raspberry Pi
40 Views, 2 Favorites, 0 Comments
Projectile Launcher a Light-Guided System || Electromechanical Project

A miniature automated projectile launch system built around the Raspberry Pi Pico. It's designed to intelligently detect a light source, measure its distance, calculate the optimal trajectory, and launch a projectile with precision. By integrating sensors like an LDR (Light Dependent Resistor) for target acquisition and an Ultrasonic Sensor (USS) for distance measurement, alongside motors and a servo for aiming and propulsion.

Materials other than electronics:
- Acrylic sheets - easy to cut/drill, (hot gun and mini drill 'friendly')
- Plywood - cost-effective + easy to work with
- 3D printed PLA/PETG components - for custom casing, link arms, crank and pins
- Rubber bands - inexpensive elastic (useful for launching)
- precautionary or permanent options:
- M-Seal is a multi-purpose sealant (can never go wrong with m-seal)
- Double sided tape
- super glue
- some bolts for weight management (came in handy)




Step 1: well step 1 would be to test your components, but let’s not beat around the bush.
I have attached several of 2D drawings, including hand and CAD models. I have also tried adding one Isometric view of the model which was sketched during the early days by one of the partner in this project dont get confused by it
Since I am lacking final project pictures (there is a reason for that) for better understanding I revisited all of the sketches and made few with more clarity in them i.e. a Top view and a Side View
we tried simulating with the same length ratio to the arms in the slider crank mechanism used, here for simulation motiongen came in handy (Before 3D printing the arms, it’s better to simulate them first—but this step can be skipped if necessary)
below is the sim.


basic synopsis of the circuit diagram: refer it for connections
Raspberry Pi Pico (top right)
L298N Motor Driver (red board)
2 DC Motors (yellow)
Servo Motor (grey, bottom center)
Ultrasonic Sensor (blue with two round eyes)
Buck Converter (blue rectangular board bottom-right)
From the Above Step, Circuit Integration:

1. Motor Driver (L298N) Connections
Power:
- VCC (12V input): Connected to buck converter output (regulated power).
- GND: Common ground shared with Raspberry Pi Pico and other components.
- 5V ENABLE Jumper: Appears to be connected (this allows the driver to internally regulate 5V logic).
Logic Pins (to Pico):
- IN1: Connected to GP14
- IN2: Connected to GP15
- IN3: Connected to GP16
- IN4: Connected to GP17
- EN1: Connected to GP12 (PWM to control Motor A)
- EN2: Connected to GP13 (PWM to control Motor B)
Output to Motors:
- OUT1, OUT2: Connected to Motor 1
- OUT3, OUT4: Connected to Motor 2
2. Motors (Yellow DC Motors)
- Connected to OUT1/OUT2 and OUT3/OUT4 of L298N respectively.
3. Servo Motor (Gray)
- GND (Brown) → GND rail
- VCC (Red) → Connected to Buck Converter’s 5V Output
- Signal (Orange) → GP18 on Raspberry Pi Pico
4. Ultrasonic Sensor (HC-SR04)
- VCC → Connected to Buck Converter 5V
- GND → GND rail
- TRIG → GP3 on Pico
- ECHO → GP2 on Pico
5. Buck Converter
- Input (left side):
- VIN+ → External power supply (e.g., battery)
- VIN- → GND of external power
- Output (right side):
- VOUT+ (5V) → Powers Servo, Ultrasonic Sensor, and optionally logic of Motor Driver
- VOUT- (GND) → Common ground with Raspberry Pi Pico
6. Raspberry Pi Pico (Main Controller)
Digital GPIO Connections:
FunctionPin (GPIO)
Motor EN1: GP12;
Motor EN2: GP13;
Motor Direction: GP14-GP17;
Ultrasonic TRIG: GP3;
Ultrasonic ECHO: GP2;
Servo Motor Signal: GP18;
Code (iterations Are Def Needed)
ldr_value = ldr_pin.read_u16()
light_threshold = 30000 # Define a threshold for light detection (adjust as needed)
while ldr_value < light_threshold:
ldr_value = ldr_pin.read_u16() # Wait until light source is detected
print(f"Current light level: {ldr_value}")
time.sleep(0.1)
you will almost definitely have to play with this and the value you put have to be of some crazy number not available online, well now it is
so for the reason of not having a final photo of the project: each member on this project i.e. 4 including me were overdue on something or the other on their schedule and at the day of the presentation of this the Prof was unreasonable and pretty much did not see our presentation which really spoiled our next 24hrs in amidst of all this we totally forgot on clicking the completed bit. this project was fun nonetheless and had alot of learnings in it