Update: A newer version of this project has been released. Read More >>
There have been many initiatives undertaken to maximize mushroom cultivation productivity, and although variations exist between species, manipulation of environmental conditions has demonstrated some of the most dramatic effects on yield. Temperature, humidity, and carbon dioxide concentration have been identified as some of the most crucial factors for promoting mycelial colonization, primordia formation, and fruiting body (mushroom) growth. Additionally, each stage of development requires specific conditions for optimal growth. As such, the more precise these conditions can be controlled, the greater the yields that are possible.
In 2009 I developed the first version of an automated cultivation chamber for growing gourmet mushrooms. It consisted of a controller that monitored a humidity and temperature sensor and modulated relays. The relays a humidifier to regulate the humidity, a heater to regulate the temperature, and an exhaust fan to remove excess carbon dioxide. This was also my first of many automation projects using the ATMega168 microcontroller. Although I still use ATMegas, the scope of what I wanted to do required more connectivity and processing power. Therefore, I utilized a serial connection to a computer running linux, which hosted a control interface on a web server. However, in 2012 the Raspberry Pi was released. It was the first of its kind, offering a 700 Mhz processor that could run a full distribution of Linux, 17 general purpose input/outputs (GPIOs), SD card storage, HDMI/VGA output, and USB connectivity, for under $30. With it now being attainable to reduce the size of my control system down to the equivalent of a deck of playing cards, I began porting my code to this new hardware. My source code can be found on Github
I’ll preface here that my system was designed to operate in a cold climate. As such, if a temperature adjustment was required, this was accomplished through heating alone, therefore only a heater was required. This was possible because I developed this system in an air-conditioned environment and did not need to account for cooling the chamber. However, the program code and chamber construction can be easily adapted to do so.
The chamber itself is not limited to a single design. Be creative and experiment to find what works best for you with your skills and budget. It can be as simple as a small container or it may be an entire room encased in plastic. Whichever method you choose, ensure all seams have been sealed to prevent entry of microorganism contaminants. I will focus on construction of a sealed room, as it is generally more complex.
For an inexpensive, air-tight doorway, I’ve found magnetic strips to be quite effective. This can be constructed by making a straight, vertical cut in the plastic where you want your opening. Adhere one magnetic strip to one of the two plastic flaps of the opening using clear tape. Allow the magnetic strips to attract and cling to one another. Now, adhere the other plastic flap to the second magnetic strip. By adhering the plastic to the magnetic strips in this this manner, it ensures the doorway seals properly align when closed.
The heater, humidifier, and a circulatory fan may be placed inside the room. The circulatory fan was placed near the humidifier to homogenize the himid air exiting the device. The circulatory fan pictured below also has attached a heating element that was used when in operation in a smaller chamber, but has since been replaced with a space-heater once the system was moved into a larger chamber. If your area is not large enough to accommodate this setup, construct ducting or tubing that permits the transfer of heat or humid air into the chamber from the outflow of the heater and humidifier.
The exhaust fan forces air into the chamber (preferably after passing through a HEPA filter). This is preferred to creating a vacuum by pulling air out, because contaminants are likely to be introduced through small orifices if they are not sealed properly. It is much safer to introduce sterile air and create a positive pressure that will force air out through these unsealed orifices. An opening was created for the exhausted air to exit the chamber, by cutting an opening in the plastic close to the floor, then adhere a fine-mesh screen over the opening to preventing entry of insects into the chamber (many flying insects are attracted to compounds produced by fungi). A flap of plastic was placed as to rest over the opening when their was no airflow. Creating this exhaust port low in the chamber serves two purposes- One, because carbon dioxide is heavier than air, it will collect in the lower part of the chamber, and because the signal for primordia formation is largely affected by carbon dioxide concentration, when it’s desired to induce this stage of development, this facilitates exhausting of these denser gases from the chamber. And two, because hot air rises, this will help with maintaining heat by preventing the hot air in the top of the chamber from escaping.
4-Channel, 10-Amp relay module Crydom 40-amp solid state relay DHT22 temperature/humidity sensor
The hardware setup was straightforward. The GPIOs of the Raspberry Pi were connected to relays and each device (heater, humidifier, etc.) was wired to a relay (view the README.txt on Github for specifics, link below).
Remember to always use caution when working around electricity and to always de-energize all components before working on them. Some of the devices described below can be dangerous if not handled or constructed properly. Ensure the control box is not exposed to moisture and that all electrical devices that will be exposed to moisture inside the chamber are either sealed or are capable of safely operating in a high-humid environment. Never exceed the current-carrying capacity of your wires or the maximum rated current of other in-line devices (e.g. outlets, connectors, fuses, etc.). Furthermore, many fungi can be harmful to your health. When culturing any microorganism (especially large biomass), it is advised to periodically perform diagnostic tests to ensure the culture has not become contaminated. This goes for all parts of the cultivation process (including, but not limited to, substrate production, inoculation, fruiting, and disposal). It should also go without saying that one should never consume mycelia or mushrooms of a species that is unknown.
The power control box was constructed with four 120-volt outlets. Each relay controls the main positive voltage to each outlet and the main ground is connected straight to each outlet. One outlet (green power cord in photo) is connected directly to power and is always on. Each relay on the 4-relay board is rated at 10 amps. The Crydom D1240 solid state relay is rated to 40 Amps, and is controlled by the number 4 relay from the 4-relay board. This allows a higher load to be connected to outlet 4, such as a space heater that may exceed 10 Amps.
The majority of the software relies on two programs, written in C. A logging program reads the temperature and humidity sensors and writes the time-stamped values to log files. A controller program reads from a configuration file and, through PID programming, modulates a set of relays connected to devices (heater, humidifier, circulatory fan, and exhaust fan) until the humidity and temperature in the chamber reaches the values set in the configuration file. cron ensures both the programs run at appropriate intervals.
A user interface (HTML, PHP, and Python) was developed for comprehensive viewing of sensor data as well as easy altering of the configuration variables. This was hosted on a Nginx server set up with SSL and an authentication script (PHP) for verifying login credentials. The main page parses and pipes the time and sensor data to GNUPlot to generate several graphs that display (1) temperature, (2) humidity, (3) dew point, and (4) when and how long each relay has ran for, for the past several minutes, hours, days, weeks, months, or years. The user can view historical data on the fly by generating graphs with custom beginning and end dates and can modify the configuration through the web interface.
Graphs for Mobile
The Fruits of My Labor (white and pink oyster mushrooms)
The middle photos of the large clusters of white oysters grew extremely well and yielded a few pounds in total. The mycelial colonization of the pink oysters had been accidentally heat-shocked early in development and consequently did not fully colonize the substrate (you can see uncolonized hay in the bag in the background), and is likely to be responsible for the smaller yield.
I participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com, and I make a commission for sales made through affiliate links posted on this website.