help with ph meter\ TDS

Hello, I'm trying to build a hydrophonic irrigation computer system. One of the properties I need to measure is PH and/or TDS (Todal Disolved Solids). For the TDS I already found I can use a voltage divider and extrapolate the data I need. PH however is proving much more tricky. Aside from using pre-built sensors such as:

http://www.aliexpress.com/item/DFRobot-100-Genuine-Analog-pH-Meter-Kit-Compatible-with-arduino-for-Water-quality-testing-Aquaculture-etc/32486002798.html?spm=2114.01010208.3.1.PfUSKp&ws_ab_test=searchweb201556_8,searchweb201602_1_10017_10034_10021_507_10022_10020_10009_10008_10018_10019,searchweb201603_2&btsid=652a1b50-0f9f-4fda-8d36-81b24943ade5

which are costly, can anyone help out with the code or other sensors I could use?

Thanks!

Hi, Most of the data you need to use when coding for the pH meter you showed is included in the page. The sensor range is 0-14PH. Since the sensor works on an analog 5V output, that range is divided on 5V. Meaning you can calibrate by multiplying the reading you get from your arduino by the calibration constant, in this case (14/1023) PH/mV.

so the code would be along the lines of pH=analogRead(A0)*14.0/1023.0; where pH is a float variable and the output from the sensor is connected to the Analog 0 port.

I can see that the sensor you linked has a potentiometer that adjusts gain. I would really recommend you try using some sort of saline buffer solution in order to proberly calibrate your pH sensor.

Thanks, where can I find such a solution?

ariello: Thanks, where can I find such a solution?

It's very common, you could try a simple search at the very same site you posted...

Here:

http://www.aliexpress.com/item/2-bags-PH-Buffer-Powder-for-PH-Test-Meter-Measure-Calibration-Solution-50pcs-4-01-and/32321072387.html?spm=2114.01010208.3.19.BTBoSg&ws_ab_test=searchweb201556_8,searchweb201602_3_10017_10034_10021_507_10033_10022_10032_10009_10020_10008_10018_10019,searchweb201603_7&btsid=ac4f2171-a852-4ee2-a8fa-c1f6a25aabaf

I can't think of an alternate way to measure pH, without using premade sensors.

Take in account that if you leave the sensor in water for long time water will enter inside the probe from the little hole, covered with ceramic filter, that there is on the probe that is used to have an electrical connection between the probe and the fluid you are measuring. The contamination time depend on many factors, the main is the water content. There are probes that are builded for longer contamination time (for example, some of them are big so the contamination take long time) but they are not cheap. I heard about solid state pH probes but I don't know if they are prototype or commercial product.