Skip to the content
2 layers70 × 37 mmPSM HeinzmannKretz, the printed circuit board in 3D

Photoelectric Sensor Array for STM32F767 Eval-Board

Size
70 × 37 mm
Copper layers
2
Thickness
1.6 mm
Parts
48
Nets
37
Pads
135
Tracks, vias
211, 35
Pours
2
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
11 Aug 2026
Updated
11 Aug 2026

Overview

PSM HeinzmannKretz is an open-source printed circuit board by heinzmmo, from the heinzmmo/light-barrier-array repository on GitHub, published under the MIT licence. It is a 2-layer board of 70 × 37 mm with 48 parts on 37 nets, routed with 211 tracks and 35 vias.

It is built around the AD8646ARZ. Its parts include 19 resistors, 14 capacitors, 6 connectors and 3 ICs. It belongs with the sensors and measurement boards of this library.

Main components

1

README

README.md

Semester Project: Photoelectric Sensor Array

As part of the Sensor Technology and Mechatronics Project Lab, an photoelectric sensor array (light barrier array) was designed to detect beam interruptions simultaneously using a single analog signal line.

The project focused on the development of the analog electronics, the circuit design and simulation, the design of the PCB, and the implementation of the firmware for digital signal processing and evaluation.

Project Structure

bash
project/
├── docs                   # Technical documentations
│   ├── datasheets
│   └── manuals
├── firmware               # STM32CubeMX Project
├── pcb 
│   ├── .kicad_xxx
│   └── postpr             # Manufactoring outputs (Gerber, Drill...)
├── README.md
├── report                 # Project report (LaTeX source) + Compiled PDF
├── sandbox                # Test env (ignored)
└── sim                    # LTspice & Python simulations 

Overview

Each light barrier consists of an LED–photodiode pair driven by pulse-width-modulated (PWM) signals at unique frequencies ($3\text{ kHz}$, $5\text{ kHz}$, $7\text{ kHz}$, and $9\text{ kHz}$). The optical signals are received by BPW34 photodiodes operated in reverse-bias (photoconductive) mode to maximize response speed and bandwidth. The photodiode currents are converted to voltages via individual Transimpedance Amplifiers (TIA), additively combined in an inverting summing amplifier stage, filtered using a 2nd-order Sallen-Key low-pass filter ($f_c \approx 15.6\text{ kHz}$), and digitized by an STM32 microcontroller ADC. Digital signal processing is performed via Fast Fourier Transform (FFT) to simultaneously evaluate all four channels.

As a practical application, a digital logic game was implemented in firmware where users enter a randomized 6-digit passcode (generated via True Random Number Generator - TRNG) by selectively breaking the light barriers (each representing a binary bit from 1 to 15).


Architecture

1. Analog Front-End

  • Photodiode Bias: BPW34 photodiodes are operated in reverse-bias mode to lower junction capacitance ($C_j \propto 1/\sqrt{U_R}$), improving bandwidth and response time.
  • Transimpedance Amplifier (TIA): Converts photodiode currents into voltages ($U_{\text{out}} = U_{\text{ref}} - I_{\text{ph}} \cdot R_f$). Feedback capacitance $C_f$ is added in parallel with feedback resistor $R_f$ to compensate for loop instability caused by photodiode junction capacitance $C_j$, achieving a Butterworth response ($\zeta = 0.707$) without resonance peaking.
  • Summing Stage & Filtering: An active inverting summer merges the four TIA outputs into a single composite signal. A Sallen-Key 2nd-order low-pass filter ($f_c = 15.6\text{ kHz}$) suppresses higher-order PWM harmonics before ADC sampling.
  • Custom PCB: Adapter PCB for the STM32F767 Eval-Bard designed in KiCad

2. Firmware & Digital Signal Processing

  • Platform: STM32 microcontroller (ARM Cortex-M7 / STM32F7 series).
  • Sampling & DMA: Timer-triggered 12-bit ADC running at $f_s = 20\text{ kHz}$ with Circular Direct Memory Access (DMA) transferring 512 samples per frame directly to RAM without CPU overhead.
  • FFT Spectral Analysis: Computes 512-point real FFT using ARM CMSIS-DSP (arm_rfft_fast_f32), providing a frequency bin resolution of $\Delta f = f_s / N \approx 39.06\text{ Hz}$. Energy across 5 adjacent bins surrounding each target frequency ($3\text{ kHz}$, $5\text{ kHz}$, $7\text{ kHz}$, $9\text{ kHz}$) is integrated to detect channel presence/absence robustly against spectral leakage.
  • State Machine Game App: Manages sampling timing ($100\text{ ms}$ system tick), TRNG passcode generation, UART terminal user interface, binary inputs via sensor array, and pass/fail evaluation via onboard status LEDs.

Useful Commands

Format auto-generated Makefile:

bash
cd firmware/
dos2unix Makefile

Generate compile_commands.json for LSP (from Makefile)

bash
cd firmware/
bear -- make

Requirements

  • STM32CubeMX

  • GNU Arm Embedded Toolchain

    • Debian
    bash
    sudo apt install gcc-arm-none-eabi
    • Fedora
    bash
    sudo dnf install arm-none-eabi-gcc arm-none-eabi-newlib arm-none-eabi-binutils-cs 
  • STLINK Tools

Parts

48
QtyValueFootprintReferences
8100nCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC1, C4, C5, C6, C7, C8, C11, C12
810kResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR5, R11, R12, R13, R14, R17, R18, R19
6FiducialFiducial:Fiducial_1.5mm_Mask3mmFID1, FID2, FID3, FID4, FID5, FID6
4270kResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR7, R8, R9, R10
45pCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC2, C3, C9, C10
4RResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR1, R2, R3, R4
3AD8646ARZpsm_ss26:SOIC127P600X175-8NU1, U2, U3
21nCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC13, C14
2Conn_02x02_Odd_EvenConnector_PinSocket_2.54mm:PinSocket_2x02_P2.54mm_VerticalJ2, J4
2Conn_02x05_Odd_EvenConnector_PinSocket_2.54mm:PinSocket_2x05_P2.54mm_VerticalJ8, J9
12.5kResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR15
122kResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR16
147kResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR6
1Conn_01x03_PinConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ19
1Conn_02x04_Odd_EvenConnector_PinSocket_2.54mm:PinSocket_2x04_P2.54mm_VerticalJ1

Similar boards

  • 4 layers159.1 × 99.9 mmLoTI Board, the printed circuit board in 3D

    LoTI Board

    devtank-ltd/kicad_hiltop_loti_board

    KiCAD files for Loti card for HILTOP

    452 parts
  • 4 layers159.6 × 100 mmSensi Board, the printed circuit board in 3D

    Sensi Board

    devtank-ltd/kicad_hiltop_sensi_board

    KiCAD files for Seni card for HILTOP

    463 parts
  • 6 layers165 × 99.5 mmOscilloscope, the printed circuit board in 3D

    Oscilloscope

    eriklind90/oscilloscope_PCB

    196 parts
  • 2 layers90.1 × 99 mmGrund Platine, the printed circuit board in 3D

    Grund Platine

    ReMured/Bachelorarbietfinal

    83 parts
  • 2 layersDemo, the printed circuit board in 3D

    Demo

    adamws/kicad-kbplacer

    KiCad plugin for automatic keyboard's key placement and routing

    48 parts547GPL-3.0
  • 2 layers18.8 × 18.1 mmAmoeba royale, the printed circuit board in 3D

    Amoeba royale

    mtl/keyboard-pcbs

    Keyboard PCBs

    48 parts485

Questions

How big is the PSM HeinzmannKretz PCB?

It measures 70 × 37 mm and has 2 copper layers, 1.6 mm thick.

What parts does the PSM HeinzmannKretz use?

48 parts, built around the AD8646ARZ. 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 PSM HeinzmannKretz KiCad files?

From the heinzmmo/light-barrier-array repository on GitHub, at the commit this page was made from: the board is pcb/PSM_HeinzmannKretz.kicad_pcb and its schematic pcb/PSM_HeinzmannKretz.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the PSM HeinzmannKretz 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).