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: http://www.ocrslc.net/sensors/soiltemp.php
Teensy from PJRC https://www.pjrc.com/
Beaglebone black https://beagleboard.org/black
Carrier board made by Seeedstudio Fusion https://www.seeedstudio.com/
My web site http://www.ocrslc.net/