com.phidgets
Class PHSensorPhidget

java.lang.Object
  extended bycom.phidgets.Phidget
      extended bycom.phidgets.PHSensorPhidget

public final class PHSensorPhidget
extends Phidget

This class represents a Phidget PH Sensor. All methods to read pH data from the PH Sensor are implemented in this class.

The Phidget PH Sensor provides one standard pH sensor input.

Author:
Phidgets Inc.

Field Summary
 
Fields inherited from class com.phidgets.Phidget
PHIDCLASS_ACCELEROMETER, PHIDCLASS_ADVANCEDSERVO, PHIDCLASS_ANALOG, PHIDCLASS_BRIDGE, PHIDCLASS_ENCODER, PHIDCLASS_FREQUENCYCOUNTER, PHIDCLASS_GPS, PHIDCLASS_INTERFACEKIT, PHIDCLASS_LED, PHIDCLASS_MOTORCONTROL, PHIDCLASS_NOTHING, PHIDCLASS_PHSENSOR, PHIDCLASS_RFID, PHIDCLASS_SERVO, PHIDCLASS_STEPPER, PHIDCLASS_TEMPERATURESENSOR, PHIDCLASS_TEXTLCD, PHIDCLASS_TEXTLED, PHIDCLASS_WEIGHTSENSOR, PHIDGET_LOG_CRITICAL, PHIDGET_LOG_DEBUG, PHIDGET_LOG_ERROR, PHIDGET_LOG_INFO, PHIDGET_LOG_VERBOSE, PHIDGET_LOG_WARNING, PHIDID_ACCELEROMETER_2AXIS, PHIDID_ACCELEROMETER_3AXIS, PHIDID_ADVANCEDSERVO_1MOTOR, PHIDID_ADVANCEDSERVO_8MOTOR, PHIDID_ANALOG_4OUTPUT, PHIDID_BIPOLAR_STEPPER_1MOTOR, PHIDID_BRIDGE_4INPUT, PHIDID_ENCODER_1ENCODER_1INPUT, PHIDID_ENCODER_HS_1ENCODER, PHIDID_ENCODER_HS_4ENCODER_4INPUT, PHIDID_FREQUENCYCOUNTER_2INPUT, PHIDID_GPS, PHIDID_INTERFACEKIT_0_0_4, PHIDID_INTERFACEKIT_0_0_8, PHIDID_INTERFACEKIT_0_16_16, PHIDID_INTERFACEKIT_0_8_8_w_LCD, PHIDID_INTERFACEKIT_2_2_2, PHIDID_INTERFACEKIT_4_8_8, PHIDID_INTERFACEKIT_8_8_8, PHIDID_INTERFACEKIT_8_8_8_w_LCD, PHIDID_IR, PHIDID_LED_64, PHIDID_LED_64_ADV, PHIDID_LINEAR_TOUCH, PHIDID_MOTORCONTROL_1MOTOR, PHIDID_MOTORCONTROL_HC_2MOTOR, PHIDID_MOTORCONTROL_LV_2MOTOR_4INPUT, PHIDID_NOTHING, PHIDID_PHSENSOR, PHIDID_RFID, PHIDID_RFID_2OUTPUT, PHIDID_RFID_2OUTPUT_READ_WRITE, PHIDID_ROTARY_TOUCH, PHIDID_SERVO_1MOTOR, PHIDID_SERVO_1MOTOR_OLD, PHIDID_SERVO_4MOTOR, PHIDID_SERVO_4MOTOR_OLD, PHIDID_SPATIAL_ACCEL_3AXIS, PHIDID_SPATIAL_ACCEL_GYRO_COMPASS, PHIDID_TEMPERATURESENSOR, PHIDID_TEMPERATURESENSOR_4, PHIDID_TEMPERATURESENSOR_IR, PHIDID_TEXTLCD_2x20, PHIDID_TEXTLCD_2x20_w_0_8_8, PHIDID_TEXTLCD_2x20_w_8_8_8, PHIDID_TEXTLCD_ADAPTER, PHIDID_TEXTLED_1x8, PHIDID_TEXTLED_4x8, PHIDID_UNIPOLAR_STEPPER_4MOTOR, PHIDID_WEIGHTSENSOR
 
Constructor Summary
PHSensorPhidget()
           
 
Method Summary
 void addPHChangeListener(PHChangeListener l)
          Adds a pH change listener.
 double getPH()
          Returns the measured pH.
 double getPHChangeTrigger()
          Returns the change trigger.
 double getPHMax()
          Returns the maximum pH that will be returned by the pH sensor input.
 double getPHMin()
          Returns the minimum pH that will be returned by the pH sensor input.
 double getPotential()
          Returns the Potential, in millivolts.
 double getPotentialMax()
          Returns the maximum potential that will be returned by the pH sensor input.
 double getPotentialMin()
          Returns the minimum potential that will be returned by the pH sensor input.
 void removePHChangeListener(PHChangeListener l)
           
 void setPHChangeTrigger(double newVal)
          Sets the change trigger.
 void setTemperature(double newVal)
          Sets the probe temperature in degrees celcius.
 
Methods inherited from class com.phidgets.Phidget
addAttachListener, addDetachListener, addErrorListener, addServerConnectListener, addServerDisconnectListener, close, disableLogging, enableLogging, equals, getDeviceClass, getDeviceID, getDeviceLabel, getDeviceName, getDeviceType, getDeviceVersion, getLibraryVersion, getSerialNumber, getServerAddress, getServerID, getServerPort, isAttached, isAttachedToServer, log, open, open, open, open, open, openAny, openAny, openAny, openAny, openAny, openLabel, openLabel, openLabel, openLabel, openLabel, removeAttachListener, removeDetachListener, removeErrorListener, removeServerConnectListener, removeServerDisconnectListener, setDeviceLabel, toString, waitForAttachment, waitForAttachment
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PHSensorPhidget

public PHSensorPhidget()
                throws PhidgetException
Method Detail

getPH

public double getPH()
             throws PhidgetException
Returns the measured pH. This value can range from between getPHMin and getPHMax, but some of this range is likely outside of the valid range of most pH sensors. For example, when there is no pH sensor attached, the board will often report an (invalid) pH of 15, which while technically within a valid pH range, is unlikely to be seen.

Returns:
the current pH
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getPHMax

public double getPHMax()
                throws PhidgetException
Returns the maximum pH that will be returned by the pH sensor input.

Returns:
Maximum pH
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getPHMin

public double getPHMin()
                throws PhidgetException
Returns the minimum pH that will be returned by the pH sensor input.

Returns:
Minimum pH
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getPotential

public double getPotential()
                    throws PhidgetException
Returns the Potential, in millivolts. This returns the actual voltage potential measured by the A/D. This value will always be between getPotentialMin and getPotentialMax. This is the value that is internally used to calculate pH in the library.

Returns:
the current potential
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getPotentialMax

public double getPotentialMax()
                       throws PhidgetException
Returns the maximum potential that will be returned by the pH sensor input.

Returns:
Maximum potential in millivolts
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getPotentialMin

public double getPotentialMin()
                       throws PhidgetException
Returns the minimum potential that will be returned by the pH sensor input.

Returns:
Minimum potential in millivolts
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

setTemperature

public void setTemperature(double newVal)
                    throws PhidgetException
Sets the probe temperature in degrees celcius. This value is used while calculating the pH. The default value in the libary is 20 degrees celcius. If the temperature of the liquid being measured is not 20 degrees, then it should be measued and set for maximum accuracy.

Note: All that this does is set a value in the library that is used for calculating ph. This does not set anything in the hardware itself.

Parameters:
newVal - temperature
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

setPHChangeTrigger

public void setPHChangeTrigger(double newVal)
                        throws PhidgetException
Sets the change trigger. This is how much the pH much change between successive PHChangeEvents. By default this value is set to 0.05

Parameters:
newVal - Trigger
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getPHChangeTrigger

public double getPHChangeTrigger()
                          throws PhidgetException
Returns the change trigger. This is how much the pH much change between successive PHChangeEvents. By default this value is set to 0.05

Returns:
Trigger
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

addPHChangeListener

public final void addPHChangeListener(PHChangeListener l)
Adds a pH change listener. The pH change handler is a method that will be called when the pH has changed by at least the Trigger that has been set.

There is no limit on the number of pH change handlers that can be registered for a particular Phidget.

Parameters:
l - An implemetation of the PHChangeListener interface

removePHChangeListener

public final void removePHChangeListener(PHChangeListener l)