The nematode C. elegans is an excellent model organism for studying behavior at the neuronal level. Because of the organism's small size, it is challenging to deliver stimuli to C. elegans and monitor neuronal activity in a controlled environment. To address this problem, we developed two microfluidic chips, the 'behavior' chip and the 'olfactory' chip for imaging of neuronal and behavioral responses in C. elegans. We used the behavior chip to correlate the activity of AVA command interneurons with the worm locomotion pattern. We used the olfactory chip to record responses from ASH sensory neurons exposed to high-osmotic-strength stimulus. Observation of neuronal responses in these devices revealed previously unknown properties of AVA and ASH neurons. The use of these chips can be extended to correlate the activity of sensory neurons, interneurons and motor neurons with the worm's behavior.