Skip to the content
2 layers90 × 60 mmLED board, the printed circuit board in 3D

code to run LED stimulation experiments

Size
90 × 60 mm
Copper layers
2
Thickness
1.6 mm
Parts
20
Nets
16
Pads
36
Tracks, vias
39, 0
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
3 Dec 2024
Updated
8 Sep 2026

Overview

LED board is an open-source printed circuit board by SaleemLab, from the SaleemLab/LEDStimulation repository on GitHub. It is a 2-layer board of 90 × 60 mm with 20 parts on 16 nets, routed with 39 tracks and 0 vias.

Its parts include 12 diodes and 4 connectors.

README

README.md

Full-Field LED Visual Stimulator

An open-source, high-precision visual stimulation platform designed for visual neuroscience, sensory physiology, and human psychophysics. The system delivers temporally agile, multi-chromatic optical stimulation (e.g., Green for M-cones/rods and UV for S-cones, or custom multi-spectral arrays) with sub-millisecond precision.

https://github.com/user-attachments/assets/08af2269-a270-4899-ae75-62786a714254

Example stimulus: 2 Hz antiphase (Green / UV) sinusoidal flicker.


Key Capabilities

  • High-Resolution Temporal Modulation: 16-bit Phase-Correct carrier PWM (~7.68–10 kHz) combined with hardware-interrupt pacing (Timer3 CTC ISR) eliminates visible digital stepping and software loop jitter.
  • Rich Stimulus Battery: Native microsecond-timed generation of sinusoidal flickers, Gaussian white noise (with Central Limit Theorem PRNG), contrast-switching adaptation sequences, exponential frequency chirps, and stepped luminance pulses.
  • Quantitative Radiometric Calibration: End-to-end MATLAB calibration pipeline mapping raw duty cycles to linearized lookup tables (LUTs) and calculating exact photoreceptor isomerisation rates ($R^*/\text{photoreceptor/s}$).
  • Flexible Form Factors: Supports both 200mm full-field panel enclosures (with magnetic diffusion clamping) and miniature wearable mounts for Pupil Labs Neon eye-tracking glasses.
  • Reactive Experiment Orchestration: Full integration with Bonsai for closed-loop, state-dependent, adaptive psychometric staircase, and LabStreamingLayer (LSL) multi-modal recording.

System Architecture

mermaid
graph LR
    subgraph Host Software
        Bonsai[Bonsai Reactive Workflows]
        LSL[LabStreamingLayer / LabRecorder]
        MATLAB[MATLAB Calibration Suite]
    end

    subgraph Microcontroller Firmware
        MCU[Arduino Leonardo / Teensy 4.1]
        T1[Timer1: 16-bit PWM]
        T3[Timer3: CTC Interrupt Pacing]
        LUT[PROGMEM Gamma LUT]
    end

    subgraph Hardware & Optics
        Driver[Multi-Channel Driver Stage]
        LEDs[Dual-Channel LED Arrays]
        Enclosure[Magnetic Diffusion Enclosure / Glasses]
        Sensors[Photodiode / Power Meter / Eye Tracker]
    end

    Bonsai -- Serial ASCII (115200) --> MCU
    MATLAB -. Offline Calibration .-> LUT
    MCU --> T1 & T3

Quickstart Guide

1. Flash the Firmware

  1. Open ArduinoCode/StimulusControlViaSerial_Leonardo_v8/StimulusControlViaSerial_Leonardo_v8.ino [blocked] in the Arduino IDE.
  2. Select Arduino Leonardo as your board and choose the corresponding COM port.
  3. Click Upload.

2. Connect Hardware & Verify

  1. Connect your LED driver to the designated MCU pins (PWM: Pins 9 & 10; Indicators: Pins 4 & 5).
  2. Open the Serial Monitor at 115200 baud.
  3. Send a test sinusoidal flicker:
    text
    s, 3000, 2.0, 0.0, 0.5, 0.8, 0.8
    (Runs a 3-second, 2 Hz antiphase flicker on Channels A and B at 80% contrast).

3. Launch Experimental Workflows

Open Bonsai and load one of the pre-built visual stimulation workflows from BonsaiCode/ [blocked] (e.g., LEDstimulation_normal.bonsai or ManualMethodOfAdjustment.bonsai).


Documentation Index

Comprehensive guides, schematics, and technical specifications are available in the docs/ directory:


Repository Structure

text
├── ArduinoCode/                  # Microcontroller firmware (Leonardo v8, DDS, Teensy 4.1, IMU)
├── BonsaiCode/                   # Main Bonsai visual reactive workflows & stimulus CSVs
├── BonsaiForHumanExperiments/    # Dedicated human psychophysics Bonsai workflows
├── Calibration/                  # MATLAB scripts for radiometry, gamma LUTs & opsin calculations
├── Hardware/                     # CAD files (.stp, .stl, .ipt), KiCad PCB designs & driver schematics
│   ├── Enclosure/                # Baseplate CAD & 3D printed magnetic diffusion clamps
│   ├── glasses/                  # Pupil Labs Neon glasses boom arm & miniature diffuser
│   ├── LED_board/                # KiCad dual-channel LED array PCB
│   └── LED_board_humans/         # KiCad 3-colour LED array PCB (WIP redesign with layout improvements)
├── HumanExpAnalysis/             # MATLAB scripts for IMU movement and behavioural analysis
├── LabRecorderFiles/             # Multi-modal LabStreamingLayer (LSL) recording configurations
└── docs/                         # Modular technical documentation

License & Attribution

Developed for scientific research applications. If you use this platform in your research, please cite this repository.

Parts

20
QtyValueFootprintReferences
6LEDeasyeda2kicad:LED-SMD_L3.5-W2.8-FD_WHITE-1D5, D6, D7, D13, D14, D15
6LEDeasyeda2kicad:LED-SMD_L3.5-W2.8_REDD1, D2, D3, D9, D10, D11
4MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
1Green bank 1Connector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_HorizontalJ1
1Green bank 2Connector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_HorizontalJ3
1UV bank 1Connector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_HorizontalJ2
1UV bank 2Connector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_HorizontalJ4

Similar boards

  • 2 layers66.9 × 74.5 mmDeskHop Rev1, the printed circuit board in 3D

    DeskHop Rev1

    hrvach/deskhop

    Fast Desktop Switching Device

    20 parts7.9kGPL-3.0
  • 2 layers86.4 × 64.8 mmSlot machine, the printed circuit board in 3D

    Slot machine

    google/google-ctf

    Google CTF

    20 parts5.1kApache-2.0
  • 2 layers36.2 × 26.8 mmEsp32 minimal, the printed circuit board in 3D

    Esp32 minimal

    atopile/atopile

    Design circuit boards with code! ✨ Get software-like design reuse 🚀, validation, version control and collaboration in hardware; starting with electronics ⚡️

    20 parts4kMIT
  • 2 layers108.1 × 393.8 mmSweep compact ble, the printed circuit board in 3D

    Sweep compact ble

    davidphilipbarr/Sweep

    Sweep - a small promicro based keyboard inspired by the Ferris.

    20 parts2.1k
  • 2 layers26 × 15.9 mmTPS54340 Buck Regulator, the printed circuit board in 3D

    TPS54340 Buck Regulator

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    20 parts1.2k
  • 2 layers67.6 × 30.5 mmRgb to hdmi, the printed circuit board in 3D

    Rgb to hdmi

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    20 parts1kGPL-3.0
  • 2 layers44.3 × 28.7 mmLin bus adapter esp32, the printed circuit board in 3D

    Lin bus adapter esp32

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    20 parts915
  • 2 layers89.5 × 61.6 mmFreeDeck TH 2020-02, the printed circuit board in 3D

    FreeDeck TH 2020-02

    FreeYourStream/freedeck-hardware

    all the stuff you need to build your own FreeDeck

    20 parts772

Questions

How big is the LED board PCB?

It measures 90 × 60 mm and has 2 copper layers, 1.6 mm thick.

What parts does the LED board use?

20 parts. 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 LED board KiCad files?

From the SaleemLab/LEDStimulation repository on GitHub, at the commit this page was made from: the board is Hardware/LED_board/LED_board.kicad_pcb and its schematic Hardware/Constant_current_driver/Constant_current_driver.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the LED board design in my own project?

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