Skip to content

Soil Moisture Station Protocol

Chris Matteri edited this page Sep 15, 2015 · 1 revision

The radio parameters and frequency hopping sequence for the Davis Leaf and Soil Moisture/Temperature Station (LSMS) are identical to those for the ISS. The packet size and format are also the same, but bytes 1-5 hold data specific to this weather station.

Byte 1 describes the type of data and the port number. Bits 0 and 1 indicate the message type. If they are 1, the packet contains both a soil moisture and a soil temperature reading. If they are 2, the packet contains a leaf wetness reading. The port number is indicated by bits 5-7, which range from 0 to 3 for soil moisture and temperature and 0 to 1 for leaf wetness (the port number on the unit is one higher than the number in the packet).

Soil Moisture and Temperature Messages:

Soil moisture measurements are sent in byte 2 and the two highest order bits of byte 4. Soil temperature measurements are sent in byte 3 and the two highest order bits of byte 5. The data in bytes 4 and 5 is lower order than the data in bytes 2 and 3.

Both the soil moisture and soil temperature sensors used by the LSMS are resistive sensors (i.e. the resistance of the sensor is a function of the soil moisture/temperature). Unlike data sent from the ISS, the soil moisture/temperature readings are unprocessed. The LSMS uses a voltage divider to measure the resistance of the sensor probes. The value in the packet is some constant k times the output of the voltage divider.

Derivation of Formula for Resistance

Let the input to the voltage divider be VI, the output VO, the resistance of the sensor RS, and the resistance of the other resistor in the divider R. The value in the packet, packetval is k * VO. The most straightforward method for calculating the resistance of the sensors given packetval would require knowing VI, R, and k, but none of their values are known.

packetval = k * VO = k * VI * (RS / (RS + R))

RS = packetval * R / (k * VI - packetval)

However, with some arithmetic, we can write:

1 / (k * VO) = 1 / RS * (R / (k * VI)) + 1 / (k * VI).

Thus there is a linear relationship between 1 / RS and 1 / (k * VO). Let A = (R / (k * VI)) and B = 1 / (k * VI). Then

1 / (k * VO) = 1 / RS * A + B.

Using a set of (RS, packetval) pairs, a linear regression can be performed to find A and B, which allows the sensor resistance RS to be calculated from the value in the data packet, k * V0. Note that R can be determined and is equal to A / B.

RS = A / (1 / (k * VO) - B)

RS = A / (1/packetval - B)

This Spreadsheet (best viewed with LibreOffice) has calculations of parameters A and B for moisture and temperature (they are different for each). The resistance measurements were made with an inexpensive multimeter and may be somewhat inaccurate.

Soil Moisture:

A = 13.50903

B = 0.0010706966

Soil Temperature:

A = 18.8109897

B = 0.0009988027

Calculation of Soil Moisture and Temperature

The soil moisture sensor is a Watermark 200SS. Equations for calculating the soil moisture from resistance can be found at here.

The soil temperature sensor (Davis part 06470) is a negative temperature coefficient (NTC) thermistor. Any 10 kohm (i.e. resistance of 10 kohm at 25 degrees C) NTC thermistor should work with the LSMS, but one must consider the ability of the sensor to withstand withstand soil conditions. The Wikipedia page for thermistors explains some of the models that are used to relate temperature and resistance. I chose to use the Steinhart-Hart equation, with the third parameter set to zero. See this spreadsheet (best viewed with LibreOffice) for an example calculation of the Steinhart-Hart parameters (note that these are not the Davis sensors). Davis supplies a table relating resistance and temperature in their thermistors if you choose to use them.

Reference Implementation

The CC1101 Weather Receiver includes a Weewx driver for the LSMS which would likely be useful for anyone writing code to receive data from a LSMS.