Animals employ multiple mechanisms to detect the presence and location of environmental stimuli. Recent work suggests that Caenorhabditis elegans uses chemosensory information provided by spatially distinct sensilla to generate a sensory map of its environment and to avoid noxious compounds.