Arduino automation
In the next chapters, we setup the Arduino-based grow box monitoring and controlling system. This page is to overview the components and the steps you need to take to implement them.
In the next chapters, we setup the Arduino-based grow box monitoring and controlling system. This page is to overview the components and the steps you need to take to implement them.
Main module: Central unit consisting of an ESP8266 SoC running the ESP-link firmware and an ATmega2560 microcontroller running the Gbox420_Mega Arduino sketch. The Arduino Mega is responsible for controlling AC power, responding to user commands and forwarding them to the other modules, wirelessly collecting the sensor readings from all modules, and relaying them to ESP-link. The ESP chip acts as a web server hosting the Gbox420 web interface where it displays sensor readings and accepts user commands. It also acts as a gateway to the internet where it gets the current time from and relays sensor readings to Google Sheets for long-term storage. The main module is placed outside the grow box due to the heat generated by the LED drivers and the rule of thumb to keep most AC-powered components far from water sources.
Main module extension: A physical extension of the main module that is placed inside the grow box to monitor environmental conditions. It measures temperature, humidity, and light intensity. A single UTP cable provides power to the sensors and connects them to the Arduino Mega at the same time.
Reservoir module: Based on an Arduino Nano, monitors the water reservoir. Measures PH, water temperature and the weight of the reservoir to determine the remaining nutrient solution quantity. As the reservoir is usually placed close to the air intakes to keep it cool, the module is also equipped with air temperature, and humidity sensors to monitor incoming fresh air.
Hempy module: Based on an Arduino Nano, monitors and waters two Hempy buckets. Measures the weight of the Hempy buckets to determine when and how much to water, controls the two water pumps for the drip lines.
Aero module: Based on an Arduino Nano, controls the misting cycle in the high-pressure aeroponics tote. Operates the high-pressure pump and bypass/spray solenoids. The module supports two operating modes:
Without pressure tank: With this setup, the high-pressure pump is directly connected to the misting loop, the pump's throughput and the number of misting heads determine the spray pressure. The pressure sensor is used to measure the pressure during misting.
With pressure tank: The high-pressure pump charges a pressure tank that provides constant spray pressure. The pressure sensor is used to measure the pressure inside the tank, when the pressure drops below a pre-set limit the pump is turned on to refill the tank till the pre-set pressure limit.
Common among Arduino Nano modules:
They run a stripped-down version of the Gbox420 sketch called Gbox420_Nano that is optimized for the limited (2 kilobytes) available SRAM on the Arduino Nano.
They can function autonomously to keep plants alive even when the Main module is offline. In stand-alone mode sensor readings are only logged to the Serial output.
The sketches are compatible with the Arduino RF Nano board that already has the wireless module integrated.
Common among all modules:
12V DC power input: Each module is powered from the same 12V DC power brick. The exact voltage required by the different components (pumps, solenoids, sensors, Arduino boards) is generated using DC to DC step-down buck converters.
Buzzer audio feedback: Each module is equipped with a buzzer that provides beep feedback then a user command is received.
The built-in LED should be turning on/off every ~1 second on each Arduino board. This heartbeat shows that the Gbox420 code is running.
Wireless transmitter: Each module is equipped with an nRF24L01+ wireless transmitter, used to relay data between the modules. The Main module always acts as the transmitter, all other modules are listening for a Control package with their address in it. When a module receives a package it immediately responds with a pre-cached Report package containing its current status, then applies the commands received in the Control package. The Main module does loops querying all modules every 5 seconds one-by-one. The theoretical module limit is 125, but this was never tested. (Please let me know if you managed to hit this limit! )
Gbox420 web interface: The sensor readings and user inputs of all modules are on a single web-page hosted by the ESP chip on the local WiFi. Any device with a web browser that is connected to the same WiFi can access the control interface. The web interface automatically refreshes itself every 5 seconds with the latest readings.
Cloud-based logging: Sensor readings of all modules are collected by the Main module and sent to Google Sheets through PushingBox message API. The data arriving at Google Sheets is processed by Google App Scripts that generate an overview of the latest status, sends out email alerts if a sensor reading is out of limits, and draws charts to show historical changes in the readings.
The Components and Modules inside the src library are compatible with the Arduino Nano and Arduino Mega boards. (The Components_Web and Modules_Web folders are Arduino Mega specific, they contain the extra code required for the web interface)
The user interface is web-based and compatible with any HTTP-capable browser (Desktop, tablet, and mobile).
Gbox420 - Desktop / Tablet interface
Gbox420 - Mobile interface
Here you will find the guides you should follow to implement each of the components shown above.
Arduino IDE setup: Installing the Arduino development environment is a required step. Without it, you cannot upload sketches to an Arduino board.
Visual Studio Code setup (Optional): If you decide to customize the Gbox420 sketch it is recommended to use Visual Studio Code. PS: You still need the Arduino IDE installed.
ESP8266 setup: Uploading the ESP-link firmware to the ESP8266 chip and preparing it to communicate with the Gbox420 sketch and adding the Gbox420 web interface.
Cloud-based logging setup: Creating the PushingBox data relay service and setting up the Google Sheets where the sensor data will get logged.
Main module setup: Wiring the Main module and uploading the Gbox420_Mega_Main sketch.
*Reservoir module setup: Wiring the Reservoir module and uploading the Gbox420_Nano_Reservoir sketch.
*Hempy module setup: Wiring the Hempy bucket module and uploading the Gbox420_Nano_Hempy sketch.
*Aero module setup: Wiring the Aeroponics module and uploading the Gbox420_Nano_Aero sketch.
* You can have multiple instances of the same module reporting to a single Main module. (Requires customizing the Gbox420_Mega_Main code)