Skip to the content
4 layers45.7 × 51.6 mmWfield trigger, the printed circuit board in 3D

Wfield trigger

jcouto/labcams12

Software to control and record from multiple cameras

Size
45.7 × 51.6 mm
Copper layers
4
Thickness
1.6 mm
Parts
30
Nets
48
Pads
126
Tracks, vias
211, 1
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
16 Apr 2021
Updated
14 May 2025

Overview

Wfield trigger is an open-source printed circuit board by jcouto, from the jcouto/labcams repository on GitHub, published under the GPL-3.0 licence. It is a 4-layer board of 45.7 × 51.6 mm with 30 parts on 48 nets, routed with 211 tracks and 1 via.

It is built around the BSS138. Its parts include 12 resistors, 8 connectors, 6 transistors and 1 IC. It belongs with the NXP (LPC, Kinetis, i.MX RT) boards of this library.

Main components

1

README

README.md
text
                                         MMM
                                       MMMMMM
MMM:               .MMMM             MMMM MMMMMMMM
MMM:               .MMMM            MMMMM MMMMMMMM      
MMM:               .MMMM             MMMM  MMMMMM        MM 
MMM:  :MMMMMMMMM.  .MMMMOMMMMMM       MN     MMM      MMMMM 
MMM:  :M     MMMM  .MMMMM?+MMMMM    MMMMMMMMMMMMMMM7MMMMMMM  
MMM:         OMMM  .MMMM    MMMM    MMMMMMMMMMMMMMMMMMMMMMM 
MMM:  .MMMMMMMMMM  .MMMM    ?MMM    MMMMMMMMMMMMMMMMMMMMMMM 
MMM:  MMMM  .8MMM  .MMMM    ZMMM    MMMMMMMMMMMMMMMMMMMMMMM 
MMM:  MMM=...8MMM  .MMMM    MMMM    MMMMMMMMMMMMMMM.MMMMMMM  
MMM:  MMMMMMMMMMM  .MMMMMMMMMMM                        MMMM 
MMM:   MMMMM 8MMM  .MMMM:MMMMZ                            M 

     MMMMMMN  =MMMMMMMM     MMMM.MMMM$ .+MMMM      MMMMMMM: 
   MMMMMMMMM  +MMMMMMMMM$   MMMMMMMMMMMMMMMMMM   MMMMMMMMM8 
  MMMM               MMMM   MMMM   MMMM    MMM+  MMM8       
  MMMZ          OMMMMMMMM   MMMM   NMMM    MMM?  MMMMMMM$   
  MMMI        MMMMM  MMMM   MMMM   NMMM    MMM?   ZMMMMMMMM 
  MMMM       7MMM    MMMM   MMMM   NMMM    MMM?        MMMM 
   MMMMD+7MM  MMMN   MMMM   MMMM   NMMM    MMM?  MM$:.7MMMM   
    MMMMMMMM  ZMMMMMOMMMM   MMMM   NMMM    MMM?  MMMMMMMM+  
                      https://bitbucket.org/jpcouto/labcams   

Multicamera control and acquisition.

This aims to facilitate video acquisition and automation of experimens, uses separate processes to record and store data. Interfaces with other computers via UDP or ZeroMQ for automating experiments. Uses hardware and FFMPEG to compress in real-time.

Instalation from pip (recommended but not the latest version):

pip install labcams or add the --no-deps flag to install no dependencies.

Install camera drivers:

Usage:

Open a terminal and type labcams -h for help.

The first time you run labcams it will create a folder in the user home directory where the default preference file is stored.

Command line options:

commanddescription
-w--waitstart with software trigger OFF
-t--triggeredstart with hardware trigger ON
-c X Y--cam-select X Ystart only some cameras -c 0 1
-d PATH--make-config PATHcreate a configuration file
--no-serverdo not start the ZMQ nor the UDP server

Configuration files:

Configuration files ensure you always use the same parameters during your experiments.

The configuration files are simple json files. There are 2 parts to the files.

  1. cams - camera descriptions - each camera has a section to store acquisition and recording parameters.

Available camera drivers:

  • PCO - install pco.sdk
  • AVT - install Vimba SDK and pymba
  • QImaging
  • pointgrey - FLIR cameras - install Spinnaker
  • openCV - webcams and so on

For calcium or voltage imaging with the PCO (or another) camera use the arduino code in the duino folder and instructions.

Each camera has its own parameters, there are some parameters that are common to all:

  • recorder - the type of recorder tiff ffmpeg opencv binary
  • haccel - nvidia or intel for use with ffmpeg for compression.

NOTE: You need to get ffmpeg compiled with NVENC from here - precompiled versions are avaliable - conda install ffmpeg works. Make sure to have python recognize it in the path (using for example which ffmpeg to confirm from git bash)/

NOTE To use intel acceleration you need to download the mediaSDK.

  1. general parameters to control the remote communication ports and general gui or recording parameters.
  • recorder_frames_per_file number of frames per file
  • recorder_path the path of the recorder, how to handle substitutions - needs more info.
  1. Aditional parameters:
  • 'CamStimTrigger' - controls the arduino camera trigger, see the duino examples folder.

UDP and ZMQ:

labcams can listen for UDP or ZMQ commands.

To configure use the command "server":"udp" in the end of the config file.

The port can be configured with "server_port":9999

The UDP commands are:

  • Set the experiment name expname=EXPERIMENT_NAME
  • Software trigger the cameras softtrigger=1 (multiple cameras are not in sync)
  • Hardware trigger mode and save trigger=1
  • Start/stop saving manualsave=1
  • Add a message to the log log=MESSAGE
  • Quit quit

Supported cameras - see instructions here:

  • PCO cameras (only windows)
  • PointGrey cameras (via PySpin)
  • Basler cameras (via pypylon)
  • Allied Vision Technologies (via pymba - updating to the latest)
  • QImaging cameras via the legacy driver (only windows)
  • Ximea cameras

Features:

  • Separates viewer, camera control/acquisition and file writer in different processes.
  • Data from camera acquisition process placed on a cue.
  • Display options: background subtraction; histogram equalization; pupil tracking via the mptracker .
  • Multiple buffers on Allied vision technologies cameras allows high speed data acquisition.
  • Online compression using ffmpeg (supports hardware acceleration)

Instalation on Ubuntu 20.04

sudo apt install python3-matplotlib ipython3 python3-opencv python3-pyqt5 python3-tqdm python3-pip python3-pyqtgraph python3-serial python3-zmq python3-natsort python3-pandas emacs git ssh ffmpeg

pip3 install labcams - this may end up in $HOME/.local/bin so add the following to the end of the .bashrc file: export PATH=$PATH:$HOME/.local/bin

Instalation - from git:

Note: On windows get the git bash terminal . I had issues running from cmd.exe when installed with conda.

  1. Get anaconda . Add conda to system PATH when asked. Open a terminal (use git bash if on windows) and type conda init bash.
  2. Clone the repository: git clone git@bitbucket.org:jpcouto/labcams.git
  3. Go into the cloned cd labcams folder.
  4. Install the required packages, use e.g. pip install -r requirements.txt or conda install...
  5. Install labcams with python setup.py develop
  6. Follow the camera specific instalation and instructions for syncronization. Each camera must have a section in the ~/labcams/default.json file that is created the first time you try to run the software with the command labcams from the terminal. Use a text editor to add the correct options. There are examples in the examples folder.
  7. Install ffmpeg with anaconda: conda install -c conda-forge ffmpeg

You can run labcams from the command terminal.

Please drop me a line for feedback and let the world know if you use this.

Joao Couto - jpcouto@gmail.com

May 2017

Parts

30
QtyValueFootprintReferences
1210kResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12
6BSS138Package_TO_SOT_SMD:SOT-23Q1, Q2, Q3, Q4, Q5, Q6
2MountingHole_3.2mm_M3MountingHole:MountingHole_3.2mm_M3mount1, mount2
1ExposureConnector_Coaxial:SMA_Molex_73251-2200_HorizontalJ4
1GPIO0Connector_Coaxial:SMA_Molex_73251-2200_HorizontalJ8
1LEDTerminalBlock_TE-Connectivity:TerminalBlock_TE_282834-4_1x04_P2.54mm_HorizontalJ2
1LED0Connector_Coaxial:SMA_Molex_73251-2200_HorizontalJ7
1LED1Connector_Coaxial:SMA_Molex_73251-2200_HorizontalJ3
1LOGOlabcams_custom:labcamsG***
1SYNCTerminalBlock_TE-Connectivity:TerminalBlock_TE_282834-4_1x04_P2.54mm_HorizontalJ1
1SYNC0Connector_Coaxial:SMA_Molex_73251-2200_HorizontalJ6
1SYNC1Connector_Coaxial:SMA_Molex_73251-2200_HorizontalJ5
1Teensy4.0labcams_custom:Teensy40U1

More from jcouto/labcams

1
  • 2 layers53.3 × 55.9 mmTrigger box avt, the printed circuit board in 3D

    Trigger box avt

    jcouto/labcams

    Software to control and record from multiple cameras

    26 parts12GPL-3.0

Similar boards

  • 4 layers36 × 50.2 mmRacer, the printed circuit board in 3D

    Racer

    StuckAtPrototype/Racer

    These are structured into their own files. I could have used submodules, but decided against it.

    83 parts3.8kApache-2.0
  • 4 layers95 × 95 mmCube motherboard, the printed circuit board in 3D

    Cube motherboard

    willem-pennings/balancing-cube

    A cube that balances itself in a corner or edge using reaction wheels

    52 parts1.1kGPL-3.0
  • 2 layers54.6 × 70.9 mmBeagleLogic Cape, the printed circuit board in 3D

    BeagleLogic Cape

    abhishek-kakkar/BeagleLogic

    A Software Suite that implements a logic analyzer with the PRU on the BeagleBone / BeagleBone Black.

    22 parts479GPL-3.0
  • 2 layers44.2 × 29.3 mmI2c tiny usb, the printed circuit board in 3D

    I2c tiny usb

    harbaum/I2C-Tiny-USB

    Cheap and simple I²C to USB interface

    27 parts454
  • 2 layers21.6 × 52.3 mmPs2 pico hat, the printed circuit board in 3D

    Ps2 pico hat

    No0ne/ps2x2pico

    USB keyboard/mouse to PS/2 interface converter using a Raspberry Pi Pico

    17 parts399MIT
  • 2 layers45 × 45 mmAirCube, the printed circuit board in 3D

    AirCube

    StuckAtPrototype/AirCube

    Works standalone out of the box. Pairs with Home Assistant in minutes. Other platforms are supported through community-contributed extensions.

    61 parts379Apache-2.0
  • 4 layers74 × 104 mmBeepy, the printed circuit board in 3D

    Beepy

    sqfmi/beepy-hardware

    Beepy Hardware

    160 parts348MIT

Questions

How big is the Wfield trigger PCB?

It measures 45.7 × 51.6 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Wfield trigger use?

30 parts, built around the BSS138. 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 Wfield trigger KiCad files?

From the jcouto/labcams repository on GitHub, at the commit this page was made from: the board is pcb/wfield_trigger/wfield_trigger.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Wfield trigger design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).