Skip to the content
2 layers142.8 × 99.5 mmWatergun pcb, the printed circuit board in 3D

motion tracking electric watergun

Size
142.8 × 99.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
84
Nets
65
Pads
304
Tracks, vias
527, 150
Pours
2
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
5 Jun 2026
Updated
5 Jun 2026

Overview

Watergun pcb is an open-source printed circuit board by jonathanrandall, from the jonathanrandall/motion_tracking_electric_watergun repository on GitHub, published under the MIT licence. It is a 2-layer board of 142.8 × 99.5 mm with 84 parts on 65 nets, routed with 527 tracks and 150 vias.

It is built around the ESP32-S3-WROOM-1-N8 and USBLC6-2SC6. Its parts include 26 resistors, 14 capacitors, 10 connectors, 8 switches and 5 diodes. It belongs with the ESP32 boards of this library.

Main components

2

README

README.md

Motion-Tracking Electric Water Gun

An ESP32-based automatic water gun that tracks motion using an array of ultrasonic sensors and can be remote-controlled via a wireless joystick. Built around a custom KiCad PCB with a 3D-printed enclosure.

How it works

The gun mounts on a pan/tilt servo gimbal. Five ultrasonic sensors span the field of view (far-left, left, center, right, far-right). When a target enters range, the gun snaps its pan servo to the closest detected sensor — blending between adjacent sensors for smoother interpolation — and begins auto-firing the water pump in timed on/off pulses. A wireless joystick remote (ESP32 DEVKIT V1) communicates with the gun over ESP-NOW and provides manual override.

Control priority (highest → lowest):

  1. Auto-tracking — ultrasonic array detects target < 145 cm, snaps pan servo, auto-fires
  2. ESP-NOW remote — joystick drives pan + tilt; fire and mode-toggle buttons
  3. On-board buttons — manual pan/tilt nudges and fire

Repository layout

text
arduino_code/        Receiver firmware (ESP32-S3 custom PCB — the gun)
esp32_now_joystick/  Sender firmware  (ESP32 DEVKIT V1 — the handheld remote)
kicad_stuff/         KiCad schematic, PCB layout, and JLCPCB BOM
3d_prints/           FreeCAD source + STL for the octagonal enclosure

Hardware

Gun (receiver) — custom PCB

  • MCU: ESP32-S3-WROOM-1
  • Sensors: 5× HC-SR04-style ultrasonic (1-wire, JST XH 4-pin connectors), one per pan position
  • Servos: pan (GPIO15) + tilt (GPIO16), externally powered via terminal block
  • Fire switch: NMOS transistor (GPIO47) driving the water pump load
  • Display: SSD1306 128×64 OLED over I2C (GPIO13/14)
  • Buttons: fire, mode toggle, pan-left, pan-right, tilt-up, tilt-down
  • LEDs: red + green status (auto/manual mode and target detection)
  • Power: USB-C input, AP63203WU buck converter to 3.3V

Remote (sender) — ESP32 DEVKIT V1

  • KY-023 analog joystick (GPIO34/35)
  • Fire button (GPIO25) and auto/manual toggle (GPIO26)
  • Two status LEDs: auto-mode indicator and target-detected mirror
  • Sends RemoteCommand packets at 20 Hz; receives StatusPacket replies from the gun

Firmware

Both projects use PlatformIO.

Gun (arduino_code/)

bash
cd arduino_code
pio run -t upload
pio device monitor

On first boot, the gun prints its MAC address to Serial. Copy it into the remote firmware before flashing the remote.

Remote (esp32_now_joystick/)

  1. Edit RECEIVER_MAC in esp32_now_joystick/src/main.cpp with the MAC printed above.
  2. Flash:
bash
cd esp32_now_joystick
pio run -t upload

Sensor filtering

Each ultrasonic sensor feeds a small circular buffer; a median of the last 3 readings is used rather than the raw value. This rejects spurious zero-returns on timeout and single short-echo outliers without lagging as much as a running average.

Tracking uses per-sensor hysteresis: detection starts below 145 cm and clears above 155 cm, preventing rapid toggling at the threshold.

Pin map

See arduino_code/pinmap.md for the full ESP32-S3 GPIO table and all connector pinouts.

PCB

The KiCad files are in kicad_stuff/. The BOM (BOM_jlcpcb.csv) is formatted for direct upload to JLCPCB's SMT assembly service.

3D prints

The enclosure is an octagonal box (3d_prints/octogon_box_v6.FCStd / .stl), designed in FreeCAD.

License

See LICENSE.

Parts

84
QtyValueFootprintReferences
1310KResistor_SMD:R_0805_2012MetricR8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R24
10100nFCapacitor_SMD:C_0805_2012MetricC5, C19, C21, C22, C23, C24, C25, C26, C27, C28
8MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4, H5, H6, H7, H8
520KResistor_SMD:R_0805_2012MetricR25, R26, R27, R28, R29
5Conn_01x04Connector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_VerticalJ7, J8, J9, J10, J11
3330RResistor_SMD:R_0805_2012MetricR_LED1, R_LED2, R_LED3
3button_1Button_Switch_SMD:SW_SPST_TL3342SW3, SW5, SW7
3button_2Button_Switch_SMD:SW_SPST_TL3342SW4, SW6, SW8
2100RResistor_SMD:R_0805_2012MetricR20, R22
210kResistor_SMD:R_0805_2012MetricR21, R23
210uFCapacitor_SMD:C_0805_2012MetricC17, C20
222uFCapacitor_SMD:C_0805_2012MetricC1, C2
227RResistor_SMD:R_0805_2012MetricR3, R4
25.1KResistor_SMD:R_0805_2012MetricR1, R2
2Conn_02x04_Top_BottomConnector_PinHeader_2.54mm:PinHeader_2x04_P2.54mm_Vertical3V3_rail1, V5_rail1
2D_SchottkyDiode_SMD:D_SMAD4, D5
2IN OUTConnector_PinHeader_2.54mm:PinHeader_2x02_P2.54mm_VerticalJ16, J17
14.7uHInductor_SMD:L_7.3x7.3_H4.5L1
1AP63203WU-7Package_TO_SOT_SMD:TSOT-23-6U3
1Conn_01x02TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-3-2-5.08_1x02_P5.08mm_HorizontalJ5
1Conn_01x09Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2
1Conn_02x04_Odd_EvenConnector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_VerticalServo_in1
1Conn_02x04_Odd_EvenConnector_PinHeader_2.54mm:PinHeader_2x04_P2.54mm_VerticalI2C1
1ESP32-S3-WROOM-1RF_Module:ESP32-S3-WROOM-1U1
1GREEN LEDLED_SMD:LED_0805_2012MetricD8
1Orange LEDLED_SMD:LED_0805_2012MetricD7
1Q_NMOS_GDSPackage_TO_SOT_SMD:SOT-23Q2
1Q_NMOS_GSDPackage_TO_SOT_SMD:SOT-23Q3
1RED LEDLED_SMD:LED_0805_2012MetricD6
1SW_BootButton_Switch_SMD:SW_SPST_TL3342SW1
1SW_RESETButton_Switch_SMD:SW_SPST_TL3342SW2
1USBLC6-2SC6Package_TO_SOT_SMD:SOT-23-6U2
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12J1

Similar boards

  • 2 layers238.8 × 137.2 mmOOKeyboard, the printed circuit board in 3D

    OOKeyboard

    mayermakes/00Keyboard

    an open source ortholinear BLE keyboard. from scratch, including Firmware, video on element14presents

    171 parts12GPL-3.0
  • 2 layers156 × 66 mmDash 6.8, the printed circuit board in 3D

    Dash 6.8

    romioRN/Dash6.8-hardware

    wifi name "service", password 12345678, connect to 192.167.4.1

    152 parts11Apache-2.0
  • 4 layers29 × 54.4 mmESP32-S3-Breakout, the printed circuit board in 3D

    ESP32-S3-Breakout

    eggsampler/ESP32-S3-Breakout

    A minimal breakout board for the ESP32-S3-WROOM module

    34 parts10MIT
  • 4 layers100 × 100 mmPlantomation V2, the printed circuit board in 3D

    Plantomation V2

    Synthron/Plantomation

    DIY plant watering system

    203 parts10
  • 4 layers100 × 50 mmPsu ext, the printed circuit board in 3D

    Psu ext

    PSU-Ext-Org/psu-ext-hardware

    A repository to store PSU-EXT hardware design assets, schematics, circuit diagrams, CAD files and manufacturing data.

    137 parts9CERN-OHL-S-2.0
  • 2 layers85 × 67 mmGaggimate, the printed circuit board in 3D

    Gaggimate

    dulerabbit/GaggiBre-legacy

    This is GaggiBre! a fork of Gaggimate with Manual Brew Control and Adaptive Mode. Made by Dule Rabbit

    113 parts8
  • 2 layers85 × 70 mmPRTGN v1, the printed circuit board in 3D

    PRTGN v1

    bismarx-v1/PRTGN

    OwO whats this (This repo contains electronics, mechanical and software data for a protogen visor)

    69 parts6
  • 2 layers48 × 65.5 mmOpen telegraph, the printed circuit board in 3D

    Open telegraph

    animesh-chouhan/open-telegraph

    A pocket-size Morse key. One button, one RGB LED, an ESP32-S3, and a battery. Plug it in over USB-C or pair it over Bluetooth and it types Morse into any device as a standard keyboard. Fully open, down to the copper.

    52 parts5CERN-OHL-S-2.0

Questions

How big is the Watergun pcb PCB?

It measures 142.8 × 99.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Watergun pcb use?

84 parts, built around the ESP32-S3-WROOM-1-N8 and USBLC6-2SC6. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Watergun pcb KiCad files?

From the jonathanrandall/motion_tracking_electric_watergun repository on GitHub, at the commit this page was made from: the board is kicad_stuff/watergun_pcb.kicad_pcb and its schematic kicad_stuff/watergun_pcb.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Watergun pcb design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).