It is an example of a reflex action. The stimulus in this example is pain which is felt by the foot on touching the drawing pin. This pain is sensed by a receptor in the foot. The receptor triggers an impulse to a sensory neuron which transmits the message to the spinal cord. Here, the impulse is passed on to a relay neuron which, in turn, passes it to a motor neuron. The motor neuron passes the impulse to a muscle in the foot. The muscle, then, contracts and pulls the foot away from the drawing pin.