Skip to the content
PCBKitNew board
2 layers44.6 × 44.6 mmFgFocus, the printed circuit board in 3D

Focus Lock for Micro-Manager

Size
44.6 × 44.6 mm
Copper layers
2
Thickness
1.6 mm
Parts
11
Nets
30
Pads
54
Tracks, vias
46, 15
Pours
2
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
27 May 2025
Updated
8 Dec 2025

Overview

FgFocus is an open-source printed circuit board by GrussmayerLab, from the GrussmayerLab/fgFocus repository on GitHub. It is a 2-layer board of 44.6 × 44.6 mm with 11 parts on 30 nets, routed with 46 tracks and 15 vias.

It is built around the FTSH-105-01-F-DV-P-TR. Its parts include 3 resistors, 2 connectors, 1 capacitor and 1 IC.

Main components

1

README

README.md

Fairly Good Focus (fgFocus)

fgFocus is an active focus-lock system designed to maintain sharp focus during extended imaging experiments, such as single-molecule and live-cell imaging. It corrects axial drift (movement along the Z-axis) that can occur over time, ensuring your sample stays perfectly in focus.

This project is inspired by similar systems like qgFocus and pgFocus and follows the same naming convention.

Estimated cost for this project is around €160.

Key Features

  • Real-time focus correction
  • Micro-Manager compatible
  • Flexible hardware support: works with any motorized Z-stage controllable through Micro-Manager

How It Works

  1. An infrared laser beam is aimed slightly off-center into the objective lens.
  2. The beam reflects off the coverslip (glass slide) at the bottom of the sample.
  3. When the sample moves up or down (axial drift), the reflected beam shifts sideways.
  4. A light-array sensor detects this lateral shift by measuring the intensity profile of the reflected beam.
  5. The system calculates the amount of drift using a Gaussian fit to find the center of the beam.
  6. A feedback loop adjusts the Z-position of the stage to return the beam to its original position — restoring focus.

Table of Contents


Getting Started

Hardware Setup

  1. The PCB directory contains the full Gerber set for fabrication, plus the schematic and board layout inside the fgFocus subfolder. The project was created in KiCad.
  2. At JLCPCB, upload the Gerber.rar archive and select PCB Assembly.
  3. When prompted, provide the bom.csv and fgFocus-top-pos.csv files to complete the assembly configuration.
  4. Some parts cannot be machine-assembled and must be sourced and soldered manually. These items are listed in bom_external_components.csv.
  5. The enclosure design is located in the enclosure directory with a bom.csv to source the enclosure.
  6. In the enclosure directory you can find a REAMDE that explains the assembly of all components.

Firmware Setup

  1. fgFocus uses the XIAO SAMD21 microcontroller.
  2. Follow this getting started tutorial to program the board using the fgFocus.ini file.

Software Setup

  1. Install Micro-Manager 2.0

    • Download and install the latest version of Micro-Manager 2.0.
    • Copy the precompiled EMU folder (provided) into the root directory of Micro-Manager.
  2. Install the EMU Plugin (for editing or customizing the interface)

  3. Install the fgFocus Plugin

    • Copy the FocusLock.jar file into the EMU folder in your Micro-Manager directory.
  4. Install the Device Adapter

    • Copy the mmgr_dal_fgFocus.dll file into the root directory of Micro-Manager.
    • To modify or rebuild the adapter:
      • Follow the Micro-Manager Visual Studio setup guide
      • Place .h files in the header folder and .cpp files in the source folder.
      • Compile the project and place the resulting .dll file into the Micro-Manager root directory.

Usage

  1. Connect the fgFocus system to your PC using a USB-C cable.
  2. Create a folder called fgFocus in the root of Micro-Manager.
  3. In Micro-Manager, go to Device > Hardware Configuration Wizard and create a new config file to only add fgFocus and save it in the fgFocus folder. Make sure you select a baudrate of 115200.
  4. Launch the plugin: Plugins > User Interface > EMU — the fgFocus control panel will open. Ignore, the warning that it is not configured, fgFocus runs on a separate MMCore instance.

You should see the following interface:

fgFocus

Now you're ready to go!

In the interface:

  • You can adjust the exposure time and averaging for the light-array sensor.
  • Press the Enable button to monitor pixel data from the sensor.
  • Use the Calibrate button to run a calibration script that determines the relationship between pixel position and Z-distance.
  • Once calibration is complete, the Lock button becomes available, activating the focus lock.

Happy Imaging!

Note

To adjust the number of steps or the step size used in the calibration script, open CalibrateTask.java and modify the following variables:

java
private final int numSteps = 5;
private final double stepSizeUm = 1;

Contribution

Contributions are welcome. Whether you're enhancing firmware stability, refining hardware design, or extending the MicroManager plugins, focused pull requests with clear explanations help keep the project maintainable. Open an issue if you'd like to discuss a feature or improvement before implementing it.

License

Software in this project is licensed under the MIT License and hardware is licensed under CERN OHL - see LICENSE file for details in the licenses folder.

Parts

11
QtyValueFootprintReferences
4MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
210kResistor_SMD:R_0805_2012MetricR6, R7
11.5kResistor_SMD:R_0805_2012MetricR5
1100pCapacitor_SMD:C_0805_2012MetricC15
1Conn_02x06_Counter_ClockwiseConnector_Hirose:Hirose_DF11-12DP-2DSA_2x06_P2.00mm_VerticalJ3
1FTSH-105-01-F-DV-P-TRFTSH-105-01-F-DV-P-TR:SAMTEC_FTSH-105-01-F-DV-P-TRJ1
1XIAO-SAMD21-SMDSeeed Studio XIAO Series Library:XIAO-SAMD21-SMDU7

Questions

How big is the FgFocus PCB?

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

What parts does the FgFocus use?

11 parts, built around the FTSH-105-01-F-DV-P-TR. 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 FgFocus KiCad files?

From the GrussmayerLab/fgFocus repository on GitHub, at the commit this page was made from: the board is PCB/fgFocus/fgFocus.kicad_pcb and its schematic PCB/fgFocus/fgFocus.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the FgFocus design in my own project?

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

Similar boards

  • 4 layers139.7 × 41.3 mmSchemat, the printed circuit board in 3D

    Schemat

    konrad1s/LineFollower-Kwark

    Fast LineFollower Robot project. Build on STM32 F7 microcontroller with custom PCB. Software, Hardware and QT Application.

    74 parts12MIT
  • 4 layers72.4 × 45.7 mmEasyBLDCV1 DRV8305, the printed circuit board in 3D

    EasyBLDCV1 DRV8305

    buckles3636/EasyBLDC

    Please ensure your designs meet common standards and include necessary documentation and comments.

    79 parts2MIT
  • 4 layers40.3 × 68.8 mmNrfMain, the printed circuit board in 3D

    NrfMain

    batkay/CapstonePCB

    76 parts
  • 2 layers29.2 × 18.3 mmBat IMU nRF5340, the printed circuit board in 3D

    Bat IMU nRF5340

    BigBroBob2/bat_tag_nrf5340dk

    A custom-designed device to record free-flying bat kinematics, echos, and eye movement

    21 parts
  • 4 layers15 × 20 mmMillimobile circuit, the printed circuit board in 3D

    Millimobile circuit

    zenglhardt/millimobile-platform

    This repo contains the KiCad PCB design files for the development board verison of the MilliMobile. For more information on the platform, see the project page

    38 parts
  • 2 layers60 × 30 mmController, the printed circuit board in 3D

    Controller

    google/mozc-devices

    Circuit diagrams and firmware source code for Gboard DIY keyboards

    11 parts3kApache-2.0
  • 2 layers103 × 30.5 mmTS Front Endcap, the printed circuit board in 3D

    TS Front Endcap

    EEVengers/ThunderScope

    ThunderScope GitHub Repo

    11 parts1.3kMIT
  • 2 layers26 × 30 mmExpansion Card, the printed circuit board in 3D

    Expansion Card

    FrameworkComputer/ExpansionCards

    Reference designs and documentation to create Expansion Cards for the Framework Laptop

    11 parts1.1kCC-BY-4.0