What is the best color meter for my project?

Hi everybody! I absolutely love doing projects with Arduino! Especially when they work! lol.
I am new to Arduino but already did some coding with stepper motor and LCD display etc.

My goal: I have different variations of the yellow color. I want to trigger a relay like the HL-52S when the yellow colored water in a transparent tube changes from dark yellow to light yellow.

Since all colors have an RGB number, I was thinking of adding RBG together after the sensor reads the color. for example, a strong yellow RGB 253+250+114 = 617 and a light yellow
RGB 255+250+200 = 709. So. I could code if RGB total > 700 turn on relay. So i found the TCS34725, TCS230, TCS3200, ISL29125. Which one should I buy? Thank you! Jimmy.

Color sensors shine known "colors" (frequencies) at an object and return the values of RGB sensed in the reflection. Your program would compare the returned values to known color ranges to determine the color.

Your example of an absolute value of color could be 1 + 1 + 248 = 250... blue and 1 + 248 + 1 = 250... green... which are very different... so your program would be " if > and <" for every returned value.

If you are looking for water "cloudiness," that would be a turbidity sensor.

Yeah... I'm not an expert on this but with a translucent fluid (or object) you'd normally want to measure the light going through it, rather than the reflected light. That would require a different kind of sensor.

Or, maybe you can just put a mirror or reflector on the opposite side, and of course, keep the whole thing in the dark so the sensor isn't "polluted".

You'll have to experiment to find the range of colors & numbers that are "good" or "bad".

Perceived color depends on illumination.

There are no absolutes for either the eye or any RGB color sensor, so you have to experiment to learn what works in your situation.

Thank you guys for the quick reply. My apology I should have been more specific. It is a small tube with salted water and 5 drops of reagent to measure chlorine. So I figured out how to automate the refill of the tube and put 5 drops using a peristatic pump. The round platic cylinder is probably not to work well but I could build a miniature glass rectangle to hold the liquid and stick a mirror behind if necessary. I wish there is a chlorineometer i can simply hookup to arduino and not have to put 5 drops of reagents each test cycle but I don't think such things exist. Chlorine monitoring system exist but $$$$$$ and do not have an output to trigger a relay. I hope this helps clarify what I intend to do. Thank you.

Solutions look yellow because they absorb blue light, and it is much more reliable to measure the absorption of blue light (for example, reduction of light from a blue LED), than to use a color sensor.

For better advice, tell us what test kit you are using. The absorbance spectrum of the colored product is very likely published somewhere.

Yes, I agree with this on the light through a fluid. You would need to measure the "light color" without the fluid and with the fluid simultaneously. My (poor) example was only looking at surface color.

The pulse oximeter sends light through tissue using two (dissimilar) transmitting LEDs to measure the color of blood.

Or buy cheap plastic cuvettes, standard 1 cm path length for absorbance measurements.

thank you great idea

wow you are over my head but thank you! OTO Orthotolidine made by JDE Pool Tools Inc. On the photo you can see that my pool water chlorine is high. according to the scale it looks like above 5.


The orthotolidine test result absorbs light in the blue region 400-490 nm, so will strongly absorb light from a blue (455 nm) LED. The darker the "yellow appearance" the more blue light absorbed.

It would be pretty straightforward to set up a quantitative test for that using an Arduino, a blue LED and a phototransistor.

Note, from Orthotolidine (OT) test and Orthotolidine – Arsenite (OTA) test | PSM Made Easy

The orthotolidine test, however, is not accurate, because the impurities such as iron, manganese, nitrate etc., are likely to cause a false yellow color, and indicating wrong and increased chlorine residual

Try using a different test (like OTA) to cross check your apparent high reading.

1 Like

jremington thank you so much for all the help. I am pretty sure i saw a phototransistors and a blue led in the arduino kit. I have 2 arduino. Uno and Mega2560. I would love to try your suggestion if you help me with the code and what we are testing. I am a quick learner but what is “straightforward “ for you is a challenge for me. It’s bed time but first thing tomorrow morning I will report back if I have the phototransistors and a blue LED. Thank you. Greatly appreciated. Jimmy.

As its pool water the clarity may vary. Will you filter it before testing?

To achieve your goal of triggering a relay when the yellow-colored water in a transparent tube changes from dark yellow to light yellow, you'll need a color sensor that can accurately detect changes in the yellow color spectrum. Among the sensors you mentioned (TCS34725, TCS230, TCS3200, ISL29125), the TCS34725 is a good choice for this application due to its wide color range and high resolution.
Moreover TCS34725 having features of Integration Time Control and I2C communication make it relatively easy to interface Arduino like Micro controllers

Thank you 1li for your help.

Hello johnerrington it is filter and very clean/clear. thank you

Hello jremington. Please look at this picture. I think what looks like a black LED is a phototransistor. I don't have a blue LED but could buy one tomorrow (it is Sunday here). Can I test anything today with what I have? Thank you!

To make sense of tests, you really do need data sheets for the parts. What you call the "black LED" could be an IR photodiode or a phototransistor, but the black-appearing plastic will absorb blue light while transmitting IR light.

A standard photodiode or any of the color sensors will work for measuring the absorbance of blue light. First measure the blue light value "R" for reference (pure water in your container), then measure the blue light value "S" for the sample.

The yellow dye concentration is proportional to log(R/S). See https://chem.libretexts.org/Bookshelves/Analytical_Chemistry/Molecular_and_Atomic_Spectroscopy_(Wenzel)/1%3A_General_Background_on_Molecular_Spectroscopy/1.2%3A_Beers_Law

Thank you Sir for the explanation. I just setup a quick test to turn a led on when the phototransistor is obscure. But now I understand what you are saying. I'll do my best to write that code. (remember I am a newbee!) I'll report back Thank you a lot! Jimmy

I "think" I am on the right track. So I was able to program to, first record once the reading of the light perceived by the phototransistor. then after putting 5 drops I'll compare with initial reading and determine if the change is insignificant, then i will turn on the relay. but this is where I am now. Not sure if it is sensitive enough but it is my next step. I am just happy I can write a small program to display the value on the serial monitor. ok more later thank you.