Greenhouse Automation using Arduino Edge Control

author avatar

23 Aug, 2023

Greenhouse Automation using Arduino Edge Control

Automating the food supply is key to securing future food supply chains.

Introduction

Agricultural automation has become a sought-after interest in the 21st century. Using sensors and actuators the entire farming process can be controlled to mitigate waste and increase yield. Various tools and systems have been designed with the aim of realizing end-to-end automation in the agricultural sector. 

This article provides application notes and illustrations for the new Arduino Edge Control. It uses an example of an automated greenhouse to demonstrate the capabilities of the Edge Control and provides detail on the various sensors, actuators, and power and connectivity options.

Agriculture and the need for automation

In the past decade, agriculture has experienced a series of challenges including a declining workforce and increasingly harsh and unpredictable weather conditions. Global warming, pandemics, and regional conflicts have had a further toll on global food supplies - with the UN warning of critical food shortages amidst rising prices. At the same time, the world’s population is increasing rapidly and is expected to reach almost 9.7 billion by the year 20501

The current agricultural production needs to be increased by at least 70%2 to meet the demands of the future. In short, agriculture today needs to find strategies to solve the issue of rising demand on one side, and a lack of production, workers, and arable land on the other.

Automated greenhouses are a proven tool to increase crop yield while producing less food waste. Automation provides a structured, data-driven approach to crop care. 

Advanced automation provides more food per square meter and protects crops from extreme weather conditions. In order to automate farming techniques, farmers need to combine their existing knowledge with cutting-edge new technologies. 

Key challenges in the way of automation agriculture are high initial costs, interoperability of devices, connectivity in rural areas, security concerns, and monitoring and maintenance of the implemented automation systems3,4. Therefore, low-cost prototyping solutions are required which allow enhanced connectivity and interoperability options with minimum maintenance and human intervention.

Automating with Arduino Pro

The Arduino Edge Control was launched as part of the Arduino Pro Series for control and monitoring of remote environments while deploying Artificial Intelligence (AI) on the edge. The board is suitable for a diverse range of applications which require smart control in remote locations such as agricultural automation, precision farming, and environmental and geophysical sensing etc.

The Edge Control can enhance farming productivity by collecting data and making accurate data-driven decisions. It is especially useful in control of highly sensitive farming processes such as hydroponics, aquaponics and mushroom cultivation which require precise temperature and humidity control. The components of the Edge Control board are designed with a higher temperature range to deal with harsh environments. It can be connected to a variety of sensors to collect real-time data on weather conditions, soil quality, CO2 levels, pest infections and crop growth. The Arduino Edge Control.

This data can then be uploaded to the Arduino IoT Cloud and analyzed to track trends and useful information regarding crop yield, equipment efficiency, and staff performance etc. Based on this information, Arduino Edge control can automate farming activities like irrigation, temperature control, and fertilization using actuators driven and controlled by the board. An automated greenhouse can therefore create an ecosystem that functions with a higher efficiency and reduced human effort and error. 


A closer look at Arduino Edge Control 

The Arduino Edge control enables a range of features packed into an 86 x 104 mm footprint. The board allows high processing power, enhanced memory capacity, expandable connectivity and interoperability. 

Processor and Memory

The board employs a Nordic Semiconductor nRF52840 system-on-chip with a 64MHz Arm Cortex-M4F processor core. It provides 1MB of on-board flash and 2MB of additional QSPI flash memory as well as a microSD slot for additional storage. 

I/Os, Sensors and Actuators

The board’s I/Os consist of six edge-sensitive digital input pins equipped with interrupt wakeups, four 4-20 mA analog inputs, eight 0-5V analog inputs, and 16 inputs dedicated to hydrostatic watermark sensors. The analog and digital input pins support connection to various types of sensors to collect environmental data like soil moisture, temperature, humidity etc. Especially useful for greenhouse applications are Tensiometers and Watermark soil moisture sensors. Up to 16 such sensors can be connected to specialized I/Os on the Edge Control. 

The board also allows connection to several actuators such motors, motorized valves etc. The board provides 16 latching outputs with eight outputs enabled with latching drivers and eight driverless outputs. Additionally, four galvanically isolated relays are included that can support 60V/2.5A devices. For on-site data monitoring and control, an external LCD panel can be connected using a special connector on the board.

The Arduino Edge Control board.

Connectivity

The Edge Control board comes with built-in Bluetooth connectivity and dual MKR sockets on both sides that allow connection of two Arduino MKR boards as "networking co-processors". Using the MKR boards, the network capabilities can be extended to include LoRa®, GSM, NB-IoT and Wi-Fi. For instance, the Edge control can be simultaneously connected to an MKR Wi-Fi 1010 to form a Wi-Fi connection with the IoT Cloud and an MKR WAN 1300 to enable LoRa®/LoRaWAN® connectivity. 

The Arduino MKRs have to be loaded with their own sketch to manage connectivity and I/O data with the Edge Control board. Secondly, for data exchange, the Edge Control and MKR boards need to implement any UART/I2C based communication protocol. The range of connectivity options offered imply that the Edge Control can be conveniently deployed in the most remote locations and monitored wirelessly. 

Power

The Edge Control board is designed as a low power consumption device and requires a 12V input power source or a solar powered battery system ideal for remote farming applications. When connected to a 5Ah battery, the board has an operational lifespan of up to 34 months using a low sleep current of 200uA. 

Safety and Security

The Arduino Edge Control, when connected to an MKR Wi-Fi shield (such as the 1010 Wi-Fi board), gets an added layer of security due to the microchip ECCx08 embedded in it. Designed for harsh and unpredictable weather locations, the Edge board can operate within a wide temperature range of -40 to +85°C (-40 to 185°F). It is classified as Class A safe digital device and adequate for prototyping and end-user applications.

Machine Learning

Being an open source platform, the Arduino Edge Control can be programmed conveniently via the Arduino IDE. The platform also supports TensorFlow Lite micro for machine learning applications. Machine Learning enables an automated system to run much faster while consuming less power. Processing is confined to the smart system thereby preserving privacy and security.

 For instance, an automated greenhouse system whose goal is to maintain an optimum temperature within the enclosure, can use predictions to anticipate the actions to take (such as opening shutters etc.) and data feedback can be used to see the efficiency of the process. In this way, a system can be customized to a specific farming environment leading to vast reduction in costs and power consumption.

Case Example – Monitoring and Control of an Industrial Agricultural Greenhouse

To demonstrate the automation capabilities of the Arduino Edge Control, this next section unpacks an example application of a commercial greenhouse. 

The case study is using a typical production greenhouse with a width of approximately 6 meters and with multiple plantation aisles running along the center. The Edge Control will be used in conjunction with sensors including soil moisture sensors, temperature and humidity sensors and light dependent resistors to monitor the greenhouse environment. The environment will in turn be controlled using actuators such as motorized ball valves and stepper motors to maintain optimal performance. 

Equipment Required

  • Arduino Edge Control board
  • 18 V Solar panel 5
  • 12V/5Ah lead acid SLA battery (11 - 13.3V)6
  • Connecting cables, jumper wires (length as required)
  • 200SS Watermark soil moisture sensors 7
  • Arduino MKR ENV Shield8
  • US Solid Motorised Ball Valves (9 - 24 V)10
  • L298N Motor Driver11
  • Stepper motors (with movable shutters)12

Optional

  • 16x2 LCD for local monitoring and control13
  • Arduino MKR Wi-Fi 1010 board (for expanding wireless connectivity)14

Placement and Settings

The Arduino Edge Control board will act as the control system of the automated greenhouse. The Edge control board along with its connected peripherals (Wi-Fi MKR board, LCD, and drivers) is placed in an enclosed housing to prevent harm from the environment and human intervention. For this purpose, a wooden or metallic vented enclosure15 can be designed or an Arduino Edge control Enclosure Kit16 can be used. This is important to ensure minimal external impact and in turn, minimal maintenance. The entire assembly is placed close to sensors and actuators to prevent excessive power loss through the connecting cables.

The Arduino Edge Control enclosure with LCD panel.

Powering the Arduino

The Arduino Edge Control can be powered using both standalone batteries and solar panels. A truly sustainable and remotely automated solution would be realized if solar energy is adequately used to power the equipment. A greenhouse provides sufficient area on its roof and sides to connect solar panels especially in open agricultural areas where sunlight is not obstructed by other structures. An 18V solar panel is connected to charge a lead acid battery which then supplies 12V to the Arduino. 

The battery output should be connected to the B (Battery) and GND (Ground) pins of the edge control. The solar panel can be connected directly to the S (Solar) pin, however, using a battery is beneficial for maintaining power at night and on cloudy days. The battery can also be used to power various actuators, motors and lighting fixtures across the greenhouse. 

The Arduino Edge Control in an automated greenhouse application.

Sensors and Data Collection

Sensors measuring soil moisture, ambient temperature and humidity and lighting are used in this scenario. A single Edge Control Board allows connection to 16 200SS Watermark moisture control sensors7. Typically, a single moisture sensor can give a good measurement of soil water content for an area of similar crops and irrigation/weather conditions. Therefore, the Edge Control can be connected to up to 16 aisles/areas of plantation in a greenhouse. Multiple moisture sensors are required when more than one variety of plants is being used. 

In order to measure additional physical parameters inside the greenhouse, an Arduino MKR ENV shield is used. The ENV shield provides a 3-in-1 functionality by reading temperature, humidity, light and pressure data. The shield can be attached to the free MKR slot of the Arduino Edge board. The ENV shield is equipped with the HTS221 sensor capable of reading temperatures between -40 and +120 °C and humidity ranging from ± 3.5% to +80% rH (relative humidity).

Also built into the ENV shield is the TEMT6000 light sensor, a phototransistor that can measure light intensity within a range of 440 nm to 800 nm. The light sensor is used to detect the changing of night and day within the greenhouse based on light intensity. This is useful as at night plants retain moisture and do not need regular irrigation.

Connectivity

The Arduino Edge Control is programmed to initialize peripherals such as the LCD, watermark sensor, LDR and MKR slots upon booting. A loop function is used to continuously read data from Watermark and DHT22 sensors as well as the LDR and is then transferred to the local server. This is done using an Arduino MKR WiFi 1010 board connected to the right or left MKR slot. As part of the loop function, both the sensor and battery level values are read repeatedly and then sent to the MKR WiFi 1010 via I2C. The data can then be stored in the Arduino Cloud and communicated to user’s personal devices for extraction of useful information.

Overview of the Arduino Edge Control.

Automated Control

Based on the sensor readings, the Arduino Edge control is programmed to automate the greenhouse irrigation system, lighting, temperature and humidity.

Irrigation can be controlled via motorized valves connected to the Arduino. The valves will be fitted along the water pipes that lead to plantation aisles. Motorized Ball Valves by U.S. Solid are a good option and come in a two-way configuration. The valve has three color marked wires with red and blue connected to 1P and 1N latching outputs of the Edge Control board while yellow is connected to GND pin.

The valve will open when a signal Is passed through the positive pin and close when a signal is given through the negative pin. In this way the water discharged through the irrigation pipes is controlled. The Edge Control board can control up to 8 latched valves (1N:1P up to 8N:8P). There are 8 latching outputs on the Edge Control (1N:1P up to 8N:8P). Latching outputs with drivers should be used when the connected valve/actuator itself does not have drivers to store the signal’s previous state. Using the output of the LDR, irrigation can be halted at night.

Temperature and humidity within the greenhouse can be automated using a number of techniques like opening or closing of vents, shutters and retractable roofs, air-conditioning and wet wall methods. Infrared lighting can be used to control temperature and humidity. The best results are achieved when multiple techniques are used in conjunction. In this case, motorized shutters are used for ventilation and cooling using stepper motors. The motors are connected to the digital pins of the Edge control board and the power supply via L298N motor driver modules. The driver can be easily used to control the direction and speed of the motors and shutters. In order to connect more than one motor, the analogue pins on the board may be used as digital outputs or through the use of shift registers. 

An example control layout.

Conclusion

This application note gives an overview of how an Arduino Edge Control can be used to automate a single greenhouse. Users can customize this automation setup by varying the number, placement and programming of the equipment and system to suit their farming needs.

Automation has become a necessity for agriculture. To tackle the crop shortage and supply problems facing the world today, automated agricultural practices can provide long term sustainability and returns. Arduino Edge Control provides a unique set of features suited to automating greenhouses, farms and commercial agricultural projects. 

Using the Edge Control, farmers can monitor and control crops quality parameters remotely resulting in minimal human interference and maintenance. This article gives an example of a greenhouse with automation applied to a few aspects. Users can customize their experience with the Arduino Edge Control for precision farming optimized according to their own applications.

For more information on the board and its applications check the Arduino Pro website. 

References

1.    United Nations. World Population Prospects - Population Division - United Nations. Published 2022. Accessed September 18, 2022. https://population.un.org/wpp/

2.    Food and Agriculture Organization. Food and agriculture projections to 2050. United Nations. Published 2009. Accessed September 18, 2022. https://www.fao.org/global-perspectives-studies/food-agriculture-projections-to-2050/en/

3.    Villa-Henriksen A, Edwards GTC, Pesonen LA, Green O, Sørensen CAG. Internet of Things in arable farming: Implementation, applications, challenges and potential. Biosyst Eng. 2020;191:60-84. doi:10.1016/j.biosystemseng.2019.12.013

4.    Rettore de Araujo Zanella A, da Silva E, Pessoa Albini LC. Security challenges to smart agriculture: Current state, key issues, and future directions. Array. 2020;8:100048. doi:10.1016/j.array.2020.100048

5.    Amazon. Enernova Portable Solar Panel 100W 18V, Solar Charge with IP65 Waterproof Adjustable Kickstand for Power Station Generator. Amazon. Accessed September 18, 2022. https://www.amazon.com/Waterproof-Adjustable-Kickstand-Generator-Connectors/dp/B09YH6X5H7/ref=sr_1_1_sspa?keywords=18v+solar+panel&qid=1663062044&sr=8-1-spons&psc=1

6.    Amazon. ML5-12 - 12 Volt 5 AH, F1 Terminal, Rechargeable SLA AGM Battery : Amazon. Accessed September 18, 2022. https://www.amazon.com/Mighty-Max-Battery-ML5-12-Rechargeable/dp/B079ZCJYP3

7.    Irrometer. Irrometer Watermark Soil Moisture Sensors. Irrometer. Accessed September 18, 2022. https://www.irrometer.com/sensors.html#wm

https://store-usa.arduino.cc/products/soil-humidity-sensor-watermark-2-m-75-cm-pack-of-6 Accessed February 23, 2023

8.    Team TA. Mkr Env Shield [Internet]. Arduino; [cited 2023 May 25]. Available from: https://docs.arduino.cc/hardware/mkr-env-shield

9.    Amazon. Ardest Photoresistor GL5528 Light Dependent Resistor LDR. Amazon. Accessed September 18, 2022. https://www.amazon.com/Photoresistor-Dependent-Resistor-Luminosity-Electronic/dp/B06XHFDYRT

10.    US Solid. Valves - Motorized Ball Valves - By Voltage - 9-24V AC/DC. US Solid. Accessed September 18, 2022. https://ussolid.com/9-24v-ac-dc-motorized-ball-valve.html

11.    Amazon. AEDIKO 4pcs L298N Motor Driver Controller Board DC Dual H-Bridge Robot Stepper Motor Control Module. Amazon. Accessed September 18, 2022. https://www.amazon.sa/-/en/AEDIKO-Controller-H-Bridge-Stepper-Control/dp/B09BCYMMRH/ref=asc_df_B09BCYMMRH/?tag=sashogostdde-21&linkCode=df0&hvadid=499117434124&hvpos=&hvnetw=g&hvrand=12924452665091983151&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9076771&hvtargid=pla-1506769725726&psc=1

12.    Amazon. Generic Nema17 4-lead Bipolar Nema 17 Stepper Motor. Amazon. Accessed September 18, 2022. https://www.amazon.in/Generic-Nema17-Bipolar-Stepper-Printer/dp/B07GSZBTJW

13.    Grove - 16X2 LCD RGB Backlight - Full Color Display. saeedstudio. Accessed September 18, 2022. https://www.seeedstudio.com/Grove-LCD-RGB-Backlight.html

14.    Arduino MKR WiFi 1010. Arduino Official Store. Accessed September 18, 2022. https://store.arduino.cc/products/arduino-mkr-wifi-1010

15.    How to Protect Outdoor Electronics with Junction Boxes. TechTalk Blog. Published July 6, 2021. Accessed September 18, 2022. https://www.polycase.com/techtalk/electronics-junction-boxes/how-to-protect-outdoor-electronics.html

16.    Arduino. Arduino Edge Control Enclosure Kit. Arduino Official Store. Accessed September 18, 2022. https://store.arduino.cc/products/edge-control-enclosure-kit

More by Fatima Khalid

Fatima Khalid is a location independent writer with a passion for science and engineering. She is a published writer and researcher in the domain of on-chip antennas, reconfigurable elements and energy harvesting devices. She has a Master's degree in electrical engineering from NUST, Islamabad and e...