Currently I am doing a project by referring to "Make: Liquid ID Spectrometer" (http://creative-technology.net/MAKE.html). From his code, I understand that the values of intensity from different LEDs will be recorded and then compare with the set of values in array of different liquids that already defined in the source code. Now I am having a problem that the values read from the phototransistor are not stable or even within the range of number, and hence I am unable to identify the liquid based on the defined array values. Besides, is it this is the correct way in order to read the intensity and identify the liquid type?
Someone had told me about the statement below:
Phototransistor will give different value when:
- Different distance
- Intensity of light ie 1 led on, 2 led on etc
- Disturbance between light n IR ie different liquid, rough food etc
I understood about this concept. But, I come out a question that will be values of intensity read by phototransistor for Sample A same with other samples if I just assign all LEDs light up together. Is there possible?
I had modified the wiring and source code based on my requirement. I am not sure what mistakes that I had been made. I am wondering that is there possible the values obtained are unstable due to wrong setup for the phototransistor. Here I attached my wiring diagram, placement of LEDs and phototransistor, and source code.
Lastly, thanks for your time to read and answer my concerns.
detector-with-LCD.ino (8.3 KB)

