DCN LED controller

From biophysics
Revision as of 12:30, 24 January 2024 by Lof (talk | contribs) (→‎Matlab code)
Jump to navigation Jump to search
DCN-LED controller
DCN-LED controller inside

Description

The DCN-LED controller is a 16 channel two color led controller with an Ethernet interface. The controller is developed in house by our Technical Support Group. The controller is based on an Arduino Mega for the control of the LED output channels and a Raspberry Pi for the Ethernet communication. A pair of Matlab functions is available for the programming of the controller.

Specifications

  • Arduino Mega
  • Arduino software: Standard_32_LEDModule_V1.16.ino
  • Response time to trigger < 200 micro sec
  • Raspberry Pi 3 or 4
  • Raspberry Software: %todo
  • External 5V Raspberry power supply
  • 16 mini jack connectors for LEDs
  • Test buttons for Red and Green LEDs
  • BNC connector for input trigger
  • Ethernet connector for communication with the Raspberry Pi
  • The LEDs that are used in all the labs are Bivar 5BC-3-CA-F LED.

Matlab code

In the biofysica toolbox in Gitlab (see led code) there are two functions for controlling the DCN-LED controller:

  • ledcontroller_pi.m
  • ledpatter.m

The files starting with <ex_led> are examples for how to use the functions.

Here is an example:

n = 8;
s = ledpattern(n);
for i=1:2:n
   s(i).set(0:2:127,'r');
   s(i).set(1:2:127,'g');
   s(i).intensity('r', i);
   s(i).intensity('g', n+1-i);
end
leds = ledcontroller;
leds.write(s);