The touch sensor is a sensor that detects contact with objects in the robot's environment. The touch sensor reports to the RCX if its button is pressed or not pressed.

The touch sensor acts like a light switch in your house. When the button is pressed, this closes an electrical circuit and lets electricity flow through the sensor. The RCX detects this electrical flow and knows that the button has been pressed. When the button is out, the circuit is broken and no electricity flows. It is important to connect the cable to the touch sensor in the correct way. This image shows the right way to connect the cable to the touch sensor.
This image shows the wrong way to connect the cable to the touch sensor.
Just for fun: What are all the ways that you can think of using a touch sensor on your robot?

See Also: Sensors, Programming: Touch sensor