Susan DuncanHannahcrJyan RoynsonMark Greenwood
Published

LED arrays that mimic natural spectral transitions

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

BeginnerWork in progress1,582
LED arrays that mimic natural spectral transitions

Things used in this project

Hardware components

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

Software apps and online services

Micro-Manager
fritzing

Story

Read more

Code

Bean Shell Script (Bsh_script_for_Lumo_Camera)

Java
import ij.*;
import ij.gui.*;
gui.closeAllAcquisitions();

// 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.clearMessageWindow();
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)
	
}

gui.closeAcquisition(acqName);

Light Cycler Control Script

Python
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:
        cyc_list.append(line.strip())
#detect Unicorn hat, set orientation and individual LED colour
unicorn.set_layout(unicorn.HAT)
unicorn.rotation(0)
width,height=unicorn.get_shape()
for y in range(height):
  for x in range(width):
    unicorn.set_pixel(x,y,255,255,255)
#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]))
        unicorn.brightness(float(item.split(",")[1]))
        unicorn.show()
        time.sleep(1200)

Credits

Susan Duncan

Susan Duncan

1 project • 0 followers
Hannahcr

Hannahcr

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).

Comments