DF Robot Analog pH Sensor
Parts needed
M20 IP67 Cable Gland (Supplier: Elecdirect Dome Cap Cable Gland).
Lithium Moly Grease (e.g., Lucasoil Lithium Grease.
22 AWG Hook-Up Wire (hook-up wire spool set).
Hardware Integration
A cable must be built or modified to provide connectivity between the RRIV board and the Gravity analog pH meter. A female 3-pin JST-PH plug should be used for the end connecting to the pH meter. If using a RRIV v0.3 board, a female 3-pin JST-PH plug should be used for the end connecting to the RRIV board. For a RRIV v0.4 board, a female 3-pin JST-SH plug should be used.
Note: the sequence of pins on the RRIV and pH meter boards differ (see Figure 1). Construction of the cable should should follow the details in Figure 2


Application and CLI Use
Initial Setup
Works with the generic_analog_driver.
The command
set-slot-configis used to configure a sensor for use with the RRIV logger:slotis a digital slot of data set aside in the EEPROM to hold a sensor configurationtypeis what driver type occupies the slot, these can be found by looking in the registry.cpp and following the "_TYPE_STRING" definitionstagis a 5 character prefix for column headers, these should be left alone unless there are multiple of the same sensor in a systemburst_sizeis the number of reading cycles that should occur per burstsensor_pinonly for DHT22 currently, indicates which specific GPIO pin is being used for the sensoradc_selectonly for analog sensors, can be either 'internal' or 'external' and indicates whether the analog sensor data is being processed by the ADC in the MCU or the external onesensor_portonly for analog sensors, indicates which physical port the sensor is occupying
These can and should be used as they are to setup the AHT, CO2, and CH4 sensors, though once configured should be retained:
set-slot-config {"slot":1, "type":"generic_analog", "tag":"pH", "burst_size":10, "adc_select":"external", "sensor_port":2}get-configis used to check the configuration of the settings as they are, the first section displayed is the datalogger settings followed by sensor slot settingsThe command
set-configis used to configure sensors and sampling parameters.loggerNameis a colloquial name that has been written on the back of the board in sharpiesiteNameis a 7 character string to indicate where the RRIV is being deployed, this will also be used in the folder structure of CSV output, so should be uniquedeploymentIdentifieris a 15 character string to indicate what experiment is being runwakeIntervalis in minutes and determines when the board wakes up to begin measurement cycles. 60 indicates to wake up every hour, 1 indicates every minute. The next interval is calculated at the end of a measurement cyclestartUpDelayis a duration in minutes to delay before starting the measurement cycleburstNumberindicates how many burst cycles to complete during a measurement cycleinterBurstDelaynow also works as an interval given in minutes for when to begin taking readings. 1 indicates to take readings at every minute
example of set-config that can be further customized. This command sets up a logger named "writeOnBoard" that will wake up after sleeping for 1 minute with
set-config {"loggerName":"writeOnBoard", "siteName":"7char", "deploymentIdentifier":"15char", "wakeInterval":1, "startUpDelay":0, "burstNumber":60, "interBurstDelay":1}To check that all sensors are working properly use
start-logging. This will display sensor readings at continuous intervals. You can evaluate the readings to confirm the sensor is operating properly. When you are done with this process type the commandstop-logging. Data will continue logging so the keystrokes you type may become separated, but the command will register if you type the entire command and press enter. The data can be offloaded from the SD card to confirm that data collection was satisfactory.
pH sensor calibration
Calibration values are entered manually.
Begin by typing the command
start-logging. This will provide a continuous read of raw pH values in millivolts.While the sensor is logging, place hte sensor in the first calibration solution.
Once the raw voltage measurements have stabilized, record the pH of the calibration solution and the corresponding millivolt value of the sensor.
Repeat the above step for one or two different other pH calibration solutions.
Use the
calibratecommand to record the calibration values for the sensor. Each calibration point is entered with the following command, which has three values associated with it.[sensor slot #] [step] [value]
The first value,
sensor slot #, is the slot number previously assigned (in this example slot 1 was used).The second value,
step, is the pH of the calibration solution.The third value,
value, is the raw analog reading in millivolts obtained by the sensor.
Repeat the step above for all 3 calibration points.
Last updated