One central goal of mechanobiology is to understand the reciprocal effect of mechanical stress on proteins and cells. Despite its importance, the influence of mechanical stress on cellular function is still poorly understood. In part, this knowledge gap exists because few tools enable simultaneous deformation of tissue and cells, imaging of cellular activity in live animals, and efficient restriction of motility in otherwise highly mobile model organisms, such as the nematode Caenorhabditis elegans. The small size of C. elegans makes them an excellent match to microfluidics-based research devices, and solutions for immobilization have been presented using microfluidic devices. Although these devices allow for high-resolution imaging, the animal is fully encased in polydimethylsiloxane (PDMS) and glass, limiting physical access for delivery of mechanical force or electrophysiological recordings. Recently, we created a device that integrates pneumatic actuators with a trapping design that is compatible with high-resolution fluorescence microscopy. The actuation channel is separated from the worm-trapping channel by a thin PDMS diaphragm. This diaphragm is deflected into the side of a worm by applying pressure from an external source. The device can target individual mechanosensitive neurons. The activation of these neurons is imaged at high-resolution with genetically-encoded calcium indicators. This article presents the general method using C. elegans strains expressing calcium-sensitive activity indicator (GCaMP6s) in their touch receptor neurons (TRNs). The method, however, is not limited to TRNs nor to calcium sensors as a probe, but can be expanded to other mechanically-sensitive cells or sensors.