Gardening with the Raspberry Pi

Many of you may be garden enthusiasts and would welcome the idea of automating some of the maintenance requirements of your plants. For example, keeping tabs on the quantity of water that is required by the plants based on the moisture in the soil, the available sunlight and the environmental temperature might be easy for an experienced gardener. However, gardeners who have just started gardening find it a difficult equation to balance. Even an experienced gardener may have to depend on a novice if taking leave from his garden for a few days.

With a Raspberry Pi (RBPi), most of the above gardening issues can be fixed. The Raspberry Pi can take care of the garden’s watering requirements based on a few environmental measurements. This can bring relief to an experienced gardener forced to leave his beloved plants for a few days. The novice gardener can quit worrying if he is starving his plants or drowning them in water. This is how Devon approached the problem with his Raspberry Pi.

Avid gardening enthusiasts know that too much water to a plant can be as bad as too little. For the Raspberry Pi to determine how much water should be delivered to the plant, it is necessary to know how much moisture is present in the soil in the first place. That, combined with the temperature and the amount of available light can let Raspberry Pi control the pump that delivers the water to the garden.

Since Raspberry Pi is not capable of measuring analog signals that most sensors put out, an Analog to Digital Converter attachment is necessary. For this, using the MCP3008 ADC is a good choice since it allows eight sensors to be used at a time. For sensing the amount of sunlight available, a Light Dependent Resistor or LDR is useful. To measure the ambient temperature with some amount of precision, a temperature sensor such as the TMP35 or TMP37 will do. For sensing humidity in the soil, a homemade humidity sensor using a few long metal nails will be fine.

All the sensors will need a DC voltage supply and a return ground connection, with the signal from each sensor going to one of the channels of the ADC. The 3.3VDC from the Raspberry Pi board is good enough for the sensors. While only one temperature sensor and one LDR is enough, you may need more than one humidity sensor, depending on how big your garden is.

The humidity sensors check the resistance of the soil between a pair of probes inserted into the ground. As the soil dries up, the resistance increases between the two probes of the humidity sensor. If several such probes are placed at different places in the garden, the Raspberry Pi has a fairly good idea of the state of dryness of the soil in the garden.

The final and most important part of the entire system is the pump that delivers water to the garden. Using a tank and a submersible pump eliminates a whole bunch of issues that many gardeners face. You can experiment with drip-irrigation also if you like the idea. Devon has kindly shared the software and the code used, and you can download them here.