I'm working on a hydroponic water quality testing system for school. I'm using an Arduino Uno, and Matlab if possible, though I am working right now in between Arduino IDE and Matlab just to get the sensor working. I've become a bit experienced in matlab and wiring for this, but I'm really mostly just beginning. I'm posting this most places and forums I can just so I can reach as many people and get as many solutions as I can. I'll try to explain as simply as possible.
I recently purchased a SKU:SEN0169 Analog pH Pro sensor linked here: Gravity: 7/24 Industrial Analog pH Meter for Arduino - DFRobot . In the process of getting it to work for my hydroponic project, I have encountered several issues and am unsure on how to obtain the correct values. I followed the calibration to the best of my ability, but when testing in both Arduino IDE and Matlab, it has been returning values that have not made appropriate sense. I have had access to a solution that should be 7.00 pH and another that is 2.5 (working on getting one that is 4.0 per the calibration instructions).
When putting the sensor in distilled water (ph 7.00) I have read voltages of approximately 1.73 (depending on potentiometer adjustment and water purity it varies by a few tenths) and when placed in vinegar it reads 1.49 (+/- a few tenths). I have tried to follow the instructions and either short it or when in water adjust the offset but it has had little effect when not shorting the BNC connector. Likewise adjusting the potentiometer only moves the resulting pH closer to 7 and farther from 2.5 or closer to 2.5 and further from 7. Effectively when using the code provided on the wiki page, the pH sensor is not returning the appropriate values for either solution. It can get it for one (with adjustments) but not both.I have tried many different coding solutions whether it be using different offsets or scaleFactors.
I have tried getting my own slope values from the values I have obtained but it still has had little impact. Either way, I cannot get accurate values for 2 solutions to appropriately calibrate it for anything in-between.
When using different wires, Arduino boards, computers, or IDEs it returns similar values so it is likely not an issue with the sensor, but the initial values it is returning are not applicable for the calibration instructions (wants a <=0.3 difference from 7 in the water solution when the pH is at least 1 or 1.5+ pH increments from 7). I would greatly appreciate any recommendations you all might have or especially if anyone has faced this problem, and I can try to provide more information if needed.
Here is the wiki page with arduino calibration code, any tips for doing this in matlab would be great.
Really appreciate it, thanks in advance.