This Micro-Manager device adapter was developed by John Wigg and is part of the LaserEngine project by Daniel Schröder at the FSU Jena.
This adapter can be used to switch up to eight laser diodes as well as to linearly control their lasing output power. Version 3 of the LaserEngine has an integrated Arduino together with two MCP4728 Quad-12bit DACs that act as an interface for this Adapter.
An EMU plugin designed to be used with this adapter is available at https://github.com/john-wigg/LaserDiodeDriverUI.
- Known issues
- Prerequisites
- Build instructions
- Arduino setup
- Outputs
- Additional setup (Linux only)
- License
Please install Micro-Manager 2.0.0 or above. This device-adapter is not compatible with version 1.4.
Microsoft Windows:
On Windows, please install the latest Visual C++ Redistributable from here Visual Studio 2015, 2017, 2019, and 2022.
The Arduino IDE is only necessary to upload the Arduino program on the first time.
Microsoft Windows:
Debian & Derivates:
apt-get install arduino
Archlinux:
pacman -Sy arduino
You can find pre-built binaries on the github repository here.
After installing the binaries, please proceed at "Arduino setup".
Alternatively, you can build your device adapter from the sources.
CMake is used as the build system for this device adapter. Below is a breakdown of the build process. It is assumed that Micro-Manager is already installed on your Linux or Windows machine.
- Clone this respository with updated submodules to a directory:
git clone --recurse-submodules --remote-submodules https://github.com/john-wigg/LaserDiodeDriver
This will download the device adapter source as well as the latest mmCoreAndDevices source which is needed for compilation.
- Open the LaserDiodeDriver source directory you just cloned:
cd LaserDiodeDriver
- Create a build directory and enter it:
mkdir build
cd build
- Generate the build files and specify the source directory of the Micro-Manager core:
cmake ..
(If you did not clone the repository recursively and want to supply your own version of mmCoreAndDevices, you can specify the path to the directory using cmake .. -DMMROOT=path/to/mmCoreAndDevices.)
- Run the build:
cmake --build .
- Rename the generated shared library:
mv libmmgr_dal_LaserDiodeDriver.so libmmgr_dal_LaserDiodeDriver.so.0
Note: Skip this step for windows builds.
- Copy the shared library to the installation directory of Micro-Manager/ImageJ (may require root permissions):
cp libmmgr_dal_LaserDiodeDriver.so.0 /path/to/ImageJ
Note: On Windows, the expected file extension is .dll instead of .so.0.
- Run Micro-Manager and create a new hardware configuration with the
LaserDiodeDriverdevice adapter.
-
For initialising the setup, connect the
LDACpin of one MCP4728 to theD2pin. To do so, the LaserEngine v3 has a jumper switch included on the breadboard, that just needs to be set on. -
Install the Adafruit_MCP4728 library. This can be done directly from the Arduino IDE under
Tools > Manage Libraries.... Make sure you install the library by Adafruit.
-
Download the arduino_sketches/Setup directory and upload the
Setup.inosketch to your Arduino using the Arduino IDE. This will set the address of the MCP4728 which has itsLDACpin connected to the Arduino (pink wire) to0x61so it can be controlled individually. -
If the setup sketch has executed successfully, you may remove the jumper switch (v3) or pink wire (v2) connecting the
LDACpin to the Arduino. -
Download the arduino_sketches/Program directory and upload the
Program.inosketch to your Arduino. -
The Arduino is now successfully programmed to communicate with this Micro-Manager device adapter.
-
In Micro-Manager, open Devices -> Hardware Configuration Wizard and at LaserDiodeDriver, choose "Arduino" as Device Type.
If you want to use the LaserEngine without the need for sudo, add your user to the uucp group:
usermod -a -G uucp user
After successfully installing this device adapter, it is highly recommended to install the EMU plugin for an easy-to-use graphical interface.
Please contact us for feedback or open an issue on github if you experience some difficulties.
Apart from the above preferred interface method, two more options are available.
The following instruction will walk you through the process of building the setup on a breadboard and configuring the Arduino. The examples assume that you are using an Arduino Nano 33 BLE, however, other boards with 3.3V digital outputs should work as well. 5V output boards are not supported.
-
Connect the
SDAandSCLpins of the two MCP4728s to the corresponding pins of the Arduino (A4andA5, respectively on the Arduino Nano). Connect theVCCpins to the3Vpin of the Arduino and tie allGNDpins together. -
The complete Fritzing diagram is shown below:
- Proceed with the above "Arduino setup" to program the DACs adresses and to install the program.
In Micro-Manager, the digital outputs are numbered 1 to 8.
On the Arduino Nano 33 BLE, these will be D3 to D10, in ascending order.
In Micro-Manager, the analog and digital outputs are numbered 1 to 8, which corresponds to the outputs on the LaserEngine Diodes.
On the MCP4728s, these will be the analog outputs A to D, whereas the MCP4728 with address 0x60 (the one closer to the Arduino in the figure above) will correspond to the outputs 1 to 4 and the other MCP4728 will correspond to the outputs 5 to 8.
Moreover, the adapter can also communicate with the Velleman k8061 interface board by using the comedi library to communicate with the Velleman K8061. Due to the availability of the comedi library, this method is only supported on Linux OSes.
- The comedi library is required to run the Velleman K8061 board on Linux. It can be installed with
sudo apt-get install libcomedi-dev
- If you want to use the adapter without the need for sudo, add a .rules file with the following content to /etc/udev/rules.d/:
KERNEL=="comedi0", MODE="0666"
-
After installing the device adapter (see section "Install Micro-Manager device adapter"), open Devices -> Hardware Configuration Wizard and at LaserDiodeDriver, choose "K8061" as Device Type.
-
Save the configuration.
-
You should now be all set to use the k8061 analog and digital outputs 1-8 as an interface to control your laser drivers.
This project is licensed under the MIT license.
Exempt from this is the Setup.ino sketch which uses the SoftI2cMaster library and is licensed under the GNU GPLv3.
The Setup.ino sketch has been originally created by Jan Knipper (https://github.com/jknipper/mcp4728_program_address) and is used with the author's permission.
This project uses the serial library which is available under the MIT license.

