New Led detection algorithm