A method for operating an optical sensor having a semiconductor transmitting element (9) which emits light rays and a semiconductor receiving element (10) onto which the emitted light rays are guided where the emitted light rays penetrate an absorption section filled with liquids or gaseous medium, characterized by the following methods steps:
- realizing reference measurements with known dye concentrations or particle concentrations during a calibration operation, using reference media arranged in the absorption section, for determining a sensor-specific and dye-specific and/or particle-specific reference extinction value Ecal;
- subsequently determining extinction values Emeas that form actual measuring variables for liquid or gaseous media arranged in the absorption section;
- and, following this, determining the dye concentration or particle concentration in the respective liquid or gaseous medium by relating the measured extinction value Emeas to the reference extinction value Ecal,
- where the reference extinction value is formed according to the equation Ecal=1 g (Io/Ical), wherein Io and Ical represent the signals received at the semiconductor receiving element (10) for a dye-free and/or particle-free reference medium arranged in the absorption section and a reference medium with a predetermined dye concentration and/or particle concentration Ccal of the dye and/or particles to be determined.