Header banner
Revain logoHome Page
Brent Porter photo
1 Level
1276 Review
40 Karma

Review on πŸ”¬ CQRobot Ocean-Friendly Scientific Laboratory Solution by Brent Porter

Revainrating 3 out of 5

Need documentation and better sample Code

This sensor generates an analog signal that is measured by the ADC port and Arduino. If you are using a Raspberry Pi you will need an external ADC board. CQRobot provides a board that does this and the code sample shows how to use it with Python code. I have a very reliable TDS meter that I use because we have very hard water (690-700ppm). I took four measurements on the water I had on hand: 1) no water, 2) 100% reverse osmosis filtered water, 3) 50% filtered water with 50% tap water, and 4) 100% tap water. The results are as follows: 1) Actual 0ppm => Measured 0ppm (without water) (0.00V, 20.06C) 2) Actual 26ppm => Measured 63ppm (reverse osmosis) (0.14V, 21, 56 C) 3) Actual 343 ppm => Measured 606 ppm (1.13 V, 17.37 C)4) Actual 691 ppm => Measured 1720 ppm (hard tap water) (2.50 V, 20.31 C ) As you can see, the results do not all agree. The code example uses a third-order polynomial to calculate PPM, but does not provide any details or explanation. The formula also includes temperature compensation. In the example code, this default value is 25 Β°C, which essentially corresponds to a compensation value of 0. I added a temperature sensor to the circuit and used actual water temperature to compensate. I did this with a waterproof DS18B20 (Dallas Temperature One Wire) sensor and placed the sensor in water samples. Unfortunately, the results were very inaccurate. Since there is no documentation on how the device works, I can't verify if there are any bugs in the code. I suspect there might be problems with the code because it fails to compile. It has an incorrect parenthesis found on a line that looks like this: if (millis() - AnalogSampleTimepoint > 40U) //read the analog value from the ADC every 40 milliseconds { The square bracket at the end of this line is a hidden comment and needs to be moved to the next line itself. After that, the code works as intended. This syntax error indicates that the code has not been thoroughly tested. I give this device three stars because it is well designed. The supplied cables are good, the board is of high quality. As this is an analog device I suspect the code can be corrected for an accurate measurement either by a vendor providing more details or by performing a calibration on known samples. This device can be calibrated in two ways by creating samples. Option one: carefully weigh the salt and mix it with distilled or deionized water. Measure the analog output voltage of the sensor for each sample. There are links on the internet that will help you calculate the ratio between gram weight and ppm value. The second way is to mix different amounts of filtered water and tap water to get samples with different ppm values. Measure each sample with a TDS meter. Read the voltage from the sensor for each sample, then create a linear or polynomial curve and use this formula to convert the analog voltage to a ppm value in your code. This method assumes you have access to a trusted TDS meter. Either way, it's a lot of work and may not end up being worth the effort unless you really need a TDS meter integrated into your project.

Pros
  • AC drive source: effectively prevent probe polarization, waterproof probe.
Cons
  • High Price