PH Meter

From ProjectWiki
Jump to: navigation, search

pH Meter

Contents

What is this?

Here is a simple pH meter that uses standard pH probes. This is a quick unfinished afterthought to the PPM_Meter article. (u_u~feel free to make additions or corrections.) It describes how to use a standard and pretty cheap (like $10-$40) pH meter probe and make a simple meter or microcontroller interface.

Probe

Typical pH Probe

A pH probe works something like a little battery powered by the test solution. In a neutral solution the pH probe would generate 0v. An acidic sample would generate a positive voltage proportional to the ionic strength of the sample being measuring. A basic solution does the same except resulting in a negative voltage output.

So, a standard pH Probe generates a voltage either positive or negative proportional to the acidity or alkalinity (baseyness) of whatever its testing.

It does this using this fascinating thing called Glass Electrode. It has this little ball (see pic!) at the tip with a special pH glass. The probe's output is fed through a shielded cable into the amplifier. Shielding is needed because the extremely low voltages and currents involved are easily are susceptible to noise.

The output of this probe is very small, very low current (extremely high impedance), varies a lot between probes (even by the same manufacturer) and is affected by the room temperature. It requires additional circuitry process the signal and give some type of usable output.

Ok, so why not just MAKE a pH probe?? Good question! Tbhnfirly. Seem to remember something about using two dissimilar metals to power a clock from potatoes which seems as if it may work, have not actually tried it... ~_~

Amplifier

The circuit here will allow adjusting for probe and temperature variants and produce output in Volts/pH or ADC compatible ranges.

  • Volts/pH configuration: output will be between 0 and 14Volts with the voltage directly representing the pH value. (Such as: 3.4volts out would equal pH of 3.4) This is most useful if you want to plug it directly into a volt meter.
  • ADC configuration: output will be between 0 and 5V for interfacing with an ADC or microcontroller's input range.

It uses op-amp U1a to amplify and buffer the high impedance signal from the probe and adjust the slope which is done by adjusting the gain loop. The output of this stage if adjusted properly would be beetween -7v to+7v with -8 being pH of 14 and +7 being pH of 0. What is needed is for this voltage to be inverted and offset, and both those tasks are accomplished using op-amp-u1b. The output at this stage should be 0 to 14FV indicating the pH of the sample being tested.

Prolly should note that the circuit has no AC noise limiting, this could be a problem if the probe is located near electromagnetic sources such as pump motors. If you get sporadic readings might try a .1uF or so capacitor across R3. Being in the gain loop of U1b it will work as a integrator and easily pass DC such as the probe reading, while nullifying AC signals. Capacitor C1 was added to the circuit diagram for this function. :D

Microcontroller Stuffs

If using in ADC mode, you can use the microcontroller to scale/offset. just set the offset a little above 0v and set 7pH to be about 2.5v. Then use the controller to sample the offset and scale test solutions, then calculate the ph of test sample. Like this for fixed point maths:

/* zero (7pH) ph meter */
void c_zeroPh(void) {
	m_cfg.phoset=delayADC(ADC_CH1);
	meterSave(); // save settings to eeprom
}
 
/* calibrate ph to 4.0 solution */
void c_scalePh(void) {	
	m_cfg.phscale=((long)(delayADC(ADC_CH1)-m_cfg.phoset)*10000)/-300;
	meterSave(); // save settings to eeprom
}
 
void c_readPh(void) {
	long pH;
	pH=((long)(delayADC(ADC_CH1,)-m_cfg.phoset)*10000/m_cfg.phscale)+700; // read the results
	printf("pH: %2i.%02i\r\n",(int)pH/100,(int)pH-(int)((pH/100)*100));
}

Temperature Compensation

Really need to add temp compensation to this project. seems to change by about .10pH for ever 5F change in temp. Need to research this more.

Personal tools
irssi scripts
eggdrop scripts