Controlled-environment cultivation

Controlled-environment cultivation

As illustrated in a previous post, you need only a few Yoctopuce modules and a very simple logic to regulate an environmental factor such as humidity. Starting from there, why not generalize the principle and produce an environment fully optimized for a specific aim, such as growing plants? We decided to test this principle to grow mushrooms. Mushrooms, rather than tomatoes or pumpkins, because mushrooms grow fast and in the dark. It's therefore quite easy to make a time-lapse of their growing if you control lighting well...


We selected common mushrooms (agaricus bisporus) because it's quite easy to find growing kits for this type of mushrooms in garden centers. The first element of the kit is a polystyrene box. The bottom of the box contains a not very engaging lyophilized matter, we don't exactly know what it is, but we're quite sure that we don't want to know :-) Growing these common mushrooms is quite easy: you must fill the box with the compost provided in the kit, and keep everything very humid by spraying water several times a day while maintaining the temperature between 16 and 18░C.

Mushrooms are going to grow in there
Mushrooms are going to grow in there



Controlling temperature

We put our kit in a little cellar. The cellar temperature being lower than the required one, we installed a small ceramic heater. We modified the heater by adding a Yocto-LatchedRelay to its power supply.

a small heater.. ..controlled trough USB thanks to a Yocto-LatchedRelay
A simple heater, hacked into an USB heater

Thus, the heater can be automatically turned on or off. The heater is controlled by a YoctoHub-Wireless to which a Yocto-Meteo is also connected.

Automatic control of the temperature with a heater, a Yocto-Meteo, and a Yocto-LatchedRelay
Automatic control of the temperature with a heater, a Yocto-Meteo, and a Yocto-LatchedRelay

.
Every ten minutes, the hub triggers a PHP script through an HTTP callback. If the ambient temperature measured at the time of the callback is bellow 17░C, the script turns the heater on during one minute. This is enough to maintain a constant temperature in the cellar, to the nearest fourth of a degree.

We managed to keep the room temperature very stable
We managed to keep the room temperature very stable



Controlling humidity

Common mushrooms need a very humid soil to grow. To the point that you are supposed to spray water on the box several times a day. We solved this issue with an electric sprayer. This sprayer looks like a classic sprayer, but you only need to press the switch for the internal pump to start working and spray water. We simply modified the system by wiring a Yocto-PowerRelay in parallel to the trigger.

An electric spay bottle.. ..controlled trough a Yocto-PowerRelay
An electric spray bottle, now USB controled


To measure soil moisture, we used a MAS-1 moisture sensor produced by Decagon. This sensor has a 4-20mA output that we connected to a Yocto-4-20mA-Rx.

Our soil moisture sensor
Our soil moisture sensor


The sprayer and the Yocto-4-20mA-Rx are connected to a YoctoHub-Wireless. Every ten minutes, the hub runs a PHP script through an HTTP callback. If humidity at the time of the callback is below a given threshold, the sprayer is turned on for 15 seconds.

Automatic control of the soil moisture with a 4-20mA probe and a sprayer
Automatic control of the soil moisture with a 4-20mA probe and a sprayer




Taking pictures

To make our time-lapse of growing mushrooms, we reused our automatic picture taking system based on a Canon EOS camera and a Yocto-Relay. For light, we used a large led projector, which we also modified by placing a Yocto-PowerRelay on its power supply.

A big Led floodlight..  USB controlled as well
Our hacked USB controlled floodlight


The projector and the camera are controlled by a YoctoHub-Wireless: every ten minutes, we turn on the light, we take a picture, and we turn everything off immediately afterwards.

We take a picture every ten minutes. The light and the camera are controlled with a Yocto-PowerRelay and a Yocto-Relay
We take a picture every ten minutes. The light and the camera are controlled with a Yocto-PowerRelay and a Yocto-Relay


A piece of advice: deactivate all the automatic features of your camera, including auto-focus, if you want to obtain a picture quality constant from one picture to another.

The complete installation, apart from the heater which we put on the ground
The complete installation, apart from the heater which we put on the ground



Software

Coding is dead easy: each Yoctopuce hub is able to connect itself at a regular interval to the server of your choice and to run a PHP script while transmitting the value of all the sensors connected to it. The script can then answer with a list of actions to be performed on the actuators. For instance the script for the temperature control is as simple as: if too cold then turn the heater on.


<?php
include("yocto_api.php");
include("yocto_temperature.php");
include("yocto_relay.php");

if (yRegisterHub("callback",$errmsg)!=YAPI_SUCCESS) die($errmsg);

$temperatureSensor = YfindTemperature("temperatureSensor");
$heatControl       = YfindRelay("heater");
$temperature       = $temperatureSensor->get_currentValue();
if ($temperature<17)  $heatControl->pulse(60*1000);
?>

Note that this very useful technique is also available for Java and Node.js.


Results

The experiment ran for several weeks without anything growing despite a completely stable environment. Just when we were about to give up, the first mushroom started to come out of the ground, soon followed by a string of others.

It's moving, it's alive, it's alive, it's alive, it's alive, IT'S ALIVE!
It's moving, it's alive, it's alive, it's alive, it's alive, IT'S ALIVE!

We can confirm that mushroom grow quite fast: on the following video, each second equals roughly 4 hours.

  


As you may have noticed, we thought we were growing mushrooms, but actually we were raising a multitude of tiny-creepy-crawly bugs.

Conclusion

From the Yoctopuce technology standpoint, this is a complete success: we have once more demonstrated that with a few relays and a few sensors connected to a YoctoHub, it's very easy to transform everyday objects into connected objects with fairly complex behaviors.
From the gardening standpoint, there is room for improvement. Using a sprayer is clearly not the most efficient method to water our box: way to much water is lost because it's sprayed outside of the box. Next time, we'll have to find a way to spray from the top. The soil moisture sensor works well, but the values measured depend too much on the way it is installed. The values measured may vary from simple to double depending on the orientation of the sensor and the compactness of the soil. It is very efficient to measure variations and thus maintain a constant soil humidity, but we cannot base ourselves on it to obtain an exact absolute value.
Finally, we could eat the result of one of our experiments, and this is a first for the Yoctopuce team!

Add a comment No comment yet
Back to blog












Yoctopuce, get your stuff connected.