C. elegans is an important model for understanding the genetics and physiology of the sense of touch. Traditional assays for touch in C. elegans include manually touching the animal with a fine hair (gentle touch) or wire pick (harsh touch) and observing its behavioral response. These assays are limited by their low throughput and qualitative nature. To address these limitations, we developed a microfluidic system that uses an array of pressure-driven microvalves to deliver continuously variable, spatially localized mechanical stimuli to up to 60 freely behaving worms at once. The microfluidic device has two layers. The 'worm layer' comprises an array of 64 sinusoidal channels in which the worms can crawl, and the 'control layer' comprises 15 straight channels separated from the worm layer by a flexible membrane. When pressurized, the control channels inflate and impinge on the worm layer, delivering a mechanical stimulus to the worms inside. The control channel spacing is similar to the length of the animals, so that each worm is likely to experience a single mechanical stimulus during each pressurization. Machine vision is used to track the worms throughout an experiment. By delivering a series of stimuli of increasing amplitude, we use our single assay to quantify the 50% response thresholds to gentle and harsh touch in terms of worm channel ceiling deflection. We found response thresholds of 8.8 plus or minus 2.6 m for WT and 46.9 plus or minus 3.3 m for
mec-4 animals, suggesting that the threshold for harsh (
mec-4-independent) touch is about 5 times larger than for gentle (
mec-4-dependent) touch. We then take advantage of the localized nature of the stimuli to quantify changes in the receptive field resulting from defects in the development of the posterior touch receptor neurons in
egl-5 mutants. We find that while WT worms respond to mid-posterior touch with forward movement,
egl-5 mutants respond with reversals, suggesting that the anterior touch cells are sensitive to posterior touch. Finally, we use the behavioral history of the worms to investigate how the gentle touch response depends on movement prior to the stimulus and the location of previous stimuli. We find that the movement of the animals immediately prior to the stimulus does not affect the type of response, even for touches to the mid section of the body, which can result in either forward or reverse movement, suggesting that touch stimulus can "reset" the locomotory control circuit. However, the location of the previous touch does affect touch response, with an anterior touch biasing responses in the forward direction, and a posterior touch biasing responses in the reverse direction, suggesting location-dependence of touch habituation. The ability to deliver localized gentle and harsh touch stimuli to a large number of animals and record their behavioral output will facilitate further studies of C. elegans touch sensation, sensory adaptation, and nociception.