The invention provides an anti-biofouling system (200) comprising an UV-emitting element (210), wherein the UV-emitting element (210) comprises a UV radiation exit window (230), wherein the UV-emitting element (210) at least partly encloses a light source (220) configured to provide UV radiation (221), wherein the UV radiation exit window (230) is configured to transmit at least part of the UV radiation (221) of the light source (220), wherein the UV radiation exit window (230) comprises an upstream window side (231) and a downstream window side (232), wherein the UV-emitting element (210) also at least partly encloses an optical sensor (310) configured to sense radiation (421) emanating from the downstream window side (232) and configured to provide a corresponding optical sensor signal, wherein the anti-biofouling system (200) is further configured to provide said UV radiation (221) in dependence of said optical sensor signal