Abstract
Small, genetically tractable species such as larval zebrafish, Drosophila, or Caenorhabditis elegans have become key model organisms in modern neuroscience. In addition to their low maintenance costs and easy sharing of strains across labs, one key appeal is the possibility to monitor single or groups of animals in a behavioural arena while controlling the activity of select neurons using optogenetic or thermogenetic tools. However, the purchase of a commercial solution for these types of experiments, including an appropriate camera system as well as a controlled behavioural arena, can be costly. Here, we present a low-cost and modular open-source alternative called 'FlyPi'. Our design is based on a 3D-printed mainframe, a Raspberry Pi computer, and high-definition camera system as well as Arduino-based optical and thermal control circuits. Depending on the configuration, FlyPi can be assembled for well under €100 and features optional modules for light-emitting diode (LED)-based fluorescence microscopy and optogenetic stimulation as well as a Peltier-based temperature stimulator for thermogenetics. The complete version with all modules costs approximately €200 or substantially less if the user is prepared to 'shop around'. All functions of FlyPi can be controlled through a custom-written graphical user interface. To demonstrate FlyPi's capabilities, we present its use in a series of state-of-the-art neurogenetics experiments. In addition, we demonstrate FlyPi's utility as a medical diagnostic tool as well as a teaching aid at Neurogenetics courses held at several African universities. Taken together, the low cost and modular nature as well as fully open design of FlyPi make it a highly versatile tool in a range of applications, including the classroom, diagnostic centres, and research labs.
🔬 Techniques
🧬 Organisms
💻 Software
✨ Fluorophores
🧪 Sample Preparation
🏭 Microscope Brands
🧪 Reagent Suppliers
📷 Detectors
💻 Software Details
💻 Code & Software
💾 Data Repositories
🏛️ Research Organizations (ROR)
Affiliated research institutions:
📋 Methods
A complete assembly and user manual is deposited on GitHub ( https://github.com/amchagas/Flypi/blob/master/User%20and%20Assembly%20Manual_revised.pdf ). Assembly time and necessary skills From our previous workshop experiences, the assembly of the FlyPi (including software setup) should take about 5 hours for a person with no previous soldering experience, provided that all individual components are in place. Experienced users can expect to be done in 2 to 3 hours. 3D modelling and printing 3D modelling was performed in OpenSCAD [ 50 ], and all files are provided as both editable scad and complied surface tesselation lattice (stl) files. All parts were printed in polylactic acid (PLA) on an Ultimaker 2 3D printer (Ultimaker, Geldermailsen, Netherlands) in six prearranged plates using the following parameters: infill 30%, no supports, 5-mm brim, layer height 0.1 mm, print speed 60 mm/s, and travel speed 200 mm/s. Total printing time of a single FlyPi, including all presented modules, was about 40 hours. Notably, this time can be substantially reduced by using faster print settings and/or a larger nozzle, as is commonly implemented in lower-cost 3D printers. For example, using a well-calibrated delta Rep-Rap delta ( www.reprap.org ) printing at full speed, the entire system can be printed at sufficient precision in less than 20 hours. In case a 3D printer is not locally available, several available “print-on-demand” services (e.g., Shapeways, Sculpteo, 3D hubs) can be used to source the parts. We estimated that the cost to have parts printed in plastic from one of the services available at 3Dhubs to be approximately €40. PCB design and printing The PCB was designed in KiCad [ 51 ] and is provided as the native KiCad file format, as well as the more widely used gerber file format. The PCB facilitates connections between peripherals and the microcontroller and was designed to be modular such that only components that will be used need to be soldered on the board. The power circuitry designed for a single 12 V 5 A power supply is provided. The large spacing between component slots, PCB labelling, and consistent use of the “through-hole” component format is intended to facilitate assembly by users with little soldering experience. Using the provided Gerber files, it is possible to order the PCBs from a variety of producers (e.g., pcbway.com, seeedstudio.com/pcb, dirtypcbs.com). Of course, if required, the entire PCB could also be improvised using individual cables and/or a suitable breadboard by taking reference to the circuit diagram provided. The GUI The GUI ( S1 Fig ) was written in Python3. The control functions for each peripheral component is created in its own class, making it easier for the end user to create/alter functions independently. These classes are then contained in a ‘general purpose’ class, responsible for the display of the user interface and addressing the commands to be sent to the Arduino board (responsible for time-precise events and direct interaction with peripherals, for details see below). The communication between the RPi and the Arduino is established via universal serial bus (USB) through a serial protocol (Python Serial library [ 52 ]). The GUI is created using Tkinter [ 53 ]. Both libraries are compatible with Python2 and Python3. The GUI is also capable of creating folders and saving files to the Raspberry Pi desktop. For simplicity, the software creates a folder called ‘FlyPi_output’ and subfolders depending on the type of data being acquired (time lapse, video, snapshots, temperature logging). The files within the subfolders are created using date and time as their names, preventing overwriting of data. Arduino We used an ATmega328-based Arduino Nano [ 13 ]. The board was chosen due to a high number of input/output ports, its variety of communication protocols (e.g., Serial, I2C), its low cost and easy availability (including several ultra-low-cost clones at €2 to €3), very well-documented environment (hardware specifications, function descriptions, ‘how to’ recipes), and large user database. The board is programmed in C++ together with the modifications added by the Arduino integrated development environment (IDE). The board is responsible for controlling all peripheral devices except the camera and provides microsecond precision for time measurement. The code can be adapted to most of the other boards of the Arduino family, with small changes (e.g., digital, analogue, and serial port addresses). Raspberry Pi 3 operating system We used Raspian [ 54 ] as the operating system (OS) on the Raspberry Pi 3 [ 14 ] for its installation simplicity through ‘new out of the box software’ (NOOBS) [ 55 ] and because it is derived from Debian [ 56 ], a stable and well-supported GNU-Linux distribution. However, any Linux distribution compatible with the Raspberry Pi and the chosen Python3 libraries can be used. Arduino compatibility is not mandatory, since once the board is loaded with the correct code, which can be done on any computer, the Arduino IDE is not used further, as all live communication goes via the serial port directly from Python.
Show full methods section
A complete assembly and user manual is deposited on GitHub ( https://github.com/amchagas/Flypi/blob/master/User%20and%20Assembly%20Manual_revised.pdf ). Assembly time and necessary skills From our previous workshop experiences, the assembly of the FlyPi (including software setup) should take about 5 hours for a person with no previous soldering experience, provided that all individual components are in place. Experienced users can expect to be done in 2 to 3 hours. 3D modelling and printing 3D modelling was performed in OpenSCAD [ 50 ], and all files are provided as both editable scad and complied surface tesselation lattice (stl) files. All parts were printed in polylactic acid (PLA) on an Ultimaker 2 3D printer (Ultimaker, Geldermailsen, Netherlands) in six prearranged plates using the following parameters: infill 30%, no supports, 5-mm brim, layer height 0.1 mm, print speed 60 mm/s, and travel speed 200 mm/s. Total printing time of a single FlyPi, including all presented modules, was about 40 hours. Notably, this time can be substantially reduced by using faster print settings and/or a larger nozzle, as is commonly implemented in lower-cost 3D printers. For example, using a well-calibrated delta Rep-Rap delta ( www.reprap.org ) printing at full speed, the entire system can be printed at sufficient precision in less than 20 hours. In case a 3D printer is not locally available, several available “print-on-demand” services (e.g., Shapeways, Sculpteo, 3D hubs) can be used to source the parts. We estimated that the cost to have parts printed in plastic from one of the services available at 3Dhubs to be approximately €40. PCB design and printing The PCB was designed in KiCad [ 51 ] and is provided as the native KiCad file format, as well as the more widely used gerber file format. The PCB facilitates connections between peripherals and the microcontroller and was designed to be modular such that only components that will be used need to be soldered on the board. The power circuitry designed for a single 12 V 5 A power supply is provided. The large spacing between component slots, PCB labelling, and consistent use of the “through-hole” component format is intended to facilitate assembly by users with little soldering experience. Using the provided Gerber files, it is possible to order the PCBs from a variety of producers (e.g., pcbway.com, seeedstudio.com/pcb, dirtypcbs.com). Of course, if required, the entire PCB could also be improvised using individual cables and/or a suitable breadboard by taking reference to the circuit diagram provided. The GUI The GUI ( S1 Fig ) was written in Python3. The control functions for each peripheral component is created in its own class, making it easier for the end user to create/alter functions independently. These classes are then contained in a ‘general purpose’ class, responsible for the display of the user interface and addressing the commands to be sent to the Arduino board (responsible for time-precise events and direct interaction with peripherals, for details see below). The communication between the RPi and the Arduino is established via universal serial bus (USB) through a serial protocol (Python Serial library [ 52 ]). The GUI is created using Tkinter [ 53 ]. Both libraries are compatible with Python2 and Python3. The GUI is also capable of creating folders and saving files to the Raspberry Pi desktop. For simplicity, the software creates a folder called ‘FlyPi_output’ and subfolders depending on the type of data being acquired (time lapse, video, snapshots, temperature logging). The files within the subfolders are created using date and time as their names, preventing overwriting of data. Arduino We used an ATmega328-based Arduino Nano [ 13 ]. The board was chosen due to a high number of input/output ports, its variety of communication protocols (e.g., Serial, I2C), its low cost and easy availability (including several ultra-low-cost clones at €2 to €3), very well-documented environment (hardware specifications, function descriptions, ‘how to’ recipes), and large user database. The board is programmed in C++ together with the modifications added by the Arduino integrated development environment (IDE). The board is responsible for controlling all peripheral devices except the camera and provides microsecond precision for time measurement. The code can be adapted to most of the other boards of the Arduino family, with small changes (e.g., digital, analogue, and serial port addresses). Raspberry Pi 3 operating system We used Raspian [ 54 ] as the operating system (OS) on the Raspberry Pi 3 [ 14 ] for its installation simplicity through ‘new out of the box software’ (NOOBS) [ 55 ] and because it is derived from Debian [ 56 ], a stable and well-supported GNU-Linux distribution. However, any Linux distribution compatible with the Raspberry Pi and the chosen Python3 libraries can be used. Arduino compatibility is not mandatory, since once the board is loaded with the correct code, which can be done on any computer, the Arduino IDE is not used further, as all live communication goes via the serial port directly from Python.
Spectral and power measurements
We used a commercial photo-spectrometer (USB2000+VIS-NIR, Ocean Optics, Ostfildern, Germany) and custom-written software in Igor-Pro 7 (Wavemetrics) to record and analyse spectra of LEDs and filters. Peak LED power was determined using a Powermeter (Model 818, 200–1800 nm, Newport). We used fluorescent beads (PS-Speck TM Microscope Point Source Kit P-7220, ThermoFisher) for estimating FlyPi’s psf .
Video and image acquisition
All static image data was obtained as full-resolution RGB images (2592 x 1944 pixels) and saved as jpeg. All video data was obtained as RGB at 42 Hz (x2 binning), yielding image stack of 1296 x 972 pixels, and saved as h264. Video data was converted to AVI using the ffmpeg package for GNU/Linux (ffmpeg.org, a conversion button is added to the GUI for simplicity). All further data analysis was performed in Image-J (NIH) and Igor-Pro 7 (Wavemetrics). Figures were prepared in Canvas 15 (ACD Systems).
Calcium imaging in larval Drosophila muscles
Second instar larvae (Mef2-Gal4; UAS-myr::GCaMP5) were left to freely crawl between a microscope slide and cover slip loosely suspended with tap water. For analysis, x2 binned video data (42 Hz) was further down-sampled by a factor of 2 in the image plane and a factor of 4 in time. Only the green channel was analysed. Following background subtraction, regions of interest were placed as indicated ( Fig 3J ). Next, from each image frame, we subtracted the mean image of four preceding frames to generate a “running average time-differential” stack—shown as the space–time plot in Fig 3L with the original x-axis collapsed. Individual noncollapsed frames of this stack, separated by 100-ms intervals, are shown in Fig 3M . Zebrafish ChR2 activation A 3 dpf zebrafish larva ( Et(E1b : Gal4)s1101t , Tg(UAS : Cr . ChR2_H134R-mCherry)s1985t , nacre-/- ) was mounted in a drop of E3 medium (5 mM NaCl, 0.17 mM KCl, 0.33 mM CaCl 2 , 0.33 mM MgSO 4 , pH adjusted to 7.4 using NaHCO 3 ) on top of a microscope slide and placed immediately above the inverted camera objective. The NeoPixel 12 LED ring was placed about 2 cm above the specimen, facing down. Concurrent maximal activation of all 12 blue LEDs for more than 500 ms reliably elicited pectoral fin swimming bouts. Shorter stimuli were not effective. RGB image data was obtained at 42 Hz, down-sampled by a factor of 4 in time and visualised by tracking the mean brightness of two regions of interest placed onto the pectoral fins.
Drosophila larva ChR2 activation
First, instar Drosophila larvae (elav-GAL4/+; UAS-shibre ts , UAS-ChR2/+; UAS-ChR2/+, raised on standard food mixed with 200 μM all-trans retinal as described in [ 33 ]) were placed on agarose darkened with Indian ink (1% v/v) within the lid of a 50-ml falcon tube and left to freely crawl. The camera and NeoPixel LED ring were placed about 3 cm above the surface. Concurrent activation of all 12 blue LEDs for 1 s at a time reliably triggered larval contractions. Image data acquired at 42 Hz and saved as 8-bit greyscale. Larval length was quantified manually in ImageJ by measuring the distance between head and tail along the body axis at three time points: t = −1, 0.5, and 5 s relative to the flash (t = 0–1 s). n = 12 responses from three animals, error bars in standard deviation.
Drosophila adult Chrimson activation Adult
Drosophila (w; +; GMR86A08-Gal4/UAS-CsChrimson raised on standard food mixed with 200 μM all-trans retinal as described in [ 33 ]) were fixed to a cover slide by gluing the back of their thorax with nail varnish, with limbs moving freely. The NeoPixel 12 LED ring was positioned around the camera objective about 2 cm above the fly, pointing down. Concurrent maximal activation of all 12 red LEDs for 1 s, separated by 2-s intervals, reliably elicited the PER. RGB image data was obtained at 42 Hz (x2 binning). The image stack was converted to 8-bit greyscale, and background over time was subtracted from the entire image stack to limit the excitation light artefact. To calculate proboscis position over time, we plot image brightness over time within a region of interest placed at the tip of the fully extended proboscis. Thermogenetics To assess the performance and stability of the Peltier-Thermistor loop we exported the Peltier command setting and Thermistor reading at 2 Hz through the serial port into an Ascii file and analysed the data using Igor Pro 6 (Wavemetrics).
Supporting information S1 Fig Graphical User Interface (GUI). Screenshots of the Python-based GUI divided into four main control panels that can be individually activated depending on user requirements: A , Camera control, B , LED, C , Peltier and Focus Servo control, D , Custom protocol window. For details, please refer to the user and assembly manual online: https://github.com/amchagas/Flypi/blob/master/User%20and%20Assembly%20Manual.pdf . (PDF) Click here for additional data file.
S1 Table
Bill of materials (BOM). Complete list, estimated costs and online links to all required parts, organised by modules. For details, please refer to the user and assembly manual online: https://github.com/amchagas/Flypi/blob/master/User%20and%20Assembly%20Manual.pdf . (XLSX) Click here for additional data file. S1 Video Zebrafish larva transmission to visualise circulation (related to Fig 2F ). (AVI) Click here for additional data file. S2 Video Zebrafish larva fluorescence sorting (related to Fig 3I ). (AVI) Click here for additional data file. S3 Video Zebrafish larva expressing GFP in the heart (related to Fig 3 ). (AVI) Click here for additional data file. S4 Video Zebrafish eggs expressing GCaMP5 in all neurons (related to Fig 3 ). (AVI) Click here for additional data file. S5 Video Drosophila larva calcium imaging (related to Fig 3J–3M ). (AVI) Click here for additional data file. S6 Video C . elegans crawling freely (related to Fig 4B ). (AVI) Click here for additional data file. S7 Video Drosophila adults walking freely in custom chamber (related to Fig 4D ). (AVI) Click here for additional data file. S8 Video Zebrafish expressing ChR2 in all neurons under blue light (related to Fig 5C and 5D ). (AVI) Click here for additional data file. S9 Video Drosophila larvae ChR2 under blue light (related to Fig 5E and 5F ). (AVI) Click here for additional data file. S10 Video Drosophila adult proboscis extension reflex driven by CsChrimson using red light (related to Fig 5G and 5H ). (AVI) Click here for additional data file.
📊 Figures
Fig 1
Overview.
A . The 3D model, colour coded by core structure (black), mounting adapters (blue), and micromanipulator (green). B . Printed parts and electronics, partially assembled. C . Wiring diagram and summary...
Fig 2
Basic light microscopy.
A , B . The camera and objective can be mounted in upright (A) or inverted mode (B). In each case, the micromanipulator allows accurate positioning of a microscope slide in the image plane, while the ...
Fig 3
Fluorescence microscopy.
A . A collimated 410 nm light-emitting diode (LED) angled at 45u00b0 and two ultra-low-cost theatre lighting filters provide for fluorescence capability. B . A photo of the fluorescence setup. C . Flu...
Fig 4
Behavioural tracking.
A , B . Red light illumination from the light-emitting diode (LED) ring can be used to illuminate animals during behavioural trackingu2014 C . elegans is shown here on an Agar plate (B). C . A behavio...
Fig 5
Optogenetics.
A . Experimental configuration suitable for optogenetic stimulation of an individual zebrafish larva suspended in a drop of E3 (Methods). B . Spectrum and peak power of the three light-emitting diodes...
Figure images are served from the NIH/NLM PubMed Central Open Access Subset or Europe PMC; copyright remains with the publishers and authors.
💬 Discussion
0 commentsNo comments yet. Be the first to start a discussion!
Leave a Comment