Mammals acquire much of their sensory information by actively moving their sensory organs. Rats, in particular, scan their surrounding environment with their whiskers. This form of active sensing induces specific patterns of temporal encoding of sensory information, which are based on a conversion of space into time via sensor movement. We investigate the ways in which object location is encoded by the whiskers and decoded by the brain. We recorded from first-order neurons located in the trigeminal ganglion (TG) of anaesthetized rats during epochs of artificial whisking induced by electrical stimulation of the facial motor nerve. We found that TG neurons encode the three positional coordinates with different codes. The horizontal coordinate (along the backward-forward axis) is encoded by two encoding schemes, both relying on the firing times of one type of TG neuron, the 'contact cell'. The radial coordinate (from face outward) is encoded primarily by the firing magnitude of another type of TG neurons, the 'pressure cell'. The vertical coordinate (from ground up) is encoded by the identity of activated neurons. The decoding schemes of at least some of these sensory cues, our data suggest, are also active: cortical representations are generated by a thalamic comparison of cortical expectations with incoming sensory data.