← Back to Projects

Automatic Tennis Ball Shooter

A tennis-ball launcher: two flywheels throw the ball, and a stepper feeds the next one.

Hardware Engineering Intern · 2025–2026 · Working prototype · BrainChild Engineering

  • ESP32
  • C++
  • NEMA 17 Stepper
  • A4988
  • RS-775 DC Motors
  • MOSFET Modules

Key outcomes

  • PWM into MOSFET modules sets the flywheel voltage waveform. Speed still depends on the motor and the load.
  • Fused 12 V for the motors. A buck feeds about 5 V to the ESP32 board. The chip runs at 3.3 V.
  • The Replit app sequences the feed and the flywheels on the bench.
BrainChild client demo path: Replit UI into the ESP32 launcher stack.

Project overview

Charred melted yellow wire from overspeed event
Insulation after the pack-side joint failed during overspeed.

A Replit web app talks to an ESP32. Firmware turns those commands into motor sequencing through breadboard interface circuitry: MOSFET modules that PWM-switch the flywheel motors, an A4988-class stepper driver for the feed, a fused 12 V battery rail for the loads, and a buck converter that steps that rail down to 5 V for the ESP32.

Two RS-775 DC motors spin printed flywheels; a NEMA 17 stepper indexes balls into the launch path.

System architecture

Power and signal wiring diagram with 12V battery, fuse, MOSFETs, and buck to 5V
3S battery through a fuse and splitters to MOSFET VIN and stepper VMOT. Buck IN+ takes the same high rail and makes 5 V for ESP32 VIN and A4988 VDD. The fuse is meant to open the pack connection if current runs away.

Replit UI → ESP32 → GPIO / PWM / STEP·DIR → MOSFET modules + A4988 → RS-775s + NEMA 17 → feed + launch.

Web / wireless control
Replit control UI sends commands; ESP32 owns sequencing / timing in firmware.
Power architecture
12 V battery → fuse → splitters → MOSFET VIN + stepper VMOT; buck → 5 V for ESP32 / A4988 logic.
MOSFET PWM drive
MCU PWM into the MOSFET gates. Duty cycle changes the voltage waveform. Flywheel speed also depends on the motor and the load.
Ball feed
NEMA 17 stepper-driven indexing on a printed coupler / mount that had to survive torque.

Engineering decisions

DecisionAlternativeWhy
ESP32 over Arduino BluetoothArduino Mega + Bluetooth moduleMigrate to ESP32.
PWM-switched MOSFETs instead of linear drivePot speed controllersESP32 PWM into MOSFET gates on the 12 V motor path.
Series fuse on the 12 V pack railNo protectionThe fuse stays in the pack path.
Buck converter between 12 V pack and ESP32Feed the MCU somehow off the pack without regulationFused 12 V for motors; bucked 5 V for ESP32 and driver logic.

Results and future work

Client-demoable wireless path. ESP32 could take Replit UI commands and turn them into sequenced STEP/DIR and flywheel PWM for a BrainChild demo. Honest 12 V / 5 V split. Buck converter kept the ESP32 on 5 V while MOSFET and stepper loads stayed on the fused battery rail. PWM flywheel drive.

MOSFET modules hard-switch the pack rail under MCU PWM so speed is duty cycle, not a linear drop across the FET. Harness damage, cause not isolated. Observed: a flywheel

Still open. Not production-ready; breadboard interface would need a custom PCB for a durable unit.

  • PCB revision of the interface circuitry.
  • Feed reliability and launch consistency tests.
  • Packaging pass once the electrical map stops moving.

Related work

Full engineering log

Motivation

Why I started this

What pulled me in, and what I wanted to get better at.

Why I built it

This was a client build at BrainChild Engineering. The brief was an automatic tennis ball launcher the team could demo from a phone, not a one-off bench trick that only worked with USB power and babysitting.

What interested me

The interesting part was not “make a ball fly.” It was getting wireless control, motor sequencing, a fused 12 V actuator rail, a bucked 5 V logic rail, and a mechanical feed to behave like one machine under client demo pressure.

What I wanted to learn

Coursework had given me programming and basic electronics separately. This was practice when voltage domains, print strength, PWM switching, and app timing fail with the same external symptom until you isolate a layer.

System Overview

How the system fits together

A Replit web app talks to an ESP32. Firmware turns those commands into motor sequencing through breadboard interface circuitry: MOSFET modules that PWM-switch the flywheel motors, an A4988-class stepper driver for the feed, a fused 12 V battery rail for the loads, and a buck converter that steps that rail down to 5 V for the ESP32. Two RS-775 DC motors spin printed flywheels; a NEMA 17 stepper indexes balls into the launch path.

01

Web / wireless control

Replit control UI sends commands; ESP32 owns sequencing / timing in firmware.

02

Power architecture

12 V battery → fuse → splitters → MOSFET VIN + stepper VMOT; buck → 5 V for ESP32 / A4988 logic. Fuse is there to open the pack path if current goes wrong.

03

MOSFET PWM drive

MCU PWM into the MOSFET gates. Duty cycle changes the voltage waveform. Flywheel speed also depends on the motor and the load.

04

Ball feed

NEMA 17 stepper-driven indexing on a printed coupler / mount that had to survive torque.

05

Launcher drive

Dual RS-775 DC motors on printed flywheels. Release speed still depends on the load, not only on the duty cycle.

06

Chassis & mounts

Panel enclosure with printed brackets so actuators can move during iteration.

Data flow

Replit UI → ESP32 → GPIO / PWM / STEP·DIR → MOSFET modules + A4988 → RS-775s + NEMA 17 → feed + launch.

Control flow

Firmware owns motor timing and release behavior. The app sends commands; it does not drive actuators directly. Logic never shares the raw 12 V rail. The fuse sits on the pack path as the last hard stop if current spikes.

Power architecture
Power and signal wiring diagram with 12V battery, fuse, MOSFETs, and buck to 5V

3S battery through a fuse and splitters to MOSFET VIN and stepper VMOT. Buck IN+ takes the same high rail and makes 5 V for ESP32 VIN and A4988 VDD. The fuse is meant to open the pack connection if current runs away.

Engineering Breakdown

Broken down by discipline

Each block is the requirement, how that part works, what I checked, and what is still open.

01Mechanical

Mechanical

Goal

Hold two flywheel motors and a stepper feed in a layout that could change without reprinting the whole machine, and keep printed interfaces stiff enough under real torque.

Design

Panel chassis with printed corner braces and motor mounts. Two RS-775s on L-brackets; NEMA 17 on a center printed stack for indexing. Early coupler / mount prints were too flimsy under stepper load.

Challenges

  • The first 3D-printed part on the stepper was under-infilled and poorly fastened. It flexed and would not hold under torque.
  • Clearances only became real once both RS-775s and the stepper occupied the same volume.

Iterations

  • Low-infill coupler / mount that looked fine on the bench and failed under load.
  • Reprint in Bambu Studio (PETG, Strength tab) with higher infill density so the part was heavier and stiffer.
  • Re-fastened the stepper interface once the printed geometry could take the load path.

Final implementation

A modular mechanical stack good enough for prototype integration once the stepper print stopped being the weak link.

Stepper on the mat

A yellow motor housing on the blue mat, with a white cable. The frame is blurry, so I am not reading a part number off it.

Print failure

First printed interface on the stepper: too flimsy and not fastened well enough. Flex under torque made the feed look like a firmware bug until we blamed the plastic.

Higher-infill reprint
Bambu Studio Strength settings for reprinting the stepper mount

Bambu Lab P1P / PETG prepare view with the Strength tab open. Reprinted the U-bracket / mount denser so it could take stepper torque without folding.

02Electrical

Electrical

Goal

Run high-current flywheels and a stepper off a 12 V pack without killing a 5 V ESP32, switch motors efficiently with PWM, and keep a fuse in the pack path for overcurrent.

Design

Fused 12 V battery rail for MOSFET modules and stepper VMOT. A buck steps that rail to about 5 V for the ESP32 board's VIN and the driver logic. The ESP32 chip runs at 3.3 V from the board regulator. The gates are PWM. The decision below is why the FET is hard-switched.

Challenges

  • Early bring-up had no buck. The pack was 12 V. Without the step-down, the ESP32 board would not run from the battery.
  • During MOSFET PWM testing a flywheel ran much faster than commanded. The fuse did not open. I did not measure the current, so I am not treating high speed as proof of overcurrent.
  • Solder joints on the buck and battery path were detached afterward, and a wire's insulation melted. An open joint interrupts that path. I have not established whether the heating came from a resistive joint, a short, arcing, or something else.

Iterations

  • Battery toward the logic side without regulation: dead end.
  • Added a buck module so ESP32 VIN and A4988 VDD sat on a real 5 V rail, with a fuse on the pack feed.
  • MOSFET PWM modules for the flywheels. After the fast spin, detached joints, and melted insulation, I still don't have a current measurement or a confirmed sequence.

Final implementation

Prototype interface: fused 12 V rail for actuators, about 5 V for the ESP32 board, MOSFET PWM for flywheels, A4988 for the NEMA 17. The damaged harness was not retested against a known fault.

12 V → 5 V buck
Buck converter module held above ESP32 breadboard

Buck board labeled IN-/OUT-/IN+/OUT+/5V above the ESP32 breadboard and red A4988. Logic lives here; motors stay on the fused high rail.

ESP32 and the connectors

ESP32 on the breadboard, with lever-nut connectors in the harness. This is the wired controller, not a meter reading of the pack.

MOSFET PWM switch

Blue dual-MOSFET module: MCU PWM into the gate / SIG path, screw terminals on the motor rail. Hard on/off switching at PWM rate, not a linear 6 V drop across the FET.

03Embedded

Embedded

Goal

Coordinate web-app commands, stepper indexing pulses, and flywheel PWM on one controller the client could demo.

Design

Started on an Elegoo Mega 2560 with Bluetooth-side phone control. Migrated to ESP32 so wireless and motor timing lived on one board. A Replit web UI (feed pace, rest interval, emergency stop, live rail readout) sends commands; firmware owns STEP/DIR to the A4988 and PWM into the MOSFET TRIG pins.

Challenges

  • Arduino + Bluetooth was fine in controlled tests and unreliable for consistent app-level control.
  • Multi-motor timing only makes sense once the power path and mounts are stable enough to trust.
  • App / firmware / hardware faults presented as the same “it doesn’t shoot” until we isolated a layer.

Iterations

  • Mega 2560 + Bluetooth path for phone control.
  • Migration to ESP32 for integrated wireless.
  • Replit control UI: START FEED, pace presets, rest between shots, emergency stop, live voltage.

Final implementation

ESP32 as the control brain: web commands in, sequenced STEP/DIR + PWM out through the interface circuitry.

First controller

Elegoo Mega next to a breadboard. A red module sits in the middle, and the harness leaves through lever connectors. This is the board I started on.

Replit control UI

Web app on Replit: LIVE rail readout, REST BETWEEN, FAST/MED/SLOW pace, START FEED, and emergency stop.

Setup screen

Setup screen for the link to the ESP32, with a disconnect button and a live status. Emergency stop is on the same page.

Key Design Decisions

Design decisions

DecisionAlternativeWhy
ESP32 over Arduino BluetoothArduino Mega + Bluetooth moduleMigrate to ESP32. Changing the architecture beat endlessly patching an unsuitable link.
PWM-switched MOSFETs instead of linear drivePot speed controllersESP32 PWM into MOSFET gates on the 12 V motor path. The motor's inductance and inertia smooth the pulses.
Series fuse on the 12 V pack railNo protectionThe fuse stays in the pack path.
Buck converter between 12 V pack and ESP32Feed the MCU somehow off the pack without regulationFused 12 V for motors; bucked 5 V for ESP32 and driver logic.
Higher-infill reprint for the stepper interfaceGlue / tape the weak printReprint with higher infill density and treat fastening as part of the mechanical design.
Notes on these decisions

ESP32 over Arduino Bluetooth

Phone / web control needed to stay reliable for a client demo while the machine was still changing.

The Mega path was familiar and already partly wired. ESP32 meant a redesign, but the communication path stopped being the main failure mode.

Migrate to ESP32. Changing the architecture beat endlessly patching an unsuitable link.

PWM-switched MOSFETs instead of linear drive

Flywheel speed had to be a firmware parameter without cooking the switch.

A MOSFET held between on and off dissipates voltage times current as heat. PWM keeps each switch near fully on or fully off. Duty cycle changes the waveform. Speed still depends on the motor and the load.

ESP32 PWM into MOSFET gates on the 12 V motor path. The motor's inductance and inertia smooth the pulses.

Series fuse on the 12 V pack rail

A short or runaway motor current needs a hard interrupt, not hope.

A fuse opens on current and time, not on motor speed. This one did not open during the fast spin. That does not by itself prove the current was under the rating, or that it was over it.

The fuse stays in the pack path. I have not verified a rating or a placement that would have opened before the insulation melted.

Buck converter between 12 V pack and ESP32

The pack is about 12 V. The ESP32 board expects about 5 V on VIN. The chip runs at 3.3 V.

Skipping the buck looks simpler until nothing boots. A buck adds one more module and wiring, but it is the difference between a demo and a dead board.

Fused 12 V for motors; bucked 5 V for ESP32 and driver logic.

Higher-infill reprint for the stepper interface

The printed part on the stepper flexed and would not stay fastened under torque.

A denser print is heavier and slower. A light print is fast until the feed path is a joke.

Reprint with higher infill density and treat fastening as part of the mechanical design.

Results & Validation

What held up

What worked in the end, what I can show for it, and where it's still limited.

Client-demoable wireless path

App demo

ESP32 could take Replit UI commands and turn them into sequenced STEP/DIR and flywheel PWM for a BrainChild demo.

Melted wire
Melted and charred yellow wire after overspeed event

Yellow conductor after the PWM test. The insulation melted. The photo does not show the current or the order of the failures.

Honest 12 V / 5 V split

Buck + fuse rail

Buck converter kept the ESP32 on 5 V while MOSFET and stepper loads stayed on the fused battery rail.

Actuator layout
Open chassis with dual RS-775 flywheels and NEMA 17 stepper

RS-775s on L-brackets with printed flywheel; NEMA 17 on the center feed stack inside the panel chassis.

PWM flywheel drive

MOSFET PWM

MOSFET modules hard-switch the pack rail under MCU PWM so speed is duty cycle, not a linear drop across the FET.

System on the bench
Chassis harnessed to ESP32 bench

Mechanical enclosure wired across to the ESP32 breadboard and fused battery path.

Harness damage, cause not isolated

Burned wire

Observed: a flywheel much faster than commanded, a fuse that did not open, detached pack-side joints, and melted insulation. Not measured: current. Not established: the sequence, or that high speed meant overcurrent.

Debug bench
Bench layout during tennis ball shooter debugging

Bring-up mess that held the real lessons: power domains, prints, PWM, and joints before polish.

Limitations

  • Not production-ready; breadboard interface would need a custom PCB for a durable unit.
  • The fuse did not open during the fast spin. No later test shows a rating that would have.
  • Launcher mechanics and closed-loop current / speed sensing were not finished.
  • App integration was demo-grade, not a polished consumer UX.
Bench notes

The longer design notes, the timeline, and the revisions. The sections above are the system and what I measured.

Evolution

How it got here

The steps I can put in order from the notes. A clip opens from its still.

  1. Elegoo Mega 2560 with two DC speed controllers and a red stepper driver
    Elegoo Mega 2560 with two DC speed controllers and a red stepper driver
    Blue Mega 2560 at left. Two black pot-and-heatsink DC speed controllers for the RS-775 rails. Red stepper driver on the mini breadboard. Wagos as the power split.

    Electronics

    Mega, pot controllers, and a stepper driver

    First bench stack: Elegoo Mega 2560 for logic, two heatsinked DC speed controllers for the flywheels, and a red A4988-class driver for the feed. Flywheel RPM was still a manual pot.

  2. ESP32 breadboard with fused DC rail and Wago power distribution
    ESP32 breadboard with fused DC rail and Wago power distribution
    ESP32 on the breadboard after the power architecture settled: fused high-current bus, Wagos, jumpers out to MOSFET PWM and the stepper driver.

    Power

    Buck, fuse, and a real 5 V logic rail

    Battery bring-up failed without regulation. The architecture became: pack → fuse → high-current splits for MOSFETs / VMOT, and a buck branch for ESP32 + driver logic.

  3. Play
    Post-overspeed bench: MOSFET module, buck, and harness after the motor ran away and the pack-side joints failed.

    Failure

    Fast spin, intact fuse, melted insulation

    While testing MOSFET PWM, a flywheel ran much faster than commanded. The fuse did not open. Afterward, solder joints on the buck and battery path were detached and a wire's insulation had melted.

  4. Play
    A4988 / stepper path under test once the printed mount was stiff enough to trust the motion.

    Mechanics

    Stepper print that could take torque

    Feed bring-up looked like a firmware bug until the printed interface was the real failure. Higher-infill reprint plus better fastening fixed the mechanical half of “it won’t index.”

  5. Play
    End-to-end client demo clip: control UI into the ESP32 launcher stack.

    Client demo

    App-controlled launcher on the bench

    BrainChild demo path: Replit UI → ESP32 sequencing → feed + flywheels. Still a prototype enclosure and breadboard interface, but the multidisciplinary loop closed.

Reflection

Looking back

What surprised me, what I'd redo, and questions I'm still chewing on.

What surprised me

  • The first “ESP32 is dead” bug was a missing buck converter, not firmware.
  • The first “stepper won’t index” bug was a soft print and weak fastening, not STEP/DIR timing.
  • PWM is a switched waveform, not a DC voltage inside the MOSFET. Speed still depends on the motor and the load. A motor that runs flat out can look hard-tied to the pack, and that appearance is not a current measurement.
  • A fuse opens on current and time, not because the shaft is fast. An open solder joint interrupts current. It does not force current somewhere else.

What I would redesign

  • Custom power / motor-interface PCB with deliberate fuse rating, Kelvin sense, and flyback paths.
  • Validate PWM fault modes so a stuck-high gate cannot mean continuous full pack on the flywheel.
  • Design printed feed parts for torque and fastening from revision one.
  • Add closed-loop current / speed sensing so commanded duty is not the only success signal.

Future improvements

  • PCB revision of the interface circuitry.
  • Feed reliability and launch consistency tests.
  • Packaging pass once the electrical map stops moving.

Questions that emerged

  • Which failure mode do you check first when the symptom is only “it doesn’t shoot” or “it won’t stop speeding”?
  • What fuse rating and placement actually interrupts a stuck-MOSFET fault before insulation melts?
  • What sensor proves a ball left the launcher, not just that a motor spun?

Notes

  • 12 V packs and 5 V MCUs do not negotiate. Use a buck or stay on USB forever.
  • MOSFET PWM is hard switching. Duty cycle is average voltage to the motor, not a DC voltage inside the FET.
  • A fuse that does not open, plus a joint that does, is how you melt a wire.
  • BrainChild client work: the demo is the deadline. Power and packaging fail earlier than clever features.

Same work