A method for detecting a distance to an object, comprising: providing a lighting system having at least one pulsed visible-light source for illumination of a field of view; emitting at least one pulse of an illumination signal for illuminating said field of view for a duration of time y, using said visible-light source at a time t, said time t typically being a center of a transition from a non-illuminated state to an illuminated state of said field of view; starting an optical sensor for detecting reflection of said illumination signal and integrating a reflection energy, of said reflection of said illumination signal, for a first time period at a time t-x of a first one of said at least one pulse; stopping said optical sensor for said first time period at a time t+x for said first one of said at least one pulse, and determining a first integration value for said first time period; starting said optical sensor for integrating said reflection energy, captured by said visible-light source, of said reflection of said illumination signal, for a second time period at a time t+y-x for a given one of the at least one pulse, said given one being the first one or another one of the at least one pulse; stopping said optical sensor for said second time period at a time t+y+x for the given one of the at least one pulse and determining a second integration value for said second time period; calculating a difference value between said first integration value and said second integration value; determining a propagation delay value proportional to said difference value; determining said distance to said object from said propagation delay value; characterized in that the method further comprises: measuring a background integration value for non-negligible illumination background from other lighting sources during an integration time t-x to t+x when said source is not emitting; subtracting from each said first integration value and said second integration value said background integration value prior to said calculating a difference; providing a threshold distance to a pre-identified object; comparing said distance to said object with said threshold distance; determining said object to be said pre-identified object if said comparison is positive; wherein said pulsed visible-light source is a pulse width modulated visible-light source, and when said x is greater than said y, said integrating being larger than a width of the pulse, the method further comprises switching a synchronisation of said illumination signal with said starting said optical sensor. providing a lighting system having at least one pulsed visible-light source for illumination of a field of view; emitting at least one pulse of an illumination signal for illuminating said field of view for a duration of time y, using said visible-light source at a time t, said time t typically being a center of a transition from a non-illuminated state to an illuminated state of said field of view; starting an optical sensor for detecting reflection of said illumination signal and integrating a reflection energy, of said reflection of said illumination signal, for a first time period at a time t-x of a first one of said at least one pulse; stopping said optical sensor for said first time period at a time t+x for said first one of said at least one pulse, and determining a first integration value for said first time period; starting said optical sensor for integrating said reflection energy, captured by said visible-light source, of said reflection of said illumination signal, for a second time period at a time t+y-x for a given one of the at least one pulse, said given one being the first one or another one of the at least one pulse; stopping said optical sensor for said second time period at a time t+y+x for the given one of the at least one pulse and determining a second integration value for said second time period; calculating a difference value between said first integration value and said second integration value; determining a propagation delay value proportional to said difference value; determining said distance to said object from said propagation delay value; measuring a background integration value for non-negligible illumination background from other lighting sources during an integration time t-x to t+x when said source is not emitting; subtracting from each said first integration value and said second integration value said background integration value prior to said calculating a difference; providing a threshold distance to a pre-identified object; comparing said distance to said object with said threshold distance; determining said object to be said pre-identified object if said comparison is positive; wherein said pulsed visible-light source is a pulse width modulated visible-light source, and when said x is greater than said y, said integrating being larger than a width of the pulse, the method further comprises switching a synchronisation of said illumination signal with said starting said optical sensor.