A sensor for generating an output signal for detecting a limit level of a medium, a filling level of the medium, and/or for differentiating between different media, wherein the sensor comprises: a processing unit for processing a measurement signal which was generated using the sensor, and a reference unit for generating a reference signal; wherein the measurement signal comprises a periodic AC voltage signal or wherein the measurement signal is a periodic AC voltage signal; wherein the processing unit is configured to perform temperature compensation using the reference signal; wherein the processing unit and the reference unit each have a signal conversion unit (601, 602) providing temperature-dependent signal conversion, wherein the signal conversion units (601, 602) are thermally coupled to one another; wherein said temperature compensation comprises compensating for the temperature dependency of the signal conversion unit of the processing unit using the thermal coupling; characterized in that the sensor is configured such that (a) and/or (b) is true: (a) the reference unit receives an input signal which is a substantially temperatureindependent DC voltage signal, the reference unit generating the reference signal as a function of the input signal, the reference signal being a DC voltage signal; and/or (b) the measurement signal has an AC voltage component and a DC voltage component and/or a DC voltage component is added to the measurement signal using a circuit of the sensor. a processing unit for processing a measurement signal which was generated using the sensor, and a reference unit for generating a reference signal; wherein the measurement signal comprises a periodic AC voltage signal or wherein the measurement signal is a periodic AC voltage signal; wherein the processing unit is configured to perform temperature compensation using the reference signal; wherein the processing unit and the reference unit each have a signal conversion unit (601, 602) providing temperature-dependent signal conversion, wherein the signal conversion units (601, 602) are thermally coupled to one another; wherein said temperature compensation comprises compensating for the temperature dependency of the signal conversion unit of the processing unit using the thermal coupling; characterized in that the sensor is configured such that (a) and/or (b) is true: (a) the reference unit receives an input signal which is a substantially temperatureindependent DC voltage signal, the reference unit generating the reference signal as a function of the input signal, the reference signal being a DC voltage signal; and/or (b) the measurement signal has an AC voltage component and a DC voltage component and/or a DC voltage component is added to the measurement signal using a circuit of the sensor. (a) the reference unit receives an input signal which is a substantially temperatureindependent DC voltage signal, the reference unit generating the reference signal as a function of the input signal, the reference signal being a DC voltage signal; and/or (b) the measurement signal has an AC voltage component and a DC voltage component and/or a DC voltage component is added to the measurement signal using a circuit of the sensor.