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:,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?


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...


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.