This year’s hardware project dealt with creating a lightbox for optogenetic experiments, which is inexpensive to build and easy to use. Lightboxes are an important part of every lab that deals with the growing field of optogenetics, due to the fact that experiments in this field require light of specific wavelengths and are very easily disrupted by background lighting. This would normally mean that the experiment would need to be conducted in a completely dark lab, which can be difficult to achieve and may render the room practically useless for other experiments. A lightbox provides a compact way of creating a suitable environment. Unfortunately, buying such a box can be expensive, as it needs to be custom-built. We wanted to create a way of supplying future iGEM teams or other research groups with a relatively easy way of constructing their own box. Since we had planned on using optogenetics in parts of our overall project, the lightbox we built also came in handy for us.

Construction of the box

Building our box requires a small amount of work with electronics, as well as a bit of programming. Below we provide a sketch of the set-up, a brief description of the overall box and then an instruction manual to building the box yourself.

Figure 1: Schematic view of our lightbox's 3D-printable files (the lengths indicated on the axes are in millimeters)

Our lightbox consists of a 3D-printed casing, a circuit board with LEDs, a slot for inserting your samples, and a compartment for electronics and wiring. Our box is suited for insertion of either a well-plate or a petri dish.
Other lightboxes we looked at came in two parts: a basin for the sample and a lid with LEDs. Our tray mechanism enables construction of a more compact box and relieves stress on wires.


We used three different wavelengths for our box: 460 nm (blue), 660 nm (red), and 780 nm (far-red). These cover the domains of frequently used optogenetic switches, such as LOV2, Phytochrome B or Cryptochrome. In theory, the box’s repertoire of wavelengths can be quite variable. We got our LEDs and constant current sources from Led-tech. To control our box, we used a micropython, which functions much like an Arduino but is programmable via Python. Depending on one’s preference, an Arduino or Raspberry Pi could also be used here. The power source may be anything providing a voltage of at least 12V. In fact, we used old computer power supply; recycling can be a great thing!
An important aspect we wanted to include in our construction work is the use of 3D printers. These are a growing tool which provides people with the opportunity to create objects in silico and then make them in real life. While not absolutely necessary to build our box, having access to a 3D-printer will certainly help.

Construction of the box

Instruction manual

You will need:

  1. 1 Circuit board (150mm x 100mm)
  2. 1 microcontroller (micropython, Arduino or Raspberry Pi)
  3. 3 constant current power supplies
  4. 3 blue LEDs
  5. 3 red LEDs
  6. 3 red LEDs
  7. 3 far-red LEDs
  8. Heat-conducting pads
  9. Soldering iron
  10. Solder
  11. Wire
  12. A multimeter capable of measuring voltage as well as current
  13. A 3D-printer or something similar
  14. A power supply that can provide a voltage of 12V (the easiest thing to use is an old computer power supply: you need the yellow (12V), red (5V) and black(neutral) wires; BE CAREFUL TO ALWAYS GROUND YOUR POWER SUPPLY AND DO NOT LEAVE ANY UNCONNECTED WIRES LYING AROUND)

1). Print or fabricate the casing

We have provided 3D-printable files for our version of the lightbox. If you don’t have a printer at your university you might find places near you which offer 3D-printing services.

2). Assemble circuit board for LEDs

i) Attach the LEDs to the circuit board using the heat conductive pads, for example like so:

Figure 2: Schematic overview of LED assembly on the circuit board.

ii) Connect LEDs of same color using wire and the soldering iron.

iii) Make sure that you have wires connected to the overall + and - poles of each wavelength. These will later be attached to the power source.

3.) Adjust and connect power source

Connect your 12V power supply to the input sides of the constant current supplies:

Figure 3: Picture of the constant-current source we used. Modified from here, October 31th 2017.

It is possible to use one 12V cable for all 3, as long as you split it in a safe way (for example using clamps). Next, you need to adjust the voltage applied to and current flowing through the LEDs. According to their specs, each LED can tolerate a current of up to 1A. However, because driving them at this level produces considerable amounts of heat and because one does not require very high light intensity for optogenetic experiments, we decided to cap the current at 200 mA. You can do this by adjusting the knob labeled "CC" on the constant current supply while measuring the current with your multimeter.
There is also a knob labeled "CV", which is used to adjust the voltage applied to the LEDs. Depending on the LED type, you need to adjust this differently. In case of our configuration, the three blue LEDs need 9.6V, the red ones need 6.6V and the far-red ones need 5.5V. You can find the voltages needed in the data sheet of each LED.

4.) Connect microcontroller

The constant current sources each contain a pwm-input pin. These can be thought of as on/off switches: if a voltage is applied to the pin, it stops current from flowing through the LEDs, thereby turning them off. Otherwise the LEDs work unimpeded. This property can be used for controlling the lightbox.Using wires, connect your microcontroller to the pins according to the following scheme:

Figure 4. Modified from, October 30th 2017.

Programming the lightbox

Once the hardware is assembled, you need to be able to control your lightbox. This is done via the aforementioned microcontroller. It is responsible for turning the LEDs on or off, regulating their intensity via a process called pulse width modulation (PWM), and adjusting the time of illumination. Below we have provided the code needed for the most basic control.

import machine
import time
import pyb
import math

# create I/O pins in output mode
o1 = pyb.Pin('Y1', pyb.Pin.OUT)
o2 = pyb.Pin('Y2', pyb.Pin.OUT)
o3 = pyb.Pin('Y3', pyb.Pin.OUT)

# Control LEDs

What this program does is activate the pins Y1, Y2 and Y3. This leads to switching-off of each constant current source. So in this configuration, all LEDs are switched off. If you set a pin to 'LOW' via the command "o1.low()"(this example is for the pin o1; for the others, you would use the commands "o2.low() and "o3.low()"), the corresponding LEDs will light up. This way you can choose the wavelength for your experiment!
You can also adjust the intensity of the LEDs by having them blink at a chosen frequency, and input a delay after which the illumination starts. This is especially useful if you want to time your experiment to a specific status of your culture which may be in the middle of the night. The code below causes the blue LEDs to blink with a frequency of 2 times per second after waiting 1 hour:

import machine
import time
import pyb
import math

# configure Pins
o1 = pyb.Pin('Y1', pyb.Pin.OUT)
o2 = pyb.Pin('Y2', pyb.Pin.OUT)
o3 = pyb.Pin('Y3', pyb.Pin.OUT)

#define functions
def function(rate):
	return 0

#define variables
x = 0
time=3600000 #This defines, how many milliseconds you want to wait until the start of your experiment (in this case the time is set to 1 hour)
rate = 500  #This defines, how many milliseconds the microcontroller waits between toggling the LED

# Control LEDs
while True:


By adjusting the programs provided here, you can customize your box to suit your needs.

Starting your experiments

When starting your experiments, you need to ensure that the tray slot is sealed by some form of opaque material. This needs to be done, because no light other than that provided by the LEDs should be able to illuminate your sample.


We have provided a way of quickly assembling an affordable lightbox which can be used for various optogenetic experiments. The design focuses primarily on functionality. It is our hope that future iGEM-teams will benefit from this manual and be able to further grow the exciting field of optogenetics.