Circadian rhythms are driven by endogenous biological clocks and are synchronized to environmental cues. The chronobiological study of Caenorhabditis elegans, an extensively used animal model for developmental and genetic research, might provide fundamental information about the basis of circadian rhythmicity in eukaryotes, due to its ease of use and manipulations, as well as availability of genetic data and mutant strains. The aim of this study is to fully characterize the circadian rhythm of locomotor activity in C. elegans, as well as a means for genetic screening in this nematode and the identification of circadian mutants. We have developed an infrared method to measure locomotor activity in C. elegans and found that, under constant conditions, although inter-individual variability is present, circadian periodicity shows a population distribution of periods centered at 23.9+/-0.4 h and is temperature-compensated. Locomotor activity is entrainable by light-dark cycles and by low-amplitude temperature cycles, peaking around the night-day transition and day, respectively. In addition, lin-42(mg152) or lin-42(n1089) mutants (bearing a mutation in the lin-42 gene, homolog to the per gene) exhibit a significantly longer circadian period of 25.2+/-0.4 h or 25.6+/-0.5 h, respectively. Our results represent a complete description of the locomotor activity rhythm in C. elegans, with a methodology that allowed us to uncover three of the key features of circadian systems: entrainment, free-running and temperature compensation. In addition, abnormal circadian periods in clock mutants suggest a common molecular machinery responsible for circadian rhythmicity. Our analysis of circadian rhythmicity in C. elegans opens the possibility for further screening for circadian mutations in this species.