Skip to content

Modules

Accessory modules let an ethoscope act on the animals it tracks, closing the loop between behaviour and stimulus: rotating a tube to wake a fly, puffing an odour, or switching on a light. A module connects to the ethoscope over USB and is driven by a stimulator that you choose, with its parameters, when you start tracking.

All current modules share one electronics platform: a custom circuit board with an Arduino Micro and three Darlington transistor arrays, giving 20 independently switched output channels (see Module electronics). The same board and firmware serve five module types; you choose one by setting MODULE in the firmware and fitting the matching motors, valves or LEDs. In modules with motors, the motors sit on the odd channels and the valves or LEDs on the even ones.

MODULE Name Outputs Use Stimulator
0 SD 10 motors (channels 1, 3, …, 19) Sleep deprivation by rotating the tubes mAGO (motors)
1 AGOSD (mAGO) 10 motors (odd) and 10 valves (even channels 0, 2, …, 18) Sleep deprivation and odour arousal mAGO
2 AGO 10 valves (even channels) Odour delivery without motors AGO
3 mAGOLED 10 motors (odd) and 10 LEDs (even) Mechanical and optogenetic stimulation OptomotorSleepDepriver
4 LED 20 LEDs (channels 0–19) Optogenetic stimulation, for example CsChrimson OptoSleepDepriver

The stimulators are in ethoscope.stimulators.sleep_depriver_stimulators and talk to the module through ethoscope.hardware.interfaces.optomotor (the OptoMotor class). Which region of interest (ROI) each channel serves is given on each module’s page.

The module appears as a serial device (115200 baud). The ethoscope sends it these commands; you can send them yourself, from any serial terminal, to test a module.

Command Modules Action
P channel ms all Switch one channel on for a number of milliseconds, e.g. P 5 1000
A s with motors Run all motors for a number of seconds, e.g. A 5
W channel on_ms off_ms cycles with LEDs Pulse one LED channel, e.g. W 4 100 900 30
B s with LEDs Switch all LEDs on for a number of seconds, e.g. B 3
X on_ms off_ms cycles with LEDs Pulse all LEDs, e.g. X 100 900 10
D all Demo: activate every channel in turn
T all Report the module’s capabilities as JSON
H all Show the commands available on this module

The ethoscope uses T to discover what the connected module can do.

Before the modular system, the lab built a servo-based sleep deprivation module (the one described in the 2017 PLoS Biology paper), an optomotor module and an odour module driven by LEGO pneumatic valves. They are no longer recommended and are not documented here; the files of the 2017 versions are archived on Zenodo and in the ethoscope_hardware repository.