Vanilla as we know it actually starts out as a bean growing on a vine in the orchid family. Only two species are known to be edible, Vanilla Planifolia and Vanilla Tahitensis. Both beans grow in tropical environments; even Southern California isn’t able to provide the environment Vanilla orchids need to thrive. The summers provide a suitable climate, but the winters are still too cold. Vanilla requires a temperature above 60° F and relative humidity over 50%. A greenhouse helps with the issue, but is far too hot over the summer (and even during winter days). Another consideration with a greenhouse is that plants need CO2 , but emit oxygen. The enclosed space results in an oxygen rich atmosphere, not exactly ideal for growing plants.
A microcontroller connected to the right peripherals would be able to monitor and correct these environmental characteristics. This Arduino Mega-based greenhouse controller is built with three interior sensors and one exterior sensor monitoring temperature and humidity levels. Another interior sensor monitors the interior CO2 concentration. The controller is robust, with failsafe modes should the sensors fail. The controller is designed to accomodate 4 peripheral classes: ventilation fans, circulation fans, heaters, and humidifiers. They are plugged into control outlets on the controller (multiple must use a splitter). The design is modular so any combination of peripherals can be used, although as a bare minimum a ventilation fan should be employed. The controller is state-based, monitoring environmental conditions and operating the peripherals as needed. The outside sensor enable more energy-efficient operation. For example, if the outside temperature is warmer than it is inside, as tends to happen in the early morning, the ventilation fan will run instead of the heater. The controller prioritizes CO2 , temperature, and humidity in that order. It has different setpoints for day and nighttime operation (lower CO2 and temperature thresholds at night are acceptable).
Subsystems
The controller is composed of multiple subsystems, which were built and tested individually to make construction quicker and the design more robust. There is an LCD subsystem, LDR subsystem, Button-Encoder Subsystem, and CO2 Sensor Subsystem.
LCD
The LCD subsystem is one of the two subsystems users use to communicate with the controller. It's mainly just a standard 16x2 LCD. These are typically run directly off Arduino's without probllem. However, in this setup the LCD driver stays powered, even when the display has been cleared. In many scenarios this is a non-issue, but I thought I should measure the power draw just in case. This specific display drew ~60 mA, even when unused. In the big scale of things it's not that much energy (~2.5 kWh/year), but still enough to not want to go to waste. More pressingly this was a lot of power to pull from the Arduino constantly, especially when all the sensors needed to be run. So a high-side NPN transistor was used to switch the LCD on and off. This required the code to reinitialize the LCD driver everytime it was turned on, but that's a simple task with the Arduino built-in LCD library.
Button-Encoder
The Button-Encoder subsystem is the other subsystem uses use to communicate with the controller. It has 4 buttons used to navigate the menu and 1 rotary encoder used to adjust setpoints.
LDR
The LDR subassembly detects whether it is currently day or nighttime using light dependent resistors (LDRs). This is critical for the controller, which has separate modes and setpoints for day and nighttime operations. The subsystem actually has 3 LDRs, only one of which is in use at any time. It's designed this way because the subassembly has a watertight connection to the controller housing and removal would be a pain. So if an LDR fails, rather than removing the subassembly, the power wire can be switched from the failed LDR to one of the two remaining LDRs.
CO2 Sensor
The CO2 Sensor subsystem was required for reasons similar to the LCD subsystem. The sensor, regardless of whether it's being polled, takes a reading every few seconds, at which time it's power draw spikes to ~150 mA. So similar to the LCD, it is switched by an NPN transistor, though on the low-side here (for voltage drop reasons).
Temperature and Humidity Sensors, Relays
The temperature and humidity sensors are simply wired directly to the Arduino. They were placed at various heights inside the greenhouse to capture the range of environmental conditions in the greenhouse.
The relay control pins are also wired directly to the Arduino. The slave side interrupts the hot wire of the mains power supplied to the outlets controlling each peripheral. When closed, power is supplied to the peripheral.
Controller Operation
Aside from altering setpoints, little is required from the user. If a humidifier is employed, its water level needs to be checked manually. Similarly, because there is no watering mechanism built into the controller, the plants must be watered manually as well.
The setpoints can be altered without changing source code. It’s as simple as opening the protective cover and pressing any of the menu buttons. The menu is hierarchical, at the top are high level groupings (e.g. temperature, humidity) and at the bottom are the specific (e.g. daytime max temperature, daytime min temperature) setpoint selections. Setpoints are altered with a rotary encoder (i.e. rotating knob). Once selected, the controller operates based on the new setpoints. The menu is designed to be intuitive, but should users need additional help to operate the controller, a full users manual explains operation.