homelabprivacy

DIY Bowling Alley Scoring with ESP32 and ESP-IDF

🤖 Researched and drafted automatically from the official docs, and reviewed before publishing. Commands are taken from the source projects — but always sanity-check before running anything on your own hardware.

Enterprise bowling alley systems run $100k+. You can build a functional networked scoring system with ESP32 boards and ESP-IDF for under $2k in hardware. This guide walks you through setting up the development environment, flashing firmware to multiple boards, and monitoring them over serial—all on your LAN.

Prerequisites

You’ll need:

  • Multiple ESP32 boards (one per lane, roughly $10–15 each)
  • A Linux, Windows, or macOS machine for development
  • USB-to-serial cables or built-in USB on your ESP32 boards
  • Basic familiarity with command-line tools
  • A local network or isolated VLAN for the scoring system

Step 1: Install Build Dependencies and ESP-IDF

Follow the official setup guide at https://idf.espressif.com/ for your OS. The process installs the toolchain, Python dependencies, and the ESP-IDF repository.

On Linux/macOS, after cloning the ESP-IDF repository:

cd esp-idf
./install.sh
source ./export.sh

On Windows, run install.bat or install.ps1, then export.bat before each session.

Step 2: Set Your Target SoC

Determine which ESP32 variant you’re using (standard ESP32, ESP32-S3, etc.). Run:

idf.py set-target esp32

Replace esp32 with your chip name if using a different variant. Run the command with no arguments to see all supported targets.

Step 3: Configure Your Project

If you’re starting from an example or template, navigate to the project directory. Open the configuration menu:

idf.py menuconfig

Here you can set:

  • Serial port baud rate
  • WiFi credentials (if your scoring system needs network connectivity)
  • Partition table layout
  • Any custom component settings

Navigate with arrow keys, press Space to toggle options, and Enter to select. Press Escape twice to exit.

Step 4: Build the Firmware

Compile your application:

idf.py build

This generates the app, bootloader, and partition table. If the build succeeds, you’ll see output files in the build/ directory.

Step 5: Flash to Your First Board

Connect an ESP32 board via USB. Identify its serial port:

  • Linux: typically /dev/ttyUSB0 or /dev/ttyACM0
  • macOS: typically /dev/cu.usbserial-*
  • Windows: typically COM3 or higher

Flash the firmware:

idf.py -p /dev/ttyUSB0 flash

Replace the port with your actual serial port. The tool will erase, flash the bootloader, app, and partition table, then verify the flash.

Step 6: Monitor Serial Output

Watch the board’s serial output in real time:

idf.py -p /dev/ttyUSB0 monitor

You’ll see boot messages, log output, and any debug prints from your code. Press Ctrl-] to exit the monitor.

To build, flash, and monitor in one command:

idf.py -p /dev/ttyUSB0 flash monitor

Step 7: Iterative Development

After your initial full flash, you can speed up development by reflashing only the app:

idf.py app-flash

This skips the bootloader and partition table (which rarely change) and is much faster.

Step 8: Scale to Multiple Boards

For a multi-lane system, you’ll flash each board individually. Create a simple loop script:

for port in /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2; do
  idf.py -p $port erase-flash flash
done

Or flash them one at a time, labeling each board as you go.

Step 9: Network Communication (Optional)

If your scoring system needs inter-board communication, use ESP-IDF’s networking components (WiFi, Ethernet, or raw socket APIs). Configure WiFi in menuconfig, then use the ESP-IDF examples in the examples/ directory as a starting point.

Step 10: Keep It Local

Critical: Do not expose your scoring system to the public internet. Keep all ESP32 boards on a dedicated LAN or VLAN. Use firewall rules to block any outbound traffic to the WAN. This is a homelab system for your facility only.

Troubleshooting

Board not detected: Check USB cable, try a different port, verify the board’s USB-to-serial chip is supported (CH340, CP2102, FT232 are common).

Flash fails: Run idf.py -p PORT erase-flash first, then idf.py -p PORT flash.

Build errors: Ensure you’ve sourced export.sh (or run export.bat) in the current shell session.

Monitor shows garbage: Verify the baud rate in menuconfig matches your terminal settings (usually 115200).

Is It Worth It?

Yes, if you’re replacing a commercial system or building a homelab bowling setup. The hardware cost is negligible ($2k for a full 8-lane system), and ESP-IDF is mature and well-documented. The main effort is writing the scoring logic and lane-to-lane communication code, but that’s true regardless of platform. You get full control, no licensing fees, and the ability to customize every aspect of the system. Just keep it off the internet.

New self-hosting builds every week.

Subscribe on YouTube

← All guides