microscope.controllers.coolled module

CoolLED illumination systems.

class microscope.controllers.coolled.CoolLED(port: str, **kwargs)[source]

Bases: microscope.abc.Controller

CoolLED controller for the individual light devices.


port – port name (Windows) or path to port (everything else) to connect to. For example, /dev/ttyACM0, COM1, or /dev/cuad1.

The individual channels are named A to H and depend on the actual device. The pE-300 have three channels named A, B, and C by increasing order of wavelength of their spectral region. The pE-4000 have four selectable channels named A, B, C, and D with channels E-H for peripheral devices via a pE expansion box.

# Connect to a pE-300 ultra and get the individual lights.
controller = CoolLED('/dev/ttyACM0')
violet = controller.devices['A']
blue = controller.devices['B']
red = controller.devices['C']

# Turn on the violet channel.

CoolLED controllers are often used with a control pod which can select/unselect and turn on/off individual channels. The meaning of these two states are:

  • “selected” and “on”: channel is always emitting light. This is equivalent to being enabled with SOFTWARE trigger type.

  • “selected” and “off”: channel will emit light in receipt of a TTL signal. This is equivalent to being enabled with HIGH trigger type.

  • “unselected” and “off”: channel nevers emit light. This is equivalent to being disabled.

  • “unselected” and “on”: this is not possible. If an “unselected” channel is turned “on” it reverts back to “off”.


If a channel is set with TriggerType.SOFTWARE (“on”) it will start emitting light once enabled (“selected”). Once enabled, even though trigger type is set to software and not hardware, if the channel receives a TTL signal it will switch to TriggerType.HIGH and continue to report being set to software. This seems to be an issue with the CoolLED https://github.com/python-microscope/vendor-issues/issues/9

This was developed with a CoolLED pE-300 ultra but should work with the whole pE-300 series. It should also work with the pE-4000 and the pE expansion box with the exception of loading different sources.

property devices

Map of names to the controlled devices.