Skip to the content
4 layers146.1 × 55 mmStarGate MainBoard, the printed circuit board in 3D

Mainboard for Kristian's stargate projects, based on ESP32-S3

Size
146.1 × 55 mm
Copper layers
4
Thickness
1.6 mm
Parts
171
Nets
210
Pads
812
Tracks, vias
1,869, 300
Pours
18
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
27 Dec 2023
Updated
10 Apr 2026

Overview

StarGate MainBoard is an open-source printed circuit board by plhsystems, from the plhsystems/stargate-mainboard-esp32 repository on GitHub. It is a 4-layer board of 146.1 × 55 mm with 171 parts on 210 nets, routed with 1,869 tracks and 300 vias.

It is built around the ESP32-S3-WROOM-1-N16R2, PCA9685PW and FM6124, with the MC33063ADRE4, TPA6017A2PWP and SN74LVC1T45DBV among its other parts. Its parts include 51 capacitors, 39 resistors, 34 connectors, 19 ICs and 6 diodes. It belongs with the computers and single-board computers boards and the ESP32 boards of this library.

Main components

12

README

README.md

Stargate Mainboard ESP32

A fully functional Stargate replica controller based on ESP32, designed to replace Raspberry Pi-based solutions with a more cost-effective and integrated approach.

Build Status ESP-IDF License

Overview

This project provides a complete embedded system for controlling Stargate props designed by Kristian and the "Build The Stargate" community. The ESP32-based solution offers:

  • Lower Cost: ESP32 modules are significantly cheaper than Raspberry Pi
  • Better Availability: No shortage issues
  • Integrated Design: All drivers, regulators, and control circuitry on a single PCB
  • Simpler Wiring: Fewer external breakouts required
  • Real-Time Control: FreeRTOS-based deterministic motor control

Features

✅ Implemented

Core Functionality
  • ✅ Web Interface: Full-featured HTTP server with REST API
  • ✅ WiFi: Station + SoftAP dual-mode support
  • ✅ OTA Updates: Over-the-air firmware updates
  • ✅ Configuration Management: JSON import/export
  • ✅ Multiple Gate Types: Movie/SG1, Atlantis, Universe support
Hardware Control
  • ✅ Ring Motor Control: Stepper motor with precise positioning
  • ✅ Chevron Control: 9 chevron LED lighting (configurable for 7)
  • ✅ Servo Control: Chevron locking mechanism (MCPWM-based)
  • ✅ Wormhole LEDs: 48 NeoPixel LED effects
  • ✅ Ramp Lighting: PWM-controlled LED brightness
  • ✅ Audio System: Integrated amplifier with sound effects
Advanced Features
  • ✅ Auto-Homing: Hall sensor-based ring calibration
  • ✅ Auto-Calibration: Automatic steps-per-rotation detection
  • ✅ BLE Communication: Wireless control of smart ring LEDs
  • ✅ Address Book: Hardcoded and fan gate addresses
  • ✅ Incoming Wormholes: Support for remote gate dialing
  • ✅ Diagnostic Mode: Hardware testing and troubleshooting

🚧 In Progress

  • 🚧 DHD Board Support: Integration with STM32-based DHD
  • 🚧 SD Card Support: External storage for audio assets

Note: Pablo Board HAL is not yet ready to work and should not be used.

📋 Planned

  • 📋 Subspace Network: Connection to other fan gates
  • 📋 Mobile App: Dedicated iOS/Android control
  • 📋 Voice Control: Smart home integration
  • 📋 Advanced Wormhole Effects: Blackhole, unstable wormhole

Quick Start

Prerequisites

  • Hardware: ESP32-S3 mainboard (pinky-board or compatible)
  • Software: ESP-IDF 5.3.1
  • Tools: Python 3.8+, CMake, Ninja

Installation

  1. Install ESP-IDF 5.3:
bash
mkdir -p ~/esp
cd ~/esp
git clone -b v5.3.1 --recursive https://github.com/espressif/esp-idf.git esp-idf-5.3
cd esp-idf-5.3
./install.sh
  1. Clone Repository:
bash
git clone https://github.com/user/stargate-mainboard-esp32.git
cd stargate-mainboard-esp32
  1. Build and Flash:
bash
cd firmware/stargate-fw/pinky-board
. ~/esp/esp-idf-5.3/export.sh
idf.py build
idf.py -p /dev/ttyUSB0 flash monitor

First-Time Setup

  1. Power on the ESP32
  2. Connect to WiFi network Stargate-Universe
  3. Navigate to http://192.168.4.1
  4. Follow the setup wizard
  5. Configure WiFi and gate type
  6. Run homing sequence

Architecture

The system consists of multiple firmware components:

  • stargate-fw: Main controller (ESP32-S3)

    • Gate control state machine
    • Web server and REST API
    • WiFi and BLE management
    • Motor control and sensor reading
  • ring-fw: Smart ring controller (ESP32)

    • BLE server for receiving commands
    • 48 NeoPixel LED control
    • Animation effects and power management
  • ring-factory: Factory test firmware

    • Hardware diagnostics
    • Burn-in testing
    • Factory reset capability

For detailed architecture information, see doc/architecture.md.

Documentation

Comprehensive documentation is available in the doc/ directory:

Essential Reading

User Guides

Technical Details

Hardware

Pinky Board (Production)

Specifications:

  • MCU: ESP32-S3-WROOM-1
  • Flash: 16 MB
  • PSRAM: 8 MB
  • WiFi: 802.11 b/g/n
  • Bluetooth: BLE 5.0

Connections:

text
Stepper Motor:  GPIO 25 (Step), GPIO 33 (Dir), GPIO 26 (Sleep)
Servo Motor:    GPIO 4 (MCPWM)
Hall Sensor:    GPIO 32 (Input)
Wormhole LEDs:  GPIO 27 (WS2812B - 48 LEDs)
Ramp LED:       GPIO 23 (PWM)
Status LED:     GPIO 5

Ring Board

Specifications:

  • MCU: ESP32-WROOM-32
  • Flash: 4 MB
  • BLE: Server mode

Connections:

text
NeoPixel Ring:  GPIO 13 (48 LEDs in 4 concentric rings)

API Examples

Dial an Address

bash
curl -X POST http://stargate.local/api/gate/dial \
  -H "Content-Type: application/json" \
  -d '{

    "address": [27, 7, 15, 32, 12, 30, 1],
    "galaxy": "milky_way"
  }'

Get Status

bash
curl http://stargate.local/api/system/status

Control Ring LEDs

bash
curl -X POST http://stargate.local/api/ring/animation \
  -H "Content-Type: application/json" \
  -d '{"animation": "fade_in"}'

For complete API documentation, see doc/api-reference.md.

Development

Project Structure

text
stargate-mainboard-esp32/
├── firmware/
│   ├── stargate-fw/        # Main controller
│   │   ├── main-app/       # Application logic
│   │   └── pinky-board/    # Hardware implementation
│   ├── ring-fw/            # Ring controller
│   └── ring-factory/       # Factory test firmware
├── esp32-components/       # Shared utilities
│   └── misc-formula/       # Math functions
├── sgc-components/         # Stargate-specific
│   └── sgu-ringcomm/       # BLE protocol
└── doc/                    # Documentation

Building Different Targets

Main Controller:

bash
cd firmware/stargate-fw/pinky-board
idf.py build

Ring Firmware:

bash
cd firmware/ring-fw
idf.py build

Factory Test:

bash
cd firmware/ring-factory
idf.py build

Code Style

  • C++ Standard: C++17
  • Naming: PascalCase for classes, camelCase for methods
  • Indentation: 4 spaces
  • Comments: Doxygen format for APIs

Why ESP32 over Raspberry Pi?

FeatureESP32Raspberry Pi
Cost~$5-10~$35-75
AvailabilityReadily availableFrequent shortages
Real-time ControlYes (FreeRTOS)Limited (Linux)
Power Consumption~80mA~500mA+
Boot Time<1 second20-40 seconds
IntegrationSingle PCB possibleRequires breakouts
GPIO34 pins28 pins (40-pin header)
ReliabilityNo SD card corruptionSD card wear issues

Troubleshooting

Build Issues

MCPWM API errors:

BLE compilation errors:

  • Add required NimBLE headers
  • Include #undef min / #undef max after includes

IRAM overflow:

  • Set CONFIG_COMPILER_OPTIMIZATION_SIZE=y in sdkconfig

Runtime Issues

Ring won't connect:

  • Verify ring is powered
  • Check BLE is enabled
  • Check logs: idf.py monitor

Stepper doesn't move:

  • Check sleep pin (GPIO 26) is HIGH
  • Verify power supply to stepper driver
  • Test with manual step command

Homing fails:

  • Check hall sensor wiring (GPIO 32)
  • Run manual homing via web interface
  • Verify sensor triggers when magnet is near

Contributing

Contributions are welcome! Please:

  1. Read the documentation in doc/
  2. Follow the code style guidelines
  3. Test thoroughly on hardware
  4. Submit pull requests with clear descriptions

Community

License

See doc/copyright.md for licensing information.

Acknowledgments

  • Kristian: Original Stargate design and inspiration
  • Build The Stargate Project: Community support
  • Espressif: ESP-IDF framework
  • Contributors: Everyone who helped make this possible

Current Version: 1.0.0 ESP-IDF Version: 5.3.1 Last Updated: 2026-01-22

For detailed documentation, visit the doc/ directory.

Parts

171
QtyValueFootprintReferences
21Conn_01x02_PinConnector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ3, J10, J12, J13, J14, J15, J16, J17, J18, J19, J20, J21, J22, J28, J29, J30 +5
10100nFCapacitor_SMD:C_0603_1608MetricC8, C9, C11, C13, C19, C25, C29, C38, C40, C44
910nFCapacitor_SMD:C_0603_1608MetricC12, C20, C22, C23, C26, C30, C32, C39, C41
822kResistor_SMD:R_0603_1608MetricR2, R14, R33, R34, R35, R36, R37, R38
710kResistor_SMD:R_0603_1608MetricR9, R10, R16, R17, R18, R19, R28
6MountingHoleMountingHole:MountingHole_2.5mmH1, H2, H3, H4, H5, H6
6TB6612FNGPackage_SO:SSOP-24_5.3x8.2mm_P0.65mmIC1, IC2, IC3, IC4, IC5, IC6
4100uF 10VCapacitor_SMD:C_1210_3225MetricC17, C18, C45, C46
41uFCapacitor_SMD:C_0603_1608MetricC15, C16, C42, C43
447uF/16VCapacitor_SMD:CP_Elec_6.3x7.7C2, C4, C5, C7
30.1uFCapacitor_SMD:C_0805_2012MetricC1, C3, C33
3120RResistor_SMD:R_0603_1608MetricR20, R21, R22
31KResistor_SMD:R_0603_1608MetricR7, R13, R15
322uF 25VCapacitor_SMD:C_0805_2012MetricC49, C52, C53
3Conn_01x02_PinConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ23, J31, J33
3Conn_01x03_MaleConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ11, J27, J32
3FIDUCIAL""Fiducial:Fiducial_1mm_Mask2mmFID1, FID2, FID3
3LEDLED_SMD:LED_0805_2012MetricD1, D3, D4
3PCA9685Package_SO:TSSOP-28_4.4x9.7mm_P0.65mmU2, U3, U4
20.1uFCapacitor_SMD:C_0603_1608MetricC48, C50
210uFCapacitor_SMD:C_0805_2012MetricC6, C10
210uF 25VCapacitor_SMD:C_0805_2012MetricC21, C47
215uHInductor_SMD:L_0805_2012MetricL1, L4
2220uFCapacitor_SMD:CP_Elec_6.3x7.7C27, C28
22k2Resistor_SMD:R_0603_1608MetricR23, R24
25.1kResistor_SMD:R_0603_1608MetricR26, R27
26.8kResistor_SMD:R_0603_1608MetricR1, R5
2Conn_01x03_SocketConnector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_VerticalJ2, J24
2SW_Push_DualPLH:SW_PUSH_6mmSW1, SW2
10.1uF 50VCapacitor_SMD:C_0603_1608MetricC51
10RResistor_SMD:R_0603_1608MetricR29
10R33Resistor_SMD:R_1210_3225MetricR30
1100kResistor_SMD:R_0603_1608MetricR8
1100uFCapacitor_SMD:CP_Elec_6.3x7.7C24
110uFCapacitor_SMD:C_1210_3225MetricC54
1120pFCapacitor_SMD:C_0603_1608MetricC31
113kResistor_SMD:R_0603_1608MetricR4
11MResistor_SMD:R_0603_1608MetricR25
11kResistor_SMD:R_0603_1608MetricR45
12.2uH 6x6Inductor_SMD:L_Coilcraft_XAL6060-XXXL3
1220uHInductor_SMD:L_12x12mm_H4.5mmL2
122uFCapacitor_SMD:C_1210_3225MetricC55
1348kResistor_SMD:R_0603_1608MetricR11
13kResistor_SMD:R_0603_1608MetricR3
13k9Resistor_SMD:R_0603_1608MetricR32
14u7FCapacitor_SMD:C_0603_1608MetricC14
1649kResistor_SMD:R_0603_1608MetricR12
16k2Resistor_SMD:R_0603_1608MetricR31
1AZ1084-1.8Package_TO_SOT_SMD:TO-252-2U10
1Conn_01x04_PinConnector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_VerticalJ4
1Conn_02x05_Odd_EvenConnector_PinHeader_2.54mm:PinHeader_2x05_P2.54mm_VerticalJ25
1DDiode_SMD:D_SOD-123D6
1DDiode_SMD:D_SMAD5
1ESP32-S3-WROOM-1-N16R2PLH:XCVR_ESP32-S3-WROOM-1-N16R2U6
1FDN337NPackage_TO_SOT_SMD:SOT-23Q2
1FDN340PPackage_TO_SOT_SMD:SOT-23Q1
1FM6124Package_SO:SSOP-24_3.9x8.7mm_P0.635mmU5
1MC33063ADRPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU7
1Micro_SD_Card_DetPLH:microSD_HC_Hirose_DM3AT-SF-PEJM5J26
1N0400P-ZK-E1-AYPLH:TO-252-3_TabPin2Q3
1PJ-037APLH:CUI_PJ-037AJ1
1PMOSPLH:TO-252-3_TabPin2Q12
1Phonejack_Stereo_SWPLH:StereoJack_3.5mm_Switch_Cliff_JY039-5P_HorizontalLINEOUT1
1PolyfuseFuse:Fuse_0805_2012MetricF2
1RResistor_SMD:R_0603_1608MetricR6
1RT6219Package_DFN_QFN:WDFN-10-1EP_3x3mm_P0.5mm_EP1.8x2.5mm_ThermalViasU9
1SG-210SDF (11.2896MHz)Oscillator:Oscillator_SMD_SeikoEpson_SG210-4Pin_2.5x2.0mmX1
1SGTL5000Package_DFN_QFN:QFN-32-1EP_5x5mm_P0.5mm_EP3.6x3.6mm_ThermalViasIC7
1SN74LVC1T45DBVPackage_TO_SOT_SMD:SOT-23-6U1
1STMPS2151STRPackage_TO_SOT_SMD:SOT-23-5U12
1STPS2150ADiode_SMD:D_SMAD2
1TPA6017A2Package_SO:TSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP2.15x3.35mmU8
1USBLC6-4SC6Package_TO_SOT_SMD:SOT-23-6U11
1USB_C_ReceptacleConnector_USB:USB_C_Receptacle_G-Switch_GT-USB-7010ASVJ34

Similar boards

  • 2 layers196.5 × 95.4 mmP2 Kevinbot Board, the printed circuit board in 3D

    P2 Kevinbot Board

    Kevinbot-Robotics/kevinbot_p2_board

    Parallax Propeller 2 Edge robot control system with 32 servo ports

    125 partsCERN-OHL-S-2.0
  • 2 layers100 × 80 mmSmall drive, the printed circuit board in 3D

    Small drive

    mark-v-d/motor_control

    Motor controller with an XMC4400

    176 parts5
  • 2 layers48.4 × 34.4 mmMpptDemoBoard, the printed circuit board in 3D

    MpptDemoBoard

    Cubesat-EPS-Project/EPS_Demo_MPPTboard

    Demo pcb board for MPPT

    22 parts
  • 4 layers95.1 × 95.1 mmFinal eps pcb 4layer, the printed circuit board in 3D

    Final eps pcb 4layer

    Cubesat-EPS-Project/final_eps_pcb_4layer

    186 partsGPL-3.0
  • 2 layers82.8 × 160 mmPower, the printed circuit board in 3D

    Power

    t0mka14/lab_supply

    Modular laboratory power supply witch switched preregulator

    115 parts
  • 6 layers53.3 × 101.6 mmMega2560plus, the printed circuit board in 3D

    Mega2560plus

    sneakylizard123-4/Mega2560plus

    Mega 2560+ is an upgraded version of the Arduino Mega 2560. It keeps the same form factor and pinout as the original so it still works with every Mega shield, but it adds an onboard sensor suite and an ESP32-S3…

    149 parts
  • 2 layers212.5 × 99.5 mmOssc pro, the printed circuit board in 3D

    Ossc pro

    marqs85/ossc_pro_hw

    OSSC Pro HW files

    499 parts31CERN-OHL-P-2.0

Questions

How big is the StarGate MainBoard PCB?

It measures 146.1 × 55 mm and has 4 copper layers, 1.6 mm thick.

What parts does the StarGate MainBoard use?

171 parts, built around the ESP32-S3-WROOM-1-N16R2, PCA9685PW, FM6124 and MC33063ADRE4. 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 StarGate MainBoard KiCad files?

From the plhsystems/stargate-mainboard-esp32 repository on GitHub, at the commit this page was made from: the board is hardware/StarGate-MainBoard.kicad_pcb and its schematic hardware/StarGate-MainBoard.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the StarGate MainBoard design in my own project?

Its repository states no licence, so its author keeps all rights: ask plhsystems before reusing the design.