Protocol | Published:

Quantitative imaging of sleep behavior in Caenorhabditis elegans and larval Drosophila melanogaster


Sleep is nearly universal among animals, yet remains poorly understood. Recent work has leveraged simple model organisms, such as Caenorhabditis elegans and Drosophila melanogaster larvae, to investigate the genetic and neural bases of sleep. However, manual methods of recording sleep behavior in these systems are labor intensive and low in throughput. To address these limitations, we developed methods for quantitative imaging of individual animals cultivated in custom microfabricated multiwell substrates, and used them to elucidate molecular mechanisms underlying sleep. Here, we describe the steps necessary to design, produce, and image these plates, as well as analyze the resulting behavioral data. We also describe approaches for experimentally manipulating sleep. Following these procedures, after ~2 h of experimental preparation, we are able to simultaneously image 24 C. elegans from the second larval stage to adult stages or 20 Drosophila larvae during the second instar life stage at a spatial resolution of 10 or 27 µm, respectively. Although this system has been optimized to measure activity and quiescence in Caenorhabditis larvae and adults and in Drosophila larvae, it can also be used to assess other behaviors over short or long periods. Moreover, with minor modifications, it can be adapted for the behavioral monitoring of a wide range of small animals.

Access optionsAccess options

Rent or Buy article

Get time limited or full article access on ReadCube.


All prices are NET prices.

Data availability

All code is included in the Supplementary Data. The sample data presented in this protocol are available from the corresponding author upon reasonable request.

Additional information

Journal peer review information Nature Protocols thanks Henrik Bringmann and other anonymous reviewer(s) for their contribution to the peer review of this work.

Publisher’s note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Related links

Key reference(s) using this protocol

Churgin, M. A. et al. Elife 6, e26652 (2017):

Szuperak, M. et al. Elife 7, e33220 (2018):


  1. 1.

    Joiner, W. J. Unraveling the evolutionary determinants of sleep. Curr. Biol. 26, R1073–R1087 (2016).

  2. 2.

    Keene, A. C. & Duboue, E. R. The origins and evolution of sleep. J. Exp. Biol. 221, jeb159533 (2018).

  3. 3.

    Kayser, M. S. & Biron, D. Sleep and development in genetically tractable model organisms. Genetics 203, 21–33 (2016).

  4. 4.

    Weber, F. & Dan, Y. Circuit-based interrogation of sleep control. Nature 538, 51–59 (2016).

  5. 5.

    Artiushin, G. & Sehgal, A. The Drosophila circuitry of sleep–wake regulation. Curr. Opin. Neurobiol. 44, 243–250 (2017).

  6. 6.

    Dubowy, C. & Sehgal, A. Circadian rhythms and sleep in Drosophila melanogaster. Genetics 205, 1373–1397 (2017).

  7. 7.

    Trojanowski, N. F. & Raizen, D. M. Call it worm sleep. Trends Neurosci. 39, 54–62 (2016).

  8. 8.

    Hendricks, J. C. et al. Rest in Drosophila is a sleep-like state. Neuron 25, 129–138 (2000).

  9. 9.

    Shaw, P. J., Cirelli, C., Greenspan, R. J. & Tononi, G. Correlates of sleep and waking in Drosophila melanogaster. Science 287, 1834–1837 (2000).

  10. 10.

    Raizen, D. M. et al. Lethargus is a Caenorhabditis elegans sleep-like state. Nature 451, 569–572 (2008).

  11. 11.

    Hill, A. J., Mansfield, R., Lopez, J. M. N. G., Raizen, D. M. & Van Buskirk, C. Cellular stress induces a protective sleep-like state in C. elegans. Curr. Biol. 24, 2399–2405 (2014).

  12. 12.

    Skora, S., Mende, F. & Zimmer, M. Energy scarcity promotes a brain-wide sleep state modulated by insulin signaling in C. elegans. Cell Rep. 22, 953–966 (2018).

  13. 13.

    Wu, Y., Masurat, F., Preis, J. & Bringmann, H. Sleep counteracts aging phenotypes to survive starvation-induced developmental arrest in C. elegans. Curr. Biol. 28, 3610–3624.e8 (2018).

  14. 14.

    Kayser, M. S., Yue, Z. & Sehgal, A. A critical period of sleep for development of courtship circuitry and behavior in Drosophila. Science 344, 269–274 (2014).

  15. 15.

    Szuperak, M. et al. A sleep state in Drosophila larvae required for neural stem cell proliferation. Elife 7, e33220 (2018).

  16. 16.

    Nichols, A. L. A., Eichler, T., Latham, R. & Zimmer, M. A global brain state underlies C. elegans sleep behavior. Science 356, 1247–1256 (2017).

  17. 17.

    Eichler, K. et al. The complete connectome of a learning and memory centre in an insect brain. Nature 548, 175–182 (2017).

  18. 18.

    Bringmann, H. Sleep-active neurons: conserved motors of sleep. Genetics 208, 1279–1289 (2018).

  19. 19.

    Koh, K. et al. Identification of SLEEPLESS, a sleep-promoting factor. Science 321, 372–376 (2008).

  20. 20.

    Cirelli, C. et al. Reduced sleep in Drosophila Shaker mutants. Nature 434, 1087–1092 (2005).

  21. 21.

    Shi, M., Yue, Z., Kuryatov, A., Lindstrom, J. M. & Sehgal, A. Identification of Redeye, a new sleep-regulating protein whose expression is modulated by sleep amount. Elife 3, e01473 (2014).

  22. 22.

    Stavropoulos, N. & Young, M. W. insomniac and Cullin-3 regulate sleep and wakefulness in Drosophila. Neuron 72, 964–976 (2011).

  23. 23.

    Rogulja, D. & Young, M. W. Control of sleep by cyclin A and its regulator. Science 335, 1617–1621 (2012).

  24. 24.

    Churgin, M. A. et al. Longitudinal imaging of Caenorhabditis elegans in a microfabricated device reveals variation in behavioral decline during aging. Elife 6, e26652 (2017).

  25. 25.

    Bais, S., Churgin, M. A., Fang-Yen, C. & Greenberg, R. M. Evidence for novel pharmacological sensitivities of transient receptor potential (TRP) channels in Schistosoma mansoni. PLoS Negl. Trop. Dis. 9, e0004295 (2015).

  26. 26.

    Senatore, A., Reese, T. S. & Smith, C. L. Neuropeptidergic integration of behavior in Trichoplax adhaerens, an animal without synapses. J. Exp. Biol. 220, 3381–3390 (2017).

  27. 27.

    Smith, C. L., Pivovarova, N. & Reese, T. S. Coordinated feeding behavior in Trichoplax, an animal without synapses. PLoS ONE 10, e0136098 (2015).

  28. 28.

    Ueda, T., Koya, S. & Maruyama, Y. K. Dynamic patterns in the locomotion and feeding behaviors by the placozoan Trichoplax adhaerence. Biosystems. 54, 65–70 (1999).

  29. 29.

    Nagy, S., Raizen, D. M. & Biron, D. Measurements of behavioral quiescence in Caenorhabditis elegans. Methods 68, 500–507 (2014).

  30. 30.

    Choi, S., Chatzigeorgiou, M., Taylor, K. P., Schafer, W. R. & Kaplan, J. M. Analysis of NPR-1 reveals a circuit mechanism for behavioral quiescence in C. elegans. Neuron 78, 869–880 (2013).

  31. 31.

    Swierczek, N. A., Giles, A. C., Rankin, C. H. & Kerr, R. A. High-throughput behavioral analysis in C. elegans. Nat. Methods 8, 592–598 (2011).

  32. 32.

    Vogelstein, J. T. et al. Discovery of brainwide neural-behavioral maps via multiscale unsupervised structure learning. Science 344, 386–392 (2014).

  33. 33.

    Huang, H., Singh, K. & Hart, A. C. Measuring Caenorhabditis elegans sleep during the transition to adulthood using a microfluidics-based system. Bio Protoc. 7, e2174 (2017).

  34. 34.

    Bringmann, H. Agarose hydrogel microcompartments for imaging sleep- and wake-like behavior and nervous system development in Caenorhabditis elegans larvae. J. Neurosci. Methods 201, 78–88 (2011).

  35. 35.

    Turek, M., Besseling, J. & Bringmann, H. Agarose microchambers for long-term calcium imaging of Caenorhabditis elegans. J. Vis. Exp. 2015, e52742 (2015).

  36. 36.

    Pittman, W. E., Sinha, D. B., Zhang, W. B., Kinser, H. E. & Pincus, Z. A simple culture system for long-term imaging of individual C. elegans. Lab Chip 17, 3909–3920 (2017).

  37. 37.

    Belfer, S. J. et al. Caenorhabditis-in-drop array for monitoring C. elegans quiescent behavior. Sleep 36, 689–698G (2013).

  38. 38.

    Tomasiunaite, U., Widmann, A. & Thum, A. S. Maggot instructor: semi-automated analysis of learning and memory in Drosophila larvae. Front. Psychol. 9, 1010 (2018).

  39. 39.

    Clark, M. Q., McCumsey, S. J., Lopez-Darwin, S., Heckscher, E. S. & Doe, C. Q. Functional genetic screen to identify interneurons governing behaviorally distinct aspects of Drosophila larval motor programs. G3 (Bethesda). 6, 2023–2031 (2016).

  40. 40.

    Churgin, M. A. & Fang-Yen, C. An imaging system for C. elegans behavior. Methods Mol. Biol. 1327, 199–207 (2015).

  41. 41.

    Churgin, M. A., McCloskey, R. J., Peters, E. & Fang-Yen, C. Antagonistic serotonergic and octopaminergic neural circuits mediate food-dependent locomotory behavior in Caenorhabditis elegans. J. Neurosci. 37, 7811–7823 (2017).

  42. 42.

    McCloskey, R. J., Fouad, A. D., Churgin, M. A. & Fang-Yen, C. Food responsiveness regulates episodic behavioral states in Caenorhabditis elegans. J. Neurophysiol. 117, 1911–1934 (2017).

  43. 43.

    Nagy, S., Goessling, M., Amit, Y. & Biron, D. A generative statistical algorithm for automatic detection of complex postures. PLoS Comput. Biol. 11, e1004517 (2015).

  44. 44.

    Husson, S. J., Costa, W. S., Schmitt, C. & Gottschalk, A. Keeping track of worm trackers in WormBook (ed. The C. elegans Research Community) 1–17 (2013).

  45. 45.

    Nelson, M. D. et al. FMRFamide-like FLP-13 neuropeptides promote quiescence following heat stress in Caenorhabditis elegans. Curr. Biol. 24, 2406–2410 (2014).

  46. 46.

    You, Y. J., Kim, J., Raizen, D. M. & Avery, L. Insulin, cGMP, and TGF-beta signals regulate food intake and quiescence in C. elegans: a model for satiety. Cell Metab. 7, 249–257 (2008).

  47. 47.

    Scholz, M., Lynch, D. J., Lee, K. S., Levine, E. & Biron, D. A scalable method for automatically measuring pharyngeal pumping in C. elegans. J. Neurosci. Methods 274, 172–178 (2016).

  48. 48.

    Ryder, E. et al. The DrosDel deletion collection: a Drosophila genomewide chromosomal deficiency resource. Genetics 177, 615–629 (2007).

  49. 49.

    Hamada, F. N. et al. An internal thermal sensor controlling temperature preference in Drosophila. Nature 454, 217–220 (2008).

  50. 50.

    Jennett, A. et al. A GAL4-driver line resource for Drosophila neurobiology. Cell Rep. 2, 991–1001 (2012).

  51. 51.

    Stiernagle, T. Maintenance of C. elegans in WormBook (ed. The C. elegans Research Community) 1–11 (2006).

  52. 52.

    Dou, Y.-H., Bao, N., Xu, J.-J. & Chen, H.-Y. A dynamically modified microfluidic poly(dimethylsiloxane) chip with electrochemical detection for biological analysis. Electrophoresis 23, 3558–3566 (2002).

  53. 53.

    Alcantar, N. A., Aydil, E. S. & Israelachvili, J. N. Polyethylene glycol-coated biocompatible surfaces. J. Biomed. Mater. Res. 51, 343–351 (2000).

  54. 54.

    Ginn, B. T. & Steinbock, O. Polymer surface modification using microwave-oven-generated plasma. Langmuir 19, 8117–8118 (2003).

  55. 55.

    Eddington, D. T., Puccinelli, J. P. & Beebe, D. J. Thermal aging and reduced hydrophobic recovery of polydimethylsiloxane. Sensors Actuators B Chem. 114, 170–172 (2006).

  56. 56.

    Xiao, D., Zhang, H. & Wirth, M. Chemical modification of the surface of poly(dimethylsiloxane) by atom-transfer radical polymerization of acrylamide. Langmuir 18, 9971–9976 (2002).

  57. 57.

    Tan, S. H., Nguyen, N.-T., Chua, Y. C. & Kang, T. G. Oxygen plasma treatment for reducing hydrophobicity of a sealed polydimethylsiloxane microchannel. Biomicrofluidics 4, 32204 (2010).

  58. 58.

    Park, Y., Filippov, V., Gill, S. S. & Adams, M. E. Deletion of the ecdysis-triggering hormone gene leads to lethal ecdysis deficiency. Development 129, 493–503 (2002).

  59. 59.

    DeBardeleben, H. K., Lopes, L. E., Nessel, M. P. & Raizen, D. M. Stress-induced sleep after exposure to ultraviolet light is promoted by p53 in Caenorhabditis elegans. Genetics 207, 571–582 (2017).

  60. 60.

    Singh, K., Ju, J. Y., Walsh, M. B., DiIorio, M. A. & Hart, A. C. Deep conservation of genes required for both Drosphila melanogaster and Caenorhabditis elegans sleep includes a role for dopaminergic signaling. Sleep 37, 1439–1451 (2014).

  61. 61.

    Turek, M., Lewandrowski, I. & Bringmann, H. An AP2 transcription factor is required for a sleep-active neuron to induce sleep-like quiescence in C. elegans. Curr. Biol. 23, 2215–2223 (2013).

Download references


We thank P. McClanahan for assistance with the method for fabrication of flat WorMotel bases and for recording the video of pharyngeal pumping in the WorMotel. This work was supported by NIH grants K08NS090461 (M.S.K.), R01NS088432 (D.M.R. and C.F.-Y.), and R01NS084835 (C.F.-Y.); the Ellison Medical Foundation (C.F.-Y.); the European Commission Horizon 2020 program (C.F.-Y.); a Burroughs Wellcome Career Award for Medical Scientists (M.S.K.); a March of Dimes Basil O’Connor Scholar Award (M.S.K.); and a Sloan Research Fellowship (M.S.K.). K. Davis is a trainee in the NIH Translational Research Training Program (T32 ES019851, PI: T. Penning, Penn CEET).

Author information

M.A.C., M.S., K.C.D., D.M.R., C.F.-Y., and M.S.K. were all involved with development of the protocol and the writing of the manuscript.

Competing interests

The authors declare no competing interests.

Correspondence to Matthew S. Kayser.

Integrated supplementary information

Supplementary Figure 1 Monitoring of second and third instar larvae.

The LarvaLodge can be used for long term behavioral experiments using 2nd instar larvae (green box) or short term using 3rd instars (red box). Scale bar = 5 mm.

Supplementary Figure 2 Preparing the LarvaLodge.

(a) Image of a LarvaLodge. Wells were filled with 3% agar, 2% sucrose medium. Well diameters are 11 mm across. (b) Magnified image of two wells after yeast paste was applied to the surface. Scale bar = 5 mm.

Supplementary Figure 3 UV treatment of worms.

To protect the untreated controls on the WorMotel, we use a combination of a piece of folded paper and aluminum foil tent. (a) Paper is used under the aluminum foil because UV rays could bounce off of aluminum foil alone and still reach worms underneath. The folded piece of paper fits on the WorMotel chip to cover as many rows of the chip as desired. (b) Side view shows how the folded piece fits down in between rows of wells to hold it securely in place. (c) View from above the chip of where the aluminum foil sits, folded to fit over the paper. (d) Side view of the placement of the aluminum foil tent. (e) View of the paper and aluminum foil from the open end; the aluminum foil tent fits over the paper loosely so that putting the aluminum foil tent on does not disrupt the paper.

Supplementary Figure 4 Image exposure range.

Examples of (a) optimally exposed, (b) overexposed, and (c) underexposed images of a WorMotel. Well centers are spaced 4.5 mm apart.

Supplementary information

Supplementary Text and Figures

Supplementary Figures 1–4

Reporting Summary

Supplementary Data

Supplementary Video 1

Continuous monitoring in a WorMotel of a single wild-type C. elegans hermaphrodite from the embryo stage to the adult stage. The newly hatched first-larval-stage animal is about 200 μm long, and the adult animal is about 1,000 μm long. The well diameter is 3.5 mm.

Supplementary Video 2

Monitoring pharyngeal pumping of a single adult C. elegans hermaphrodite by increasing the magnification. The adult worm is about 1,200 μm long.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark
Fig. 1: Protocol outline.
Fig. 2: Imaging system.
Fig. 3: Blue-light-stimulus assembly.
Fig. 4: Preparing and filling the WorMotel.
Fig. 5: WorMotel imaging setup.
Fig. 6: LarvaLodge imaging software setup.
Fig. 7: Closed-loop activation setup.
Fig. 8: Screenshots of image processing (WorMotel, part 1).
Fig. 9: Screenshots of image processing (WorMotel, part 2).
Fig. 10: Screenshots of LarvaLodge image processing.
Fig. 11: Sample data: UV and heat-shock (SIS with wild-type and rbr-2.
Fig. 12: Sample data: developmentally timed sleep with wild-type and rbr-2 worms.
Fig. 13: Sample data: activation of sleep-promoting neurons in fly larvae.
Supplementary Figure 1: Monitoring of second and third instar larvae.
Supplementary Figure 2: Preparing the LarvaLodge.
Supplementary Figure 3: UV treatment of worms.
Supplementary Figure 4: Image exposure range.


By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.