As easy as ADC As easy as ADC

As easy as ADC

For measuring the moisture level in the soil, there are two ways you can go about this. You can either use a 'Resistive Soil Moisture Sensor' or a 'Capacitive Soil Moisture Sensor'.

The 'Resistive sensor' consists of two probes, sort of like a two-pronged fork which are used to measure the volumetric content of water. The two probes allow the current to pass through the soil, and then it gets the resistance value to measure the moisture value. When there is more water, the soil conducts more electricity, which means that there is less resistance. Therefore, the moisture level is higher. When there is less water, the soil conducts less electricity, which means that there is more resistance. Therefore, the moisture level is lower.

The primary issue with this type of sensor is the corrosion of the sensor probes, not just because it is in contact with the soil but also because there is a 'DC current' flowing which causes electrolysis of the sensors. So not only will you be recalibrating the sensor regularly but as the probe corrodes, your plant is absorbing the metal oxides deposited from the rusting sensor.

The 'Capacitive sensor' works by generating an electric field and detecting whether this electrical field is being disrupted. This type can detect anything that is conductive or has a significantly different permittivity than air, like the dielectric that is formed by soil and water. Capacitive measuring also has some advantages. It not only avoids corrosion of the probe but also gives a better reading of the moisture content of the soil as opposed to resistance measuring.

To make the capacitive sensor compatible with the raspberry pi required an Analogue to Digital chip. In this case, I used the robust MCP3008 ADC which can receive and output eight signals and is 'cheap as chips'. Even though I had the option of eight channels, I opted for manufacturing only four sensors for this first variant of Banks. Each sensor required 3.3v power, a ground and a signal wire so mini headphone jacks would suffice as the physical connection between the sensor and the system.

To trigger the pump system, I used a small 5v relay that could be triggered from the GPIO pins on the raspberry pi via node-red. Moreover, this completed the hardware build of the central Banks unit. 

I used Modo to model the chassis of Banks, carefully measuring each of the components so that all the 2mm mounting points were in the right spot. The chassis was then printed out on the 3d Printer and given a five-layer coat of paint to protect it. The yellow socket is the link to trigger the pump, and the small USB port is the power link to the battery system connected to the solar panel. After assembly and before I took the system outside, I powered up Banks, measured and calibrated each of the four sensors using some of our house plants as guinea pigs.