Color sensor can't tell between green and black?

Hello there!

I am using a LDR and a green LED on my line following robot to detect green circles in the path... The sensor is able to detect green on most surfaces. However, the sensor values for green and black are very similar making it difficult to reliably differentiate between the two colors.

This is crucial for the robot and i was just wandering if someone might know a possible solution of some sort.

Thank you!

What if you put a green filter in front of the LDR? Or try to find an LDR (photo transistor...) with higher sensitivity to green light?

A black surface is not always as black as you think. A shiny black surface may better reflect green light than absorb it.

Eventually you can use two LEDs, a red and a green one, turn on one of both alternatively, and find out which color is reflected better.