So now that production is in process (moving along, we had a minor hardware patch to apply so we’re waiting for a new shipment of boards, but we’re all ready to crank out boards otherwise) and we feel good about the core measurements of the MultispeQ, we decided it was time to see if we could easily slap on other sensors into the PhotosynQ framework. First up – the YwRobot’s Soil Moisture sensor (actually, soil conductivity, but we’ll get into that later. Let’s start by talking about how to connect to MultispeQ and what tools can be connected —
What can connect to MultispeQ?
The MultispeQ is built around a Teensy 3.1, so please see the Teensy’s capabilities here for details. The lights, detectors, and existing sensors already use most of the existing pins (see here for Teensy pinout), but there are a few extra available pins:
- 2 digital pins and 1 analog pin through-hole pins.
- 10+ analog pads which are not through hole
- I2C line
- 3.3V line and ground
So the simplest device to connect is anything which outputs a 0 – 5V signal. Our YwRoboto sensor does just that!
Soil Moisture Background and Experiment
Measuring soil moisture can be approximated by measuring soil conductivity. Conductivity is influenced by the movement of ions in the material between the electrodes – see image below for what the device looks like. So for a given soil type, more water increases the movement of ions. However, it is very difficult to compare different soil types, because they will have different concentrations of ions and therefore different results. So this is useful for relative soil moisture changes in a single location (like your house plant), not in different locations (like different fields in different soil types).
In our quick and dirty test, we made a matrix of 4 soil types x 3 moisture levels (from high to none) which you can see in the image below. We connected the pins between the moisture sensor and the MultispeQ as follows:
|YwRobot Pin||MultispeQ (Teensy 3.1) Pin|
The communication protocol between the PhotosynQ chrome app (or Android app) and the MultispeQ is in a JSON format. In order to request the information from pin A14 (also referred to as pin 40), just add it to the JSON. Below is an example simple JSON which requests temperature, relative humidity, and the analog read from pin 40. It also specifies to take 2t00 measurements with a 2 second delay between them:
You can also create this protocol using menu-based drag-and-drop tools through the Chrome app, but I thought I’d give the details here so you could see it.
Initially, I compared soil moisture in each of 12 samples above. Here’s what I got:
As you can see, the 6.5ml water addition versus dry doesn’t show a consistent positive correlate, which doesn’t make sense. I think it may be due to the fact that I had to take out and put back in the probe each time. So I just tried placing the probe in soil, and adding moisture to the surface without affecting the probe. These results were much closer to what I would have expected:
Overall, this sensor definitely relates to soil moisture, and the completely saturated cases of different soil types even show similar absolute response (about 45k counts). However, at less than saturated levels, soil conductivity varies quite a bit between the different soil types at least from this quick little introductory test so probably soil moisture can be accurately measured at a single location.
In terms of integrating this sensor into PhotosynQ, it was pretty easy. Connect 3 pins, add one small line to tell the device to look for it, and vioala – graphs!
The next step is to actually stick this thing into my yard and see what happens. We’ve been talking about trying to pull in weather data into PhotosynQ so you can correlate and analyze that in addition to the sensor data, which would be particularly fun here. Also, I think there is a new version which is gold plated and therefore much more robust which I’ve already ordered to play with. Finally, I should create a real research project (which others can join and participate in) out of this, instead of just taking one off measurements. Then we can see how the PhotosynQ online analysis tool could be useful to analyze the resulting data (see here for example of recent data taken in bean fields in North Dakota – please be patient while the data loads!).