SDI-12 Quick Start
What is SDI-12?
SDI-12 stands for serial data interface at 1200 baud. It is a standard to interface battery powered data recorders with micro-processor based sensors designed for environmental data acquisition (EDA).
EDA is accomplished by means of a sensor, or sensors, and a data recorder which collects and saves the data. SDI-12 is a standard communications protocol which provides a means to transfer measurements taken by an intelligent sensor to a data recorder. An intelligent sensor typically takes a measurement, makes computations based on the raw sensor reading, and outputs the measured data in engineering units. For example, an SDI-12 pressure sensor may take a series of pressure measurements, average them, and then output pressure in psi, inches of mercury, bars, millibars, or torrs. The sensor's micro-processor makes the computations, converts sensor readings into the appropriate units, and uses the SDI-12 protocol to transfer data to the recorder.
What requirements make SDI-12 particularly useful?
SDI-12 is used in applications with the following requirements:
-
battery powered operation with minimal current drain
-
use of one data recorder with multiple sensors on a single cable
-
use with microprocessor-based sensors that perform complex calibration algorithms or make internal computations
-
Up to 200 feet of cable between a sensor and a data logger.
These requirements are necessary to acquire hydrologic data at remote sites. Most sites use battery powered data recorders to operate for long and unattended periods of time.
Why use micro-processor based sensors anyway?
A micro-processor in the sensor may calibrate the sensor, control sensor measurements, and convert raw sensor readings into engineering units. The micro-processor also controls the SDI-12 interface. It accepts and decodes instructions received from the data recorder, starts the measurements, controls all timing, and uses the SDI-12 protocol to communicate with the data recorder.
Can more than one parameter be measured with a single data recorder?
Yes. SDI-12 is a multi-drop interface that can communicate with multi-parameter sensors. Multi-drop means that more than one SDI-12 sensor can be connected to a data recorder. The SDI-12 bus is capable of having ten sensors connected to it. Having more than ten sensors, however, is possible. Some SDI-12 users connect more than ten sensors to a single data recorder.
Multi-parameter means that a single sensor may return more than one measurement. For example, some water quality sensors return temperature, conductivity, dissolved oxygen, pH, turbidity, and depth.
Advantages of SDI-12
A serial-digital interface is a logical choice for interfacing microprocessor-based sensors with a data recorder. This has advantages for sensors and data recorders.
-
Unique and complex self calibration algorithms can be done in microprocessor-based sensors.
-
Sensors can be interchanged without reprogramming the data recorder with calibration or other information.
-
Power is supplied to sensors through the interface.
-
Hybrid circuit and surface mount technologies make it practical to include the power supply regulator, a microprocessor, and other needed circuitry in small sensor packages.
-
Sensors can use low cost EEPROMs (electrically erasable programmable read only memory) for calibration coefficients and other information instead of internal trimming operations.
-
The use of a standard serial interface eliminates significant complexity in the design of data recorders.
-
Data recorders can be designed and produced independently of future sensor development.
-
SDI-12 data recorders interface with a variety of sensors.
-
SDI-12 sensors interface with a variety of data recorders.
-
Personnel trained in SDI-12 will have skills to work with a variety of SDI-12 data recorders and SDI-12 sensors.
In what applications are SDI-12 devices used?
SDI-12 is used in water resource research and management, industry, government, and agriculture. For example, the U.S. Geological Survey uses over 4000 SDI-12 sensors in its data collection networks. SDI-12 sensors are available that measure the following:
-
conductivity
-
dissolved oxygen
-
distance
-
groundwater level
-
petroleum hydrocarbons in water
-
pH
-
pressure
-
redox (ORP)
-
tank level
-
temperature
-
tide and sea state
-
turbidity
-
water velocity
-
weight of snow and ice on a snow pillow
More information on the SDI-12 protocol can be found at http://www.sdi-12.org/
Basic SDI-12 Command Grammar
a – Sensor Address
The first character of every command is a sensor address. Likewise, the first character of every response is also the address character. This command spec uses the character “a” to denote the address character.
The default HP2 address is ASCII ‘0’. The standard SDI-12 address range is ASCII ‘0’ through ASCII ‘9’. The HP2 supports addresses between ASCII ‘0’ and ASCII ‘~’ (Decimal 48 – Decimal 126).
b – New Sensor Address
The new sensor address character is used as a parameter in the Change Address command, as well as in response to the Change Address command. It has the same requirements as the Sensor Address (detailed above).
? – Wildcard Address
The wildcard address character, ASCII ‘?’, is supported for any SDI-12 command. It may be used in place of the sensor address character, and in that case, any attached probe will respond, regardless of the probe’s address.
ttt – Seconds Until Ready
The number of seconds until the requested measurements will be ready. By default, the HP2 takes 1 second to prepare readings.
n, nn – Number of Readings
The number of measurement values the sensor will return via one or more D commands. Standard measurement commands may return 0-9 readings, while concurrent measurement commands may return 0-99 readings.
ll – SDI-12 Version
Two characters specify the SDI-12 version number. The HP2 supports SDI-12 version 1.2, so the shipping version number is “12”.
mmmmmm – Sensor Model
Six characters specify the sensor model number. The HP2 shipping model number is 000001.
vvv – Sensor Version
Three characters specify the sensor version. The HP2 shipping version is 2.0.
######## – Serial Number
Eight characters specify the sensor serial number. The HP2 serial number is set at the factory.
Basic SDI-12 Commands
Acknowledge Active
Used to ensure that a sensor is responding to a data recorder or another SDI-12 device. It asks a sensor to acknowledge its presence on the SDI-12 bus.
Command: a!
Response: a<CR><LF>
Change Sensor Address
Used to change the address of a SDI-12 sensor.
Command: aAb!
Response: b<CR><LF>
Send Identification
Used to retrieve the ID string of a SDI-12 sensor that supports software changeable addresses.
Command: aI!
Response: allcccccccccmmmmmmvvxxx…xx<CR><LF>
Address Query
Used to retrieve the address of a single SDI-12 sensor
Command: ?!
Response: a<CR><LF>
Start Measurement Command
This command tells the sensor to take a measurement. The sensor does not, however, return the measurement to the data recorder after this command. It returns the time until one or more measurements will be ready and the number of measurements that it will make. The send data (D0!) command must be issued to get the measurement(s).
Command Response
aM! atttn<CR><LF>
a
- the sensor address a - the sensor address
M
- the start measurement ttt - the specified time, in seconds, until the sensor will have the
measurement(s) ready
!
- terminates the command n - the number of measurement values the sensor will make and return
in one or more subsequent D commands; n is a single digit integer with a valid range of 0 to 9
Table 9. The start measurement command (aM!)
Send Data Command (aD0! . . . aD9!) This command is used to get groups of data from the sensor. D0! is issued after an M, MC, C, CC, or V command. The sensor responds by sending the data. If the expected number of measurements is not returned in response to a D0! command, the data recorder issues D1!, D2!, etc. until all measurement values are received. (The expected number of measurements is given in the response to an M, C, or V command.)
Command Response
aD0! (aD1! . . . aD9!) a<values><CR><LF>
or
a<values><CRC><CR><LF>
a
- the sensor address a - the sensor address
D0
- the send data command, D1 . . . D9 additional send data commands values (see below)
!
- terminates the command
Extended SDI-12 Commands
For a full description of extended commands, refer to the SDI-12 sensor user manual