The pyPhotometry acquisition board uses a Micropython microcontroller to acquire two digital and two analog signals, and to generate analog control signals for two built in LED driver circuits. The acquisition board draws power from the Micropython's USB connector and requires no additional power supply.
To prevent short circuits due to contact with metal objects, the board should be securely mounted using M3 bolts and insulating spacers. The mounting holes on the acquisition board have a 50 x 75mm spacing so the board can be mounted directly on a Thorlabs metric optical breadboard using M6 to M3 thread adaptors.
Though the LED drivers are relatively low power, care should be taken to avoid shining light directly into the eye. This is particularly important with LEDs whose wavelength lies outside the visible spectrum.
The two BNC analog inputs
SIGNAL 1 and
SIGNAL 2 receive fluorescence signals as analog voltages from the photodetectors. The signals pass through an RC lowpass filter with a cuttoff frequency of 10KHz and then are read by the Micropython board's analog to digital converters (ADCs). The Micropython ADCs have a 0 - 3.3V input range. As the ADC pins are not 5V tolerant, clamp diodes to the 3.3V rail are used to prevent damage if the signal rises above 3.3V. Oversampling is used to increace the 12-bit resolution of the ADCs to 15 bits - i.e. to generate each sample the ADC is read 64 times and averaged, giving an extra 3 bits of resolution.
The two BNC digital inputs are compatible with 5V or 3.3V logic and are typically used to acquire sync pulses or timestamps, e.g. generated by behavioural hardware. The digital inputs connect directly to pins on the microcontroller.
The aquisition board has two constant current LED driver circuits which are controlled by the Micropython's digtal to analog converters (DACs), allowing the LED current to be adjusted between 0 - 100mA. The LED driver outputs are M8 connectors that are compatible with either Doric or Thor Labs connectorized LEDs.
The LED driver circuits are voltage controlled current sinks in which an op amp adjusts the voltage at an MOSFET's gate to bring the voltage across a sense resistor in series with the LED into agreement with the control voltage from the microcontroller. A resistor between the 3.3V rail and the inverting input of the op amp ensures the MOSFET is fully turned off when the control voltage is 0. The LED current can be monitored by measuring the voltage between the SENSE1 or SENSE2 and GND connections on the acquisition board, which gives the voltage across the 4.7 ohm sense resistors in series with the respective LEDs.
The acquisition board can be purchased from the Open Ephys store for €350 or built from components. The design files for the acquitition board are in the hardware repository. To assemble the board from components you will need to get the PCB printed (using either the Gerber or Eagle files) and order the electronic components listed in the BOM (Farnell part numbers are provided).
Assembling the acquisition board requires both surface mount and through hole soldering. The surface mount soldering can be done either using a reflow oven or hand soldering. Hand soldering of surface mount components requires a bit of practice but there are lots of tutorials online. Solder all the surface mount components before soldering the through hole components as once the through hole components are in place they will get in the way. The micropython board is attached to the acqusition board using the male and female 16 way headers. First solder the female headers onto the micropython board, then insert the male headers into the female headers, mount the micropython on the acquisition board and solder the male headers.
To make a complete photometetry system the acquisition board needs to be paired with LEDs, photorecievers, and optical components. The optical setup detailed in the original manuscript used a Doric minicube with seperate LEDs and photodetectors connected through optic fibers. Since the manuscript was published Doric have introduced minicubes with integrated LEDs and Photodetectors. We have not tested these ourselves but they look like a simpler and more convenient solution which likely gives better signal quality. Parts lists are provided for both options in the resources sections of the docs.
If you plan to use a different optical setup, make sure that the photoreceivers have a bandwidth of at least 0-750 Hz and output voltage compatible with the 0-3.3V range measured by the pyboard DACs.
The optical components for the original red/green system are positioned and connected as indicated below:
To assemble the system:
Attach the minicube to the optical breadboard using the clamp (CL3/M) and 45mm M6 bolts.
Attach the acquisition board to the breadboard using the M6-M3 screw adaptors, M3 spacers and 10mm M3 screws. Screw the adaptors into the breadboard, then attach the acquisition board with the spacers between the board and the adaptors.
Attach the Newport photorecievers to the breadboard using the pillars (TRP14/M), clamping forks (MSC2) and 12mm M6 bolts.
Attach the LEDs to the breadboard using the 12mm M6 bolts.
Connect the photorecievers to the minicube using the 30cm, 600um core 0.48NA optic fibers (MFP_600/630/LWMJ-0.48_0.3m_FCM-FCM)
Connect the LEDs to the minicube using the 30cm, 200um core 0.48NA optic fibers (MFP_200/220/LWMJ-0.48_0.3m_FCM-FCM)
Connect the photorecivers to the acquisition board analog inputs using the 30cm BNC cables.
Connect the LEDs to the acquisition board LED outputs using their built in cables. It is not necessary to connect the power supplies for the LED cooling fans as the maximum current output by the acquisition board is only 10% of the LEDs rated current.
Connect the pigtailed rotary joint to the sample port of the minicube and connect the fiber patchcord to the rotary joint using the FC-FC adapter.
Modifying the pyPhotometry board for higher LED current
The LED drivers on the standard pyPhotometry board can output up to 100mA currents. While this is fine for many applications, higher LED currently may be preferable in some cases - e.g. with constructs that need higher light intensities or use wavelengths where only less efficient LEDs are available.
We plan to release a version of the board with higher maximum LED current, but have also looked into the possibility of increasing the maximum LED current that can be output from the standard board. With a simple modification to the board - changing one resistor value per LED driver, it is possible to increase the maximum current that can be used in the time-division illumination modes up to 400mA. Modifiying the board risks damaging it and is done entierly at users risk.
The schematic of the LED driver circuit is shown below. The current through the LED is controlled by the MOSFET (labled Q1), whose reistance is determined by the voltage applied to its gate by the opamp (IC1). The opamp adjusts the gate voltage, and hence LED current, to bring the voltage across the sense resistor (R5) into agreement with the voltage at the + input to the opamp, which is controlled by the pyboard DAC (connected to wire CTRL1).
The upshot of this is that the LED current is proportional to the control voltage output by the pyboard DAC, with a slope determined by the value of the sense resistor R5. If you halve the value of the sense resistor R5, the LED current for a given control voltage will be doubled.
The maximum current that can safely be output is limited by power dissipation in the MOSFET and sense resistor. LEDs typically have a forward voltage of 1.8-3.3V depending on the LED wavelength and current. The supply voltage is 5V, and the remaining voltage drop will occur across the MOSFET and sense resistor, dissipating power as heat. Higher LED currents result in more power dissipation and hence more heating, putting an upper limit on the current that can be delivered without damaging these components.
This is approximagely 200mA continuous current, but will depend a bit on the exact LED used, so limiting max currents to 100mA is recomended in continous mode. However, in the time division illumination modes, each LED is only on for a small fraction of the time, hence both average current and power dissipation are much lower, and higher LED on currents are possible - we suggest 400mA as an upper limit.
To modify the system to use higher currents you would need to replace the 4.7Ω sense resistors R5 and R6 (for LEDs 1 and 2 respectively), circled in yellow on the diagram below with a 1.2Ω 0805 package resistor, e.g. Farnell part number 1717800.
Changing the resistor values from 4.7 to 1.2Ω without modifying the code will result in the actual LED currents being 3.9x higher than those specified in the GUI and data files.
To modify the code so that the LED currents are specified correctly, you would need to change the slope of the
LED_calibration variable defined at line 16 in upy/photometry_upy.py from its default value of 38.15 to 9.78. You also need to modify the maxium LED current that can be set in the GUI from the default 100mA to 400mA, by changing lines 119 and 120 in GUI/GUI_main.py where the range of the current controls is set. These changes should be done on the latest version of the code currently on github, as earlier versions (including the last official release v0.3), use a single byte to send LED current commands to the board during acqusition so can't handle LED current values above 256mA.
Ideally the code should be modified to only allow currents above 100mA to be used in time-division but not continuous mode. This is beyond the scope of this document, but something we plan to implement in a future release.