Method and apparatus for attaching a sensor

There are a method and a device for fastening a sensor, in particular a stereo camera in motor vehicles, proposed in which by means of the dimensions of the sensor having teaching and optionally with the aid of pins, which act in corresponding recesses of the retaining element of the sensor, an accurate orientation of the retaining element of the sensor is achieved during assembly.