I'm trying to measure the color of a fluid within a see-through PVC tube used for patients' fluids. Per ethical regulations, I cannot use anything that has to touch the fluid to measure it.
But the shape and the illumination system of TCS3200 don't suit my needs. After removing the LEDs, I tried shining light through filters to measure it, and it worked as intended.
So I want to design a 3D-printed case that will fit the tube in the middle, running fluid through it. Light source on one side, and the sensor on the other. What do you think the best distance would be for PVC-sensor distance and PVC-light source distance? I have access to the tube sample to run in vitro experiments on for troubleshooting.
This case will also be useful for blocking any external light sources...
And while on the topic, is there a "better" color sensor with higher resolution(?) or accuracy?
I think the distance is irrelevant. The important thing is that intensity of the light received by the sensor is within its working range. If it is too weak, the sensor readings will have poor resolution. If it is too strong, the sensor will be saturated and give incorrect readings.
I think too strong is the more likely problem. The sensor was designed to pick up reflected light, which is always going to be significantly less than direct light over the same distance with the same emitters and sensor. You will need to experiment with the current limiting resistors for the emitter LEDs to ensure that when the tube is empty, you don't saturate the sensor.
The TCS3200 chip has no illumination system, it's just a chip. I assume you mean a module of some design which has illuminator LEDs and the chip on it. Do you plan to remove the LEDs and extend their wires to the other side of the pipe? You may only need 1 LED for that, most module designs have 4. You can add an extra resistor into that wire, if needed.