Good day comrades!
I and a few friends are currently constructing a simple Arduino mechanism to determine the turbidity and pH levels of particular liquids, but thus far we have encountered a singular, glaring issue—the turbidity values discerned are always wrong. For instance, when used on clean water, whose turbidity value should only be between 0 and 2), the LED display shows negative 40. These values don’t show any orderly pattern as well, and are random, with the only constant being their negativity (-35, -76, &c.). Could this be an issue with the sensor (DFRobot Analog Turbidity Sensor) itself or with our code? The code file is linked below. We would appreciate it very much if someone could review our codes and tell us what the problem is. Many thanks!
P. S. Our pH levels are erroneous as well, though in a much more “consistent” manner, if you will. The detected values always get a deduction of 40, no matter what they are. 7 becomes -33, 10 becomes -30, and so on.


