We are designing a system that will detect the color of non luminary objects that are passing a sensor. We purchased the SparkFun Tristimulus Color Sensor - OPT4048DTSR (Qwiic) (sku: SEN-22638) to serve this function, but it doesn’t seem to detect the color of non luminary sources. Is there something to be done in order to use this sensor to detect reflected color, or is there another sensor that can be used to detect the color of non illuminated objects. The sensor can detect the color of a back lit screen but cannot detect the color of non illuminated objects.
So, the main issue is the OPT4048 is an ambient light sensor, not a reflective color sensor. According to the datasheet :
“The OPT4048 measures the color properties of the light source that illuminates the device” (Section 8.1 Overview)
“The OPT4048 is designed for systems that require light level detection to enhance user experience by providing information not only about the intensity, but the color of the light source” (Section 5 Description)
So it sounds like it might not suit your use-case as-is.
If you added a controlled light source of known wavelength/intensity and shone it at 45 degree angle you could convince the unit to interpret reflected light, but you need a controlled source, which can be very tricky (but using things like light boxes + LED + using the interrupt pin to sync readings can make it possible)
We went with a different DFRobot product, SEN010, which has a built in illuminant. Long term plan is to use PIC as the microcontroller to use as I2C slaves