Sensor and method for its production