Skip to main content

Thank you for visiting You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

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.

This is a preview of subscription content, access via your institution

Access options

Rent or buy this article

Get just this article for as long as you need it


Prices may be subject to local taxes which are calculated during checkout

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.

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.


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

    Article  CAS  Google Scholar 

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

    Article  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

  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).

    Article  CAS  Google Scholar 

  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).

    Article  CAS  Google Scholar 

  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).

    Article  CAS  Google Scholar 

  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).

    Article  CAS  Google Scholar 

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

    Article  Google Scholar 

  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).

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

  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).

    Article  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

  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).

    Article  Google Scholar 

  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).

    Article  Google Scholar 

  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).

    Article  Google Scholar 

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

    Article  Google Scholar 

  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).

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

  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).

    Article  CAS  Google Scholar 

  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).

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

  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).

    Article  Google Scholar 

  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).

    Article  Google Scholar 

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

  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).

    Article  CAS  Google Scholar 

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

    Article  Google Scholar 

  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).

    Article  Google Scholar 

  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).

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

  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).

    Article  CAS  Google Scholar 

  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).

    Article  Google Scholar 

  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).

    Article  Google Scholar 

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

    Article  CAS  Google Scholar 

  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).

    Article  CAS  Google Scholar 

  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).

    Article  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  Google Scholar 

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

  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).

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

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

    Article  CAS  Google Scholar 

  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).

    Article  CAS  Google Scholar 

  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).

    Article  CAS  Google Scholar 

  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).

    Article  Google Scholar 

  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).

    CAS  PubMed  Google Scholar 

  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).

    CAS  PubMed  PubMed Central  Google Scholar 

  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).

    Article  Google Scholar 

  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).

    Article  CAS  Google Scholar 

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

Authors and Affiliations



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.

Corresponding author

Correspondence to Matthew S. Kayser.

Ethics declarations

Competing interests

The authors declare no competing interests.

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):

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

Cite this article

Churgin, M.A., Szuperak, M., Davis, K.C. et al. Quantitative imaging of sleep behavior in Caenorhabditis elegans and larval Drosophila melanogaster. Nat Protoc 14, 1455–1488 (2019).

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:


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.


Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing