Susan DuncanHannahcrJyan RoynsonMark Greenwood

LED arrays that mimic natural spectral transitions

Our cheap, programmable LED array system mimics dawn and dusk light transitions.

EasyWork in progress744
LED arrays that mimic natural spectral transitions

Things used in this project

Hardware components

unicorn HAT Add-On board for Raspberry pi
Thinkpad T420 14" Notebook Intel Core i5-2520M 8GB 320GB Win 7 Pro - Factory Refurbished
RS Pro Black HDMI to VGA Adapter, Male HDMI to Female VGA
Official Raspberry Pi PSU with UK and Euro Plugs
Raspberry Pi 3 Model B
Raspberry Pi 3 Model B
Toshiba 64 GB Micro SD Card
RS Pro USB Extension Cable Male USB A to Female USB A, 1m USB 2.0
Adafruit GPIO Stacking Header
Retiga LUMO CCD Camera
Panasonic MLR Plant Growth Cabinet
Jumper wires (generic)
Jumper wires (generic)

Software apps and online services



Read more


Bean Shell Script (Bsh_script_for_Lumo_Camera)

import ij.*;
import ij.gui.*;

// parameters to be set each exp
nrFrames = 300; //frames or number of cycles
RootDir = "C:\\Data\\";
ExpName = "Luc_unicornhat_test";

mmc.setProperty("Lumo", "Binning", "4");
mmc.setProperty("Lumo", "CCDTemperatureSetPoint", "-20");
mmc.setProperty("Lumo", "Gain", "1");
mmc.setProperty("Lumo", "ReadoutRate", "0.650195MHz 16bit");

gui.message("Experiment configuration complete"); //Config confirmation

gui.message("Beginning experiment...");
gui.openAcquisition(ExpName, RootDir, nrFrames, 1, 1, 1, true, true);

for (i=0; i < nrFrames; i++) {
	Calendar cal = Calendar.getInstance();
	loopTime = cal.getTime();
	gui.message("Loop " + i + " of " + nrFrames + " at:" + "\n" + loopTime);
	mmc.sleep(3600000); // Interval time (currently 60m)
	gui.message("Pausing before exposure");
	mmc.sleep(300000); //Pause before exposure (currently 5min for luc)

	mmc.setProperty("Lumo", "Exposure", "840000"); // needs to be after setting scanmode
	gui.message("Exposure in progress");
	gui.snapAndAddImage(ExpName, i, 0, 0, 0); 
	mmc.deviceBusy("Lumo"); //Safety call to wait for exposure to finish
	gui.message("Image acquired"); 
	mmc.sleep(60000); //Lag in exposure before lights come on (currently 1min for luc)


Light Cycler Control Script

This script runs through a cycle of light intensities created using a two column CSV file where column 1 is the elapsed time and column 2 is the light intensity required. The script runs through the light cycle continuously using a single 2 column input to give flexibility to scientists using the device.
__author__ = 'Jyan Roynson'

import time
import argparse
import unicornhat as unicorn
parser = argparse.ArgumentParser(description="a script to control the unicornhat lights over time")
parser.add_argument("cycle", action="store", help="a two column CSV file of elapsed times in munutes and the required intensity (between 0.175 and 1.0) ")
args = parser.parse_args()
#create a list of intensities from the input CSF
cyc_list = []
with open(args.cycle) as cycle:
    for line in cycle:
#detect Unicorn hat, set orientation and individual LED colour
for y in range(height):
  for x in range(width):
#cycle through the list of light intensities- number of seconds per cycle \can be changed by editing "time.sleep(1200")
while 1 > 0:
    for item in cyc_list:
        print("Time elapsed: {0} Minutes".format(item.split(",")[0]))


Susan Duncan

Susan Duncan

1 project • 0 followers


0 projects • 0 followers
Jyan Roynson

Jyan Roynson

0 projects • 0 followers
Mark Greenwood

Mark Greenwood

0 projects • 0 followers
Thanks to Donald Fraser and Dr Keara Franklin (University of Bristol).