OptoGenie: an open-source device for the optogenetic stimulation of cells

Optogenetics has revolutionised research in cell biology over the past 15 years, yet devices that can effectively stimulate cells using light are often costly and specifically designed for a single experimental set-up with little flexibility. Our novel ‘OptoGenie’ stimulation device can be conveniently transferred between cell culture incubators for long-term stimulation, electrophysiology rigs for patch-clamp recordings, and optical microscopes for fluorescence imaging of cells. The modular design of the device offers portability between these experimental set-ups, is low cost compared with commercial devices, and provides easy adjustment of the stimulation intensity and frequency. OptoGenie provides an open-source model made from proprietary parts such that researchers without experience with electronics and coding can easily purchase, assemble and customise for their experimental needs.


INTRODUCTION
The term 'optogenetics' was coined to describe the ability to stimulate neurons using light by genetically expressing light-activatable ion channels (Zemelman et al., 2002(Zemelman et al., , 2003Banghart et al., 2004;Lima and Miesenböck, 2005). Boyden et al., (2005) were first to demonstrate the excitation of neurons with millisecond precision that made the method highly practical for research in the neurosciences (for review see Boyden, 2011). Since then, optogenetics has become a key tool that is used both in vitro and in vivo to noninvasively excite or inhibit neurons that express light-sensitive ion channels. Currently, multiple wavelengths of light can be used to activate a diverse number of designer protein channels with different permeability and gating dynamics (Nagel et al., 2002(Nagel et al., , 2003Govorunova et al., 2015). Optogenetics using channelrhodopsin-2 (ChR2) works by incorporating these 7-transmembrane ionotropic proteins into the membrane of cells such that they can be activated by blue light to allow nonspecific cation permeability. The light-activation induces photoisomerisation of all-trans retinal into its contracted cis configuration, thereby increasing the channel size to ~6 Å in diameter to allow ion entry (Nagel et al., 2003). The characteristics of ChR2 can be seen in Table 1. Several further generations of ChR2 have also been developed that have improved channel dynamics, such as faster gating closure time than the ~13 ms of ChR2 that limits the rate of stimulation frequency that can be used (for review see Lin, 2011). The spatiotemporal precision with which channelrhodopsins can be stimulated, and show a response, as compared with chemical and extracellular electrodes makes them highly popular for use in the neurosciences.
There are several main limitations of optogenetic methods. First, the expression of the lightinducible protein channels by target cells must be achieved and can be variable between replicates. Once reliable expression of the channels occurs, there is often limited access to a flexible experimental set-up to achieve the full capabilities of these optogenetic models (Gunaydin et al., 2010). The ability to activate these proteins requires specialist equipment that is often designed for a specific experimental set-up, and thus less flexible for multiple protocols or transfer between set-ups. We therefore designed a novel device that can be assembled by researchers without an expertise in engineering and that can be used for a wide variety of experimental methods. The device was specifically designed based on our experimental requirements for an optogenetic stimulation device using 480 nm wavelength of light to activate ChR2-expressing cells in an area on the order of a few millimetres squared. The pulses of light were required to be 10-30 ms in length, which has been shown to be the optimal channel activation length (Erofeev et al., 2019).
To demonstrate these design aims, we tested the device on experimental set-ups in which temporally precise neuronal stimulation using optogenetics is commonly required. For our experimental needs, the device needed to be portable to stimulate the cells on a patch-clamp rig to calibrate the light stimulation intensity required for each set of cells, dependent on the variability of ChR2 expression between replicates ( Figure 1A). The device then needed to be transported to the inside of an incubator for several hours of stimulation to determine the long-

CLOSING RATE τ C [ms]
Channelrhodopsin-2~470~1.10 ~2.1 (9.7 mW/mm 2 )~1 3.4 ± 1.1 (for 10 ms pulse) Table 1 The properties and kinetics of channelrhodopsin-2. Adapted from: Lin et al. (2009). term effects of the stimulation on cells (Figure 1B). It would then be moved to a microscope for imaging stimulation-dependent cellular mechanisms (Figure 1C), or transferred back to a patch-clamp rig to record neuronal activity following long-term stimulation.
Due to the broad range of experiments, OptoGenie is designed for flexibility of stimulation between multiple experimental systems whilst reliably maintaining high temporal and spatial activation precision. The temporal precision of the device is limited by the Arduino Uno microcontroller, which has a precision of 4 µs (Arduino.cc), which is significantly faster than the channelrhodopsin-2 response time ( Table 1). The spatial precision of the device is controlled with the adjustable iris to determine the spot size with millimetre squared precision. The OptoGenie's output intensity can be calibrated on an electrophysiology rig to measure the required intensity for cell stimulation before transferring the device to alternative set-ups. This is important to be determined for each model used, as variation in ChR2 expression will arise between different transgenic lines, virally infected cells, and within different culture preparations of the same model. Differences in ChR2-expression will affect sensitivities to light stimulation. Although stimulating at the maximum intensity for each preparation is possible, this could result in toxicity when using long-term stimulation protocols. Therefore, as a first step it may be necessary to record the response to increasing light intensities until the optimal activating intensity is found, which should be the lowest intensity that can reproducibly activate cells so as to reduce toxicity. Once the intensity and stimulation pattern parameters are validated, the programmed Arduino makes the device highly portable between experimental set-ups. The ability to quickly change the excitation angle of the laser, spot size, stimulation frequency, and intensity of the light make OptoGenie easy to position onto a patch-clamp rig in any available space in the set-up.
Experiments on the order of hours, such as during long-term drug treatments, may require stimulation to occur within a maintained environment where humidity, temperature and partial pressures of gases do not perturb the cell physiology. These factors themselves can alter the electrophysiological properties of neurons and therefore, if not tightly controlled, can add variables to the experiment. For many commercial designs it is not convenient to transfer cells into and out of incubators whilst maintaining stimulation as required. This was therefore a primary consideration for the design of OptoGenie that the device could be easily sterilised, placed onto a shelf and powered using a battery inside of a closed incubator. The cube shaped design measuring 112.5 cm 3 easily fits onto a standard incubator shelf.
In addition to incubation, many experiments looking at activity-dependent mechanisms will combine excitation with optical microscopy to detect fluorescent markers. This device can be temporarily fixed onto any inverted optical microscope for simultaneous stimulation and Figure 1 The OptoGenie device was designed to be versatile such that it could be transferred between multiple experimental systems. The device was fixed to a patch-clamp electrophysiology rig (A) to test the required light intensity for stimulation. The device can then easily be moved to an incubator (B) for the long-term stimulation of neurons before being moved back to record the response of neurons (A) or to a microscope for imaging (C). Created with Biorender.com.
imaging. This may be of use for combining neuronal excitation with calcium imaging, tracking of vesicles or proteins, or fluorescence lifetime measurements of protein aggregation (Renault et al., 2015;Duan et al., 2015;Michel et al., 2014). The modular design allows the support stand to be removed and the laser mounting cage (Figure 2A) to be positioned on the microscope as desired, which then only occupies 64 cm 2 of bench space and weighs only 0.3 kg.
Although there are dedicated optogenetics experimental set-ups available, such as using 2 photon microscopy, these do not offer portability, adaptability of activation area and frequency, and low cost within one device. Other commercial and custom-designed devices exist, though many of these are aimed at in vivo studies (Iwai et al., 2011;Cao et al., 2013;Neurophotometrics Ltd.), use multi-LED arrays and are therefore less tailored to stimulating a specific population of cells (Lee et al., 2016;Green Leaf Scientific), or involve expensive and highly engineered solutions (Clements et al., 2016). Many laboratories therefore design their own stimulation device specifically for each experiment, which often requires electronics expertise, prototyping costs, and additional time to design and characterise each device. We therefore designed a device, the OptoGenie, to achieve 3 key objectives: (1) accessibility: inexpensive and easy to assemble by researchers across all disciples to build from commercially available components, including many that are common to laser laboratories. Although our experiments involved patch-clamp recordings and other specialist equipment, we appreciate that this is not easily available to the general researcher. We therefore suggest alternatives in the 'Availability of materials and methods' section(2) portability: flexible to use between incubators, electrophysiology rigs and optical microscopes such that the device can be passed between collaborators and experiments in multiple departments (3) adaptability: accommodating to researchers' needs so that a choice of laser wavelengths, stimulation area or stimulation frequency can be used. These objectives have shown to be successful in our previous project to create a custom-made open source OPT microscope (Vallejo Ramirez et al., 2019).

Figure 2 The OptoGenie device. A:
The schematic of the OptoGenie device including the laser diode controlled by a variable resistor and Arduino Uno for setting intensity and stimulation frequencies. The system is highly portable due to its compact and simple design (not to scale). B: The assembled OptoGenie device mounted onto a small breadboard so it can be placed on a flat desktop or inside of a cell incubator.

OVERALL IMPLEMENTATION AND DESIGN
To achieve the three key aims of accessibility, portability, and adaptability, a simple and modular design was used.
The OptoGenie device ( Figure 2B) is assembled from three main modules. The electronics controls the frequency and power of the laser diode, the laser mounting cage further collimates the light and adjusts the aperture to select a spot size. The support stage balances the laser and the sample can be placed under the laser spot (Figure 2A; see also Figure 3A). For the control unit an Arduino Uno microcontroller is used as an accessible electronic prototyping platform featuring low cost, and wide availability, and the Arduino integrated development environment (IDE) providing an open source, easily downloadable and shareable resource for collaborators. The Arduino IDE is used to control the pulse width and stimulation rate of the laser diode, allowing the stimulation protocol to be easily varied for each experiment. The Arduino powers the laser diode either via mains power supply or a 9 V battery adaptor. The diode can be powered by a battery for use in the cell culture incubator in cases where cables that reach between the device and mains power supply could be inconvenient or interfere with incubator sterility. A variable resistor allows control of the power, such that the output intensity can be measured and adjusted per experiment, depending on the requirements. For the laser component, a single plano convex lens is used to collimate the laser light keeping the beam size approximately constant over a 5 m distance. The electronics and optical components are held in place by proprietary adaptor posts and clamps, that can be purchased or replaced with any standard size posts and clamps that may already be available to the researcher. These adaptor posts add to the flexibility and portability of the system as the mounting of the posts can be used to alter the distance and angle of the laser component to the cells. Alternatively, the laser component can be removed entirely by detaching it from the adaptor post by using the rightangle clamp to reassemble on an alternative experimental set-up such as an incubator ( Figure   1B) or microscope ( Figure 1C).
With the inclusion of all of the components required for the electronics, support stage and laser mounting cage, the device costs ~£480. Alongside the low cost, the size of the device is small, measuring 112.5 mm 3 and weighing 0.7 kg, which helps make it highly portable.

Assembly of the modular OptoGenie design
The three components of the OptoGenie, the electronics board, the laser mounting cage, and if required, the support stage, can be assembled individually before being combined to the final device. The core body comprises of the laser diode and its associated electronics, optical elements (a collimating lens and iris), and a construction cage for housing all the components (Figure 3). The use of a laser mounting cage keeps the system compact while maintaining rigidity and optical alignment during use, transport, and storage of the device. The OptoGenie can then be attached to another experimental set-up via a half-an-inch post and a right-angle clamp. Alternatively, if the device needs to be balanced on a flat surface, the OptoGenie can be affixed to a small breadboard (as in Figure 3A) e.g. to house a 96-well plate block, and securely store the whole unit inside of a cell incubator.
Part of the reason why the OptoGenie is transferable between instruments is the monolithic circuit board with a small footprint of 38 x 38 mm, that houses the electronics and the laser diode. 3.1 mm holes in each corner to integrate with the 30 mm Thorlabs cage system used for standard optics mounting ( Figure 4A). A level of electronics proficiency is required to replicate the device, which may make it less accessible to some researchers. To ameliorate this, the print-circuit board design files ( Figure 4A; https://github.com/OptoGenie/v1.0) can be uploaded to an automated PCB manufacturer (such as JCLPCB) for production, surface mount assembly of the components, and drilled holes for mounting. The added advantage of this is that multiple copies are often provided so that backups and duplicates of the device can be made. Upon receiving the PCBs, the final basic steps of insertion and soldering of the laser diode, and connecting wires to the Arduino and potentiometer are needed to complete the device ( Figure 4B).
In summary, the PCB has two inter-connected circuits the first of which powers and sets the brightness of the laser diode, while the second part controls the on-off-state of the laser via the Arduino. In the former part, the supplied current range to the diode is achieved using an array of 100 Ω resistors (in parallel to improve heat dissipation), set in series with a 100 Ω rotary potentiometer to set the emitted optical power. Laser light pulses are controlled by a MOSFET that is gated by a digital pin of an Arduino in the form of a pulse-width-modulated signal greater than 4.6 V. ). This design is used by PCB manufacture companies to produce a copy along with the surface mounted components that are pre-soldered. B: The custom-made board with the centre mounted laser diode and connecting wires to the Arduino and potentiometer. The laser diode is mounted on a small board with 3.1 mm holes that are separated by 30 mm to interface with the cage mount system (Thorlabs Inc.). C: Electronics diagram for powering and controlling the laser diode. Junctions J1-J3 correspond to the three terminals of the potentiometer, whilst J4-J6 are the power pin (5-9 V), PWM (pulse-widthmodulation) digital pin from Arduino, and GND (ground), respectively. The current across the diode is varied using a variable resistor to set the emitted laser power.
Once the associated electrics of the diode is complete, the board needs mounting onto cage rods (ER2, Thorlabs Inc.) using the pre-drilled holes at the corners of the PCB. This allows any custom optics to make use of the emitted light. For OptoGenie, the laser diode is collimated by an aspheric plano-convex lens with a focal length (f) of 4.51 mm (C230TME-A, Thorlabs Inc.). The manufacture specified Gaussian-like beam divergence of the laser diode is 6.5° and 22.5° FWHM (full-width-half-maximum defined at λ = 450 nm). This meant that the collimated beam size was elliptically-shaped with minor-and major-axis dimensions (d FWHM = 2f tan [ϕ]) of FWHM x = 1.0 mm and FWHM y = 3.7 mm, respectively. The corresponding Gaussian beam waists are w 0,y = 1.0/1.177 = 0.85 mm and w 0,y = 3.7/1.177 = 3.2 mm (using 2 0 2 2 FWHM ln w  . As such, the aperture (element 7 of Figure 3B) is set to approximately 6 mm (2w 0,y ) to block stray light.
The Rayleigh length (Z R ) of the collimated beam is limited by the diffraction in the x-direction, Hence, if the distance between the laser diode and the sample does not exceed 5 m, the beam is effectively considered the same size. In the experiments described here, the separation distance will typically be well below 1 m. The peak intensity for an elliptical gaussian beam is I 0 = 2P/(πw 0,x w 0,y ). The power was measured to be 5-9 mW, resulting in an intensity at the centre of the beam of approximately 1.2-2.1 mW/mm 2 . This value exceeds the light sensitivity/EC 50 of Channelrhodopsin-2 by more than a factor two (see Table 1), confirming its suitability for optogenetics experiments.
Once the laser diode electronics have been mounted to the board, 30 mm cage posts are screwed to the hole in each corner of the electronics board. The lens is screwed into a 30 mm XY translation cage (CXY1, Thorlabs Inc.) using a lens to cage adapter (S1TM09, Thorlabs Inc.; see Figure 3). The XY cage is then translated along the 30 mm cage posts until the lens is ~4.51 mm from the diode. The laser should then be turned on at low power to test whether the light is collimated. This can be determined by measuring if the size of a light spot remains constant over a few metres, for instance by projecting it onto a wall. Once the beam is collimated, the XY cage should be screwed securely to this position by tightening the inbuilt screws. The lens can be centred using the XY thumb screws on translator cage. Finally, an adjustable aperture (SM1D12, Thorlabs Inc.) is attached to a threaded standard cage plate (CP33/M, Thorlabs Inc.) and placed onto the cage posts, a few centimetres from the lens.
The optional support stage is used to balance the device such that cells can be placed under the laser spot. For this, the mounting cage is positioned onto a miniature optical bread board (MB1111A/M, Thorlabs Inc.), by screwing a half-inch post onto the XY cage and a second half-inch post onto the optical breadboard. These are then connected via an RA90 angled bracket. If the laser is used in combination with an experimental set-up such as for imaging or electrophysiology the support stage is optional (For a full list of components see https://github. com/OptoGenie/v1.0).
Depending on the length of the experiment and placement of the system, the OptoGenie can be powered by a 9 V battery or connected to mains power supply through a power cable supplied to the Arduino Uno (Arduino.cc). The stimulation protocol can then be loaded to the Arduino using the Arduino IDE.

QUALITY CONTROL SAFETY
Laser safety procedures should be followed according to the host department regulations. Risk assessments should reflect that the laser power is able to exceed that of levels suitable for exposure to the bare eye.

Measuring the light intensity of the OptoGenie for generating action potentials
An important consideration before each use of the OptoGenie for the stimulation of cells is the light intensity measurement of the laser diode. The required light intensity used will depend on the experimental set-up and may vary between experimental replicates. For our experimental protocol (see 'Build Details') all cells were found to elicit action potentials using at least 5-9 mW, corresponding to a peak intensities of 1.2-2.1 mW/mm 2 . Robbins,M.,et al. Journal of Open Hardware DOI: 10.5334/joh.32 Measuring output power with a varying driving current A multi-meter and an optical power meter (P100D, Thorlabs Inc.) were used to measure the output laser power as a function of the driving current, as determined by the potentiometer. For each driving current value tested, 1000 samples of the emitted laser power were measured. A linear relation was found between the driving current in the custom-made PCB and the emitted light between 20.8 mA and 81.7 mA (Figure 5). 81.7 mA was set as a maximum driving current to avoid thermal damage to the PCB. It should be noted that the relationship is only linear in the measured range and is likely to be nonlinear below 20 mA due to diode characteristic, hence why the value of the intercept from a linear fit is negative (Figure 5).

Powering the OptoGenie with a battery
After demonstrating OptoGenie's capability of optogenetic stimulation of neurons expressing ChR2 using mains power, we tested stability of battery-operated device over time.
Measurements were made to test whether the light intensity that the cells received would remain constant over the experimental time-length of 2.5 hr for use inside a cell incubator. For comparison, 2.5 hr recordings of 600 ms light pulses were made using mains power above the stimulation power required (~9 mW) and using the laser diode on full power as an upper bound of the power drop that could be expected in this time. Due to the power meter not having the temporal sensitivity to detect the stimulation frequency used in actual tests, an approximate equivalent stimulation pattern of 600 ms pulse each 200 s was used.
When powered by a 9 V battery, the measured power of the laser diode set to 45 mW starting power dropped by 13% (to 39 mW) over 2.5 hr (Figure 6). When using mains power, the measured power of the laser diode set to 9 mW starting power did not show an overall decrease in power but had small fluctuations (± 0.08 mW) throughout the recording. We tested the power drop using the maximum power of the laser diode (~45 mW) however this drop may be less for lower starting powers compared. This is an important consideration for any experimenter intending on using OptoGenie with battery power, especially if a new battery is not used for each experiment or the experiment exceeds 2.5 hr. Figure 5 Determining the relation between driving current and emitted laser power. The relationship was measured to be linear as expected from the laser characteristics. For each value of the driving current set by the multimeter, 1000 samples were taken, from which the standard deviation was less than 1 % for both the measured current and the optical power.

Figure 6
The power emitted from laser diode pulses. The power measured over 2.5 hr remains constant when powered using mains electricity as compared with battery, which shows exponential decrease in power.
A consideration when using the device is that following repeated use of the 9 V battery, the power that is measured from the laser diode decreases at different rates. For the first measurement, a recording was taken over 2.5 hr using the laser diode at maximum power of ~ 45 mW to show the maximum percentage drop that would occur for the specific stimulation pulse used. As a second measurement, a recording was made using the laser diode at ~9 mW power (for the same area) as is used for cell stimulation, to test whether the power decreased at a different rate on continuous battery use. This time a 33 % decrease in power occurred over the 2.5 hr. It is therefore an important consideration when using a battery to power OptoGenie that the starting power must be set high enough to stimulate cells by the end of the experiment. This power clearly depends on the charge of the battery at the start of the experiment, which can be determined using a multimeter if a new battery is not used. Additionally, future iterations may include a USB power bank to supply a steadier source of power since most power banks have electronic regulators, which help protect the device from surges as they are charging.

Whole-cell patch clamp recordings
For directly testing neuronal responses to the light stimulation by the device and for adjusting device parameters, such as stimulation intensity and length, the OptoGenie was placed onto a patch clamp setup ( Figure 7A). An electrode was placed onto a cell to form a 'giga-seal' with the cell membrane ( Figure 7B(i)). Following 'break-in' the intracellular solution is in contact with the cell cytosol and the voltage across the cell can be recorded whilst the cell is stimulated using optogenetics (Figure 7B(ii)).
Whole-cell patch clamp recordings were carried out in hippocampal primary neurons that express ChR2 (Figure 8A). The stimulation length was set to 1 ms and was adjusted to the minimal intensity required to evoke an action potential, which was found to be between 5-9 mW for an irradiated Gaussian elliptical spot with beam waists w 0,x = 0.85 mm and w 0,y = 3.2 mm, yielding an intensity range between 1.2-2.1 mW/mm 2 ( Figure 8B). This intensity range was reliably evoking action potentials in all cells that were patched (n = 7) and in line with the EC 50 previously reported (Lin et al., 2009).
Then, voltage traces of ChR2-negative cells were recorded to detect excitatory postsynaptic potentials (EPSPs) following a single 1 ms optogenetic stimulation ( Figure 8C) or following repeated stimulations at 0.2 Hz (Figure 8D) of connected ChR2-positive cells.

REUSE POTENTIAL AND ADAPTABILITY
The design of the OptoGenie device came from our first-hand experimental needs and therefore aims to solve real-life difficulties that life science researchers may encounter when wanting to introduce optogenetics to their laboratory. Our requirements included the longterm stimulation of neurons inside of an incubator, whilst allowing flexibility to continue the stimulation protocol on a patch-clamp rig for electrophysiological measurements, or on an optical microscope for imaging. The device could therefore be easily reused by researchers in the life sciences on any experimental set-up so long as they have access to cells expressing light sensitive ion channels, or other light-activatable proteins of interest. This includes anionconducting channelrhodopsins which could use the same device if the laser diode wavelength is matched for the excitation spectra of the proteins of interest, and the stimulation intensity is recalibrated. The device is not specific to the stimulation of neurons, and can be used for other optogenetic applications including studying motor protein activity (Nakamura et al., 2014;Van Bergeijk et al., 2015), mitosis (Fielmich et al., 2018), and the acidification of lysosomes and synaptic vesicles (Rost et al., 2015).
As the device was designed to be simple and easy to assemble, there are several limitations that could be overcome by further adaptations to the device. The spatial resolution of the device is relatively low as it was aimed at stimulating a large population of cells, however fibrecoupling or the addition of an alternative lens could increase this resolution. Additionally, the laser is set to stimulate a single area of cells. An array of diodes or partitioning of the laser light could be used to simultaneously stimulate multiple regions if desired, however these would be limited to a single stimulation pattern unless further adaptations were made.
We encourage researchers to customise the device to suit their specific needs and where relevant, share their creations on the OptoGenie repository; the repository can also be a source of support if users have questions or comments. We suggest a selection of possible modifications (see 'Future Work'). The most impactful alterations may include changing the wavelength of the laser diode, using an additional lens to decrease the stimulation spot size below millimetre squared resolution, and using readily available components such as 3D printed parts where accessible.

AVAILABILITY OF MATERIALS AND METHODS
A full list of hardware components can be found on the OptoGenie repository (https://github.com/ OptoGenie/v1.0). Many of the components for the design are proprietary parts, which are readily available in optics' labs and easy to assemble (see 'Ease of Build' for further detail). However, to further decrease costs and make the device accessible to all researchers, we hope that alternative options, alongside 3D printable designs can be added to the repository for future versions. An Arduino (Arduino.cc) was chosen as a microcontroller for loading a stimulation protocol using the Arduino IDE to reduce costs and provide open-source, well documented software. The electronics for the laser diode requires the most advanced knowledge for the assembly of the printed circuit board. However, we recommend that this design can be given to a departmental electronic workshop or sent to commercial PCB prototype manufacturing companies for integration into a functional circuit. Another practicality is the ability to access cells expressing the light sensitive channels. This could involve viral infection of cells or the use of transgenic animal lines depending on the experimental requirements and resources available to researchers (for genetic manipulation targeting specific cells for use in optogenetics see Miesenböck, 2004 As many researchers will not have access to using patch-clamp electrophysiology there are two alternative solutions. Microelectrode arrays require less skill for basic use, and are able to record cellular reposes following optogenetic stimulation, however this is an expensive alternative. Therefore, fluorescence indicators of neuronal activity may be the most readily available method, either using genetic indicators or exogenous dyes. Genetically encoded indicators can measure changes in intracellular calcium ions, neurotransmitter release, or voltage through changes in fluorescence intensity. Genetically encoded indicators will require either a transgenic biological model or the facilities to use viral infection, and must be suitably red-shifted to be compatible with ChR2 (Dana et al., 2016). Exogenous calcium indicator dyes can bypass viral transfection and may be more convenient method for the general researcher (For review see Paredes et al., 2008). It should also be noted however that for the expression of light-activatable proteins inside of cells, either transgenic models or the ability to perform viral transfection will be required. Although electrophysiology rigs are not required, we strongly recommend using one of these methods to calibrate the intensity required for the combined cell type and light-sensitive channel that are used.
All experiments were performed in accordance with United Kingdom Home Office regulations (Animals (Scientific Procedures) Act 1986 Amendment Regulations 2012) following ethical review by the University of Cambridge Animal Welfare and Ethical Review Body (AWERB). All animal procedures were authorised under Personal and Project licences held by the authors.

Neuronal culture
Postnatal day 0 or 1 (P0/P1) pups from Grik4-Ai32 mice were used for the preparation of primary hippocampal neurons. After dissection of hippocampi in ice-cold PBS, the tissue was digested in papain (Thermo Fisher Scientific) at 37°C for 25 min. Cells were rinsed in 97.5 % Neurobasal Plus Medium (Gibco, Thermo Fisher Scientific), 0.25% glutaMAX (Gibco, Thermo Fisher Scientific) and 2 % B27 plus (Gibco, Thermo Fisher Scientific) (P1 culture medium) containing 10 % foetal bovine serum (FBS). The tissue was then triturated with a pipette to dissociate the cells into single-cell suspension. Cells were then centrifuged for 10 min at 0.4 rotational centrifugal force (rcf). The supernatant was removed from the pellet, and the cells were re-suspended in P1 culture media. Cells were plated at a density of 50000 cells/well in poly-L-lysine coated 8-well LabTek (Thermo Fisher Scientific) dishes for imaging studies, or pre-coated poly-D-lysine and laminin coverslips for electrophysiology studies. Cultures were incubated at 37 °C, 5 % CO 2 . Neurons on coverslips were plated in 500 mL of P1 medium in a 24-well plate and 24 hr after plating, 500 mL of P1 medium was added to each well to bring the total volume to 1 mL. Every second day 330 µL of P1 medium from each well was replaced with 330 µL of fresh P1 medium. Recordings and imaging were carried out after 14-21 days in vitro depending on the expression levels of YFP (DIV14-21). Methods for the characterisation of the OptoGenie device: intensity measurements and long-term stimulation

Whole-Cell Patch Clamp recordings
The stimulation power was changed manually by an analogue variable resistor, and the stimulation spot area could be changed manually with an adjustable iris. To ensure intensity remained above threshold required for cell stimulation whilst powered by the 9 V battery, intensity was measured over 2.5 hr. The aperture diameter was set to 6 mm and the laser power diode to 9 mW for mains power recordings and maximal power of 45 mW for battery recording. After 2.5 hr, a second battery-powered recording was made using 9 mW starting power from the laser diode for another 2.5 hr. The stimulation pulse was determined with an Arduino Uno and set using the Arduino IDE for 600 ms pulse each 200 s. Data were logged using 'Thorlabs Optical Powermeter Utility' software and PM100D power meter (Thorlabs Inc.). Data were plotted in Prism6 (Graphpad, USA).

EASE OF BUILD
The parts used in this version of the design are based on what was most readily available in the lab. This included proprietary parts commonly used in an optics lab. Although these parts may be more expensive than 3D printed versions for researchers with access to a 3D printer, they have inbuilt screw mechanisms that make them easy to assemble without further adjustments. This design also allows certain parts to be switched for components more readily available to the host lab. Although the mechanical assembly and software are considered as 'easy', assembly of the electronics board has been listed as 'advanced'. Although this device is aimed at researchers without a background in engineering, the components require knowledge in circuits to assemble. We therefore recommend that the components for the electronics board ('Electronics components' and the file 'Laser diode for PCB', for circuit information) are sent to a workshop or company for assembly to outsource this design element (https://github. com/OptoGenie/v1.0).

OPERATING SOFTWARE AND PERIPHERALS
The only software required for the operation of the OptoGenie is the Arduino IDE (Arduino.cc) that can be used to set the laser diode stimulation frequency. An example of Arduino code that has been tested on neuronal samples can be found and edited on the Github repository depending on researchers' experimental requirements (https://github.com/OptoGenie/v1.0). We also encourage researchers to upload commented code to this repository such that tested code can be shared by the community.

DISCUSSION CONCLUSIONS
A novel optogenetic stimulation device has been designed and implemented. The programmable laser diode stimulator consists of a laser diode with a variable resistor to adjust the intensity, and an Arduino Uno to control the stimulation frequency. The development of OptoGenie was based on three aims for an effective open-source optogenetic stimulation device: accessible, portable, and adaptable. We have made the device accessible by using simple design from widely available parts, resulting in a low total cost of £480. We note that this is similar to the cost of a comparable light source without control electronics and positioning stages from commercial companies (£300-£1000, Thorlabs Inc.; Azuma Inc., Calif., USA). The cost can be further diminished by the ability to use existing parts from the host laboratory or substitution with 3D printing. The use of existing proprietary parts within the laboratory for the development of our device resulted in the laser diode amounting to the largest cost (£24). The device is portable as it contains no optical fibre coupling, or fragile components. It weighs 0.7 kg and has dimensions of 112.5 cm 3 , small enough for an incubator shelf or fixing to a microscope. Alongside this, the battery adaptor cable allows the device to be powered in any location required without the need for power sockets. While we acknowledge the limitations of the device, including its spatial resolution, single region of stimulation, and outsourcing requirements for the electronics board, we still consider OptoGenie a highly impactful device for in vitro optogenetic stimulation.
Of the commercial and custom-designed devices for optogenetics, ours is one of the few that is not designed solely for in vivo use, or that does not require the purchase of an expensive light source, or multi-LED array which could further decrease the spatial resolution and increase the cost (Lee et al., 2016;Green Leaf Scientific). The spatial resolution on the order of millimetres squared is sufficient for our research needs, though other researchers may require fibre-coupling or lenses to further increase the resolution. The temporal resolution is capable of achieving microsecond precision due to the microcontroller, however the slow channel dynamics makes the practical precision of 10-30 ms stimulation easily achievable. The adaptability of the device is thanks to the simple design that we hope users will tailor further to their needs and share with fellow researchers on the repository.

FUTURE WORK
Components such as the laser diode can be easily switched depending on the wavelength requirements. Other features can also be added including lenses to make a smaller or large focal spot area to enable judicious illumination of the samples. Alternatively, fibre-coupling could be used for single-cell precision. The use of a constant current driver would be an alternative solution to the PCB, the use would be beneficial for long term stability of the device, especially when powered through a battery. We have not used this in our design however it could be considered for future iterations. A 3D printed mounting cage could also be used, if the proprietary parts in this model are not readily available but a 3D printer is accessible. For 3D printing, the quality of plastic should be considered to prevent warping during longterm incubation in cell culture conditions, as well as degradation of the polymer during the sterilisation process. We recommend printing using Formlab's Surgical Guide resin to mitigate the aforementioned issues. Preliminary 3D printing files can be found in the OptoGenie repository and we highly encourage user to modify these designs for their needs. In the future, we aim to drastically reduce the footprint of the device using an Arduino Micro board in conjunction with small rechargeable battery packs. This would significantly reduce the number of wires protruding from the device, increase its portability, and reduce its environmental impact. As an addition, we aim to provide a standalone optogenetics incubation device that incorporates the OptoGenie with a Raspberry Pi and camera module. This would enable automatic acquisition of the stimulated cells at desired time points as well remote access and adjustment of the laser intensity and light pulse modulation.

PAPER AUTHOR CONTRIBUTIONS
MAR: use cases contribution, experimental data, paper writing; OS: design and assembly, paper writing; TF: experimental data, paper writing; GG: paper writing; OP: experimental resources; CFK: experimental resources, paper editing; TE, GSK: paper editing, project supervision;