A method for detecting molecules of a particular substance by means of an optical sensor, the method comprising: - bringing the sensor into contact with a fluid to be analyzed, - coupling light of a first wavelength (λ 1) into an optical resonator of the sensor, the resonator being covered at least partially with an active layer of a covering material for selectively adsorbing a group of substances comprising the substance to be detected, - coupling light of a second wavelength (λ 2) into the same resonator or into a second optical resonator of the sensor, the second resonator being covered at least partially with an active layer of the same covering material, wherein a difference between the first wavelength (λ 1) and the second wavelength (λ 2) is at least one order of magnitude larger than a spacing between adjacent resonances of the resonator or of the resonators (3, 3') at the respective wavelength (λ 1, λ 2), - detecting, for each of the first and the second wavelengths (λ 1, λ 2), an optical signal coupled out of an optical path containing the respective resonator (3, 3'), - varying, for each of the first and the second wavelengths (λ 1, λ 2), an optical length of the respective resonator (3, 3') or the respective wavelength (λ 1, λ 2) such that an interval comprising at least one resonance of the respective resonator (3, 3') is scanned, - detecting, for each of the first and the second wavelengths (λ 1, λ 2), a broadening of this resonance indicating an absorption of the light fed into the respective resonator (3, 3') by molecules accumulated at the active layer of this resonator (3, 3') and - identifying whether the fluid contains molecules of the substance to be detected in a significant concentration depending on whether a broadening exceeding a certain threshold is detected only for the first wavelength (λ 1) or only for the second wavelength (λ 2) or for both wavelengths (λ 1, λ 2). - bringing the sensor into contact with a fluid to be analyzed, - coupling light of a first wavelength (λ 1) into an optical resonator of the sensor, the resonator being covered at least partially with an active layer of a covering material for selectively adsorbing a group of substances comprising the substance to be detected, - coupling light of a second wavelength (λ 2) into the same resonator or into a second optical resonator of the sensor, the second resonator being covered at least partially with an active layer of the same covering material, wherein a difference between the first wavelength (λ 1) and the second wavelength (λ 2) is at least one order of magnitude larger than a spacing between adjacent resonances of the resonator or of the resonators (3, 3') at the respective wavelength (λ 1, λ 2), - detecting, for each of the first and the second wavelengths (λ 1, λ 2), an optical signal coupled out of an optical path containing the respective resonator (3, 3'), - varying, for each of the first and the second wavelengths (λ 1, λ 2), an optical length of the respective resonator (3, 3') or the respective wavelength (λ 1, λ 2) such that an interval comprising at least one resonance of the respective resonator (3, 3') is scanned, - detecting, for each of the first and the second wavelengths (λ 1, λ 2), a broadening of this resonance indicating an absorption of the light fed into the respective resonator (3, 3') by molecules accumulated at the active layer of this resonator (3, 3') and - identifying whether the fluid contains molecules of the substance to be detected in a significant concentration depending on whether a broadening exceeding a certain threshold is detected only for the first wavelength (λ 1) or only for the second wavelength (λ 2) or for both wavelengths (λ 1, λ 2).