PH Meter

From ProjectWiki
Revision as of 03:13, 3 March 2008 by Eris (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

pH Meter

Errata

Probe

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

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

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.

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. 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 peing pH of 14 and +7 being pH of 0. Wha is needed is for this voltage to be inverted and offset, and bothe those tasks are accomplshed using op-amp-u1b. The output at this stage should be 0 to 14FV indicating the pH of the sample being tested.

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,m_cfg.phdelay);
	meterSave(); // save settings to eeprom
}
 
/* calibrate ph to 4.0 solution */
void c_scalePh(void) {	
	m_cfg.phscale=((long)(delayADC(ADC_CH1,m_cfg.phdelay)-m_cfg.phoset)*10000)/-300;
	meterSave(); // save settings to eeprom
}
 
void c_readPh(void) {
	long pH;
	pH=((long)(delayADC(ADC_CH1,m_cfg.phdelay)-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));
}
Personal tools
irssi scripts
eggdrop scripts