Sensory Organs
Roundworms' entire bodies are covered with sensory hairs and papillae, which are tiny nipple-like structures. Together, these organs give the roundworm a sense of touch. On the head, there is a pair of pits or small cavities called amphids, which work as chemoreceptors. A chemoreceptor is a sensory organ that detects chemicals; taste buds, for example, are a type of chemoreceptor. Certain roundworm species have darkened spots resembling eyes, but scientists are unsure as to whether these are sensory organs.
Nervous System
Roundworms have four main nerves that run the length of their bodies. The dorsal nerve, which runs along the "back" of the roundworm, controls muscle movement. The lateral nerves, which run on either side of the roundworm, transmit sensory information. The ventral nerve, which runs along the underside or abdomen, combines both motor control and sensory input.
The Nematode "Brain"
The four primary nerves meet in a circular ring of nerves near the "head" of the animal, forming a rudimentary brain. It is here that sensory stimuli is translated into motor responses, causing the roundworm to move away from danger or toward food or mates.