Soil Temperature Probe

A soil temperature probe has been on my todo list for a while. So I decided to build one now along with a number of other improvements, and repairs to my weather station.

The soil temperature at four inch depth is what is used for agriculture and I added sensors at 1,2 and 3 feet. The deeper sensors are mainly for my own curiosity to see annual variations in soil temperature.

The sensors are Microchip MCP9808 Silicon Temperature Sensors mounted on a little board by Adafruit. These sensors communicate via I²C so they can be all wired in parallel and addressed by a microcontroller. To protect the sensors in the ground they are inside a length of 1/2″ PVC water pipe.

Above is a picture of the sensor string and the length of pipe they will go in. It takes four wires the connect the sensors and some telephone wire is a handy way to connect them along with a RJ11 telephone connector on the end of the wire.

Above is a picture of the completed probe. The sensors are in the longest length of pipe. Then a one foot section  gets the sensors away from the place where the probe comes to the surface. This is to prevent the probe or the opening in the ground caused by the probe from affecting the temperature at the sensor. Another length gets the probe above ground. It also allows the probe to come out of the ground next to a leg of my weather station reducing the chance of damage to the probe from mowing or walking on it. Then a U shaped section gets the opening for the wire pointed down. The wire is sealed with silicone but I wanted to also have it pointed down to prevent rain from pooling on the seal and possibly leaking. I filled the pipe with dry sand to prevent convection currents of the air inside the probe from affecting the sensors.

Here is the probe buried next to my weather tower. Because of the horizontal section of the probe the sensors are over a foot from the tower leg. That should be enough to prevent the leg from affecting the readings.

The probe is connected to a Teensy 3.2 microcontroller. I designed and had made a carrier board for the Teensy it just holds the Teensy and connects it to the RJ11 connector to the probe. In previous projects I mounted the microcontroller on a piece of perf board and hand wired the connections. This is much neater and more reliable. The board is sitting in a plastic case to protect it.

The Teensy reads the data from each of the sensors via the I²C bus. The data is then sent over the USB to a Linux machine (Beaglebone Black) which receives data from all the weather tower sensors and send the data to the MYSQL server on the web.


This is a plot of the first  4 days of logging. Red is the 4″ sensor, Blue is the 12″ sensor, green is the 24″ sensor and black is the 36″ sensor. It was warm the first day then it cooled off. The order of the plots completely reversed. As the ambient air started cooling the soil rather than heating it. The smooth lines in the middle of the plot are where I lost some data while switching web servers. The ripples are probably due to sampling noise in the sensors.  I will add some averaging of he samples to smooth out the plots. I also need to fix the time and date labels to make them more readable.

The soil temperature data is online at:



Teensy from PJRC

Beaglebone black

Carrier board made by Seeedstudio Fusion

My web site

This entry was posted in Electronics, environmental monotoring, Imbedded Software, Software and tagged , , , , , , , , . Bookmark the permalink.

4 Responses to Soil Temperature Probe

  1. E says:

    Interesting concept, but my concern would be that the air in the PVC pipe creates its own microclimate with warm deeoground air rising and that the readings therefore are far from thrust worthy. In my setup I use only 2 sensors, 1 for 50 cm deep and the other for 10 cm and I use the ubiquitous ‘Waterproof” DS18B20 in which I protected the metal part with some extra heatshrink.
    Dug them into the soil without further protection

    • E says:

      this ofcourse in spite of th dry sand

      • jimhannon says:

        My feeling is that the heat flow in the dry sand is not much different than the normal heat flow in the soil around the probe. Along with the sand blocking the air flow the narrow diameter of the pipe does not allow much of a convection flow to develop. Same principle applies to say fiberglass insulation.

      • E says:

        You are probably right.
        It is a good way to to keep track of yr sensors should one fail. Just pull out the pipe whereas i must start digging. Tnx

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.