Version 2.1

Photogate V2

ESP32 optical timer documented from electronics to firmware and 3D modeling

Project Overview

Photogate V2 measures time intervals produced by an infrared optical barrier. The analog sensor response is conditioned by an LM393 comparator, converted into 3V3 digital pulses, counted by the ESP32, and interpreted by firmware routines for physics experiments.

ESP-IDF v5.4
ESP32
KiCad
FreeCAD
FreeRTOS

Documentation Sections

Open Development Toolchain

The project was developed with open and widely available tools so the electronics, firmware, and mechanical parts can be studied, modified, reproduced, and maintained without depending on closed design files.

ESP-IDF

Official Espressif framework used to build, flash, monitor, and configure the ESP32 firmware.

FreeRTOS

Provides the task, queue, and timing structure used by the menu and measurement routines.

KiCad

Used for schematic capture, PCB layout, board documentation, and manufacturing outputs.

FreeCAD

Used to model the enclosure and mechanical assembly as editable parametric parts.

Linux Workflow

Development was organized around a reproducible terminal workflow for building and documenting the project.

Open Hardware

Design files are kept in the repository so the device can be inspected, adapted, and reproduced.

Build and Run

Requirements

  • ESP-IDF v5.4
  • A configured ESP32 development environment installed with Espressif's official tools
  • Required cables and hardware to flash the firmware

Install and configure ESP-IDF from Espressif's official installation site: ESP-IDF Installation Manager

Quick Start

1. Clone the repository

git clone https://github.com/MarcioBulla/PhotogateV2.git
cd PhotogateV2

2. Open an ESP-IDF terminal/session

After installing ESP-IDF, use the terminal or shell configured by the official installer so that idf.py and the ESP-IDF environment variables are available.

3. Build, flash, and monitor

cd firmware
idf.py build flash monitor

Repository Structure

  • firmware/
    C source code for the ESP32 firmware
  • boards/
    KiCad schematic, PCB layout, packages, and JLCPCB files
  • 3DModels/
    FreeCAD mechanical model files
  • docs/
    Website, IBOM, 3D preview, and curated image assets