Select your language

© Borgmann Aquaponik & Hydroponik
Alle Rechte Vorbehalten
https://borgmann-aquaponik-hydroponik.ch

Viel Erfolg wünschen wir Ihnen!

Intelligent Irrigation & Nutrient Dosing:
      Automation Made Easy

After establishing the fundamentals of sensors and data acquisition, this article focuses on the automated control of irrigation and nutrient dosing processes in aquaponics and hydroponics systems. The goal is to reduce maintenance effort, increase efficiency, and ensure optimal plant supply based on continuously collected system data.

2.1 Principles of Automated Irrigation

Automated irrigation systems ensure that plants always receive the required amount of water and nutrients. This minimizes water waste and promotes healthy plant growth.

2.1.1 Automatic Refill System

A constant water level is crucial in both systems, but especially in hydroponics. Evaporation and plant uptake lead to continuous water loss. An automatic refill system efficiently compensates for this loss.

Technical Implementation:
  1. Water Level Sensor: A digital float switch or capacitive sensor (as discussed in Article 1) is placed at a specific minimum water level in the reservoir.
  2. Microcontroller: The ESP32 or Arduino monitors the sensor status.
  3. Actuator – Solenoid Valve or Pump: An electric solenoid valve (for mains water connection) or a small submersible pump (for external water tank) is connected to the microcontroller via a relay module. Relays are necessary to safely control the higher voltage and current of the actuators with the microcontroller.
  4. Control Logic: When the water level falls below the minimum value, the microcontroller activates the solenoid valve/pump for a defined time or until a predefined maximum water level is reached (this requires a second water level sensor or precise timer control).

Use a waterproof float switch that closes when falling below the minimum level. Connect it to your ESP32 via a digital input. Control a 12V submersible pump using a 1-channel relay module. The programming should include a delay after turning on the pump to prevent immediate switching off with slightly fluctuating water levels, and a maximum runtime to avoid overfilling in case of sensor failure.

// Vereinfachtes Arduino/ESP32 Code-Beispiel für Wasserstandsregler const int waterLevelPin = 2; // Digitaler Eingang für Schwimmerschalter const int pumpRelayPin = 4; // Digitaler Ausgang für Relais unsigned long pumpStartTime = 0; const long maxPumpRunTime = 60000; // 60 Sekunden max. Laufzeit (ms) void setup() { pinMode(waterLevelPin, INPUT_PULLUP); // Schwimmerschalter mit Pullup pinMode(pumpRelayPin, OUTPUT); digitalWrite(pumpRelayPin, HIGH); // Pumpe AUS (Relais oft inverted) Serial.begin(115200); } void loop() { if (digitalRead(waterLevelPin) == LOW) { // Wasserstand zu niedrig (Schalter geschlossen) if (digitalRead(pumpRelayPin) == HIGH) { // Pumpe ist noch AUS Serial.println("Wasserstand niedrig, Pumpe AN."); digitalWrite(pumpRelayPin, LOW); // Pumpe AN pumpStartTime = millis(); } } else { // Wasserstand ausreichend if (digitalRead(pumpRelayPin) == LOW) { // Pumpe ist noch AN Serial.println("Wasserstand OK, Pumpe AUS."); digitalWrite(pumpRelayPin, HIGH); // Pumpe AUS } } // Max. Laufzeit Überwachung für Sicherheit if (digitalRead(pumpRelayPin) == LOW && (millis() - pumpStartTime > maxPumpRunTime)) { Serial.println("WARNUNG: Pumpe läuft zu lange! Automatisch ausgeschaltet."); digitalWrite(pumpRelayPin, HIGH); // Pumpe AUS } }

2.1.2 Timer-Controlled Aquaponics Ebb-and-Flow Systems

In aquaponics systems with ebb-and-flow technique (also called flood-and-drain), precise time control of irrigation cycles is crucial for root oxygenation and nutrient supply.

Technical Implementation:
  1. Submersible Pump: A powerful submersible pump that transports water from the fish tank to the plant beds.
  2. Siphon or Overflow: A bell siphon or fixed overflow in the plant bed that drains water when reaching a certain height, initiating the "ebb" cycle.
  3. Microcontroller & Relay: The microcontroller controls the submersible pump via a relay module based on a predefined schedule.

Program the ESP32 so that the pump runs at regular intervals (e.g., every 30-60 minutes for 10-15 minutes). These time intervals can be adjusted depending on plant type, growth stage, and ambient temperature. Ensure a robust pump and high-quality relay, as these components are constantly in operation.

// Vereinfachtes Arduino/ESP32 Code-Beispiel für Ebb-and-Flow Pumpe const int pumpRelayPin = 4; const long floodDuration = 10 * 60 * 1000; // 10 Minuten Fluten (ms) const long ebbDuration = 50 * 60 * 1000; // 50 Minuten Ebbe (ms) long lastPumpToggleTime = 0; bool isFlooding = false; void setup() { pinMode(pumpRelayPin, OUTPUT); digitalWrite(pumpRelayPin, HIGH); // Pumpe AUS starten Serial.begin(115200); Serial.println("Starte Ebb-and-Flow Zyklus."); } void loop() { if (!isFlooding && (millis() - lastPumpToggleTime >= ebbDuration)) { // Ebbe-Phase beendet, starte Fluten Serial.println("Starte Flut-Phase."); digitalWrite(pumpRelayPin, LOW); // Pumpe AN lastPumpToggleTime = millis(); isFlooding = true; } else if (isFlooding && (millis() - lastPumpToggleTime >= floodDuration)) { // Flut-Phase beendet, starte Ebbe Serial.println("Starte Ebbe-Phase."); digitalWrite(pumpRelayPin, HIGH); // Pumpe AUS lastPumpToggleTime = millis(); isFlooding = false; } }

2.2 Precise Nutrient Dosing in Hydroponics

In hydroponics systems, the exact dosing of nutrients to maintain optimal EC value and pH value is of utmost importance. Manual addition is time-consuming and error-prone. Automated dosing systems ensure constant nutrient supply.

2.2.1 Automatic pH Regulation

The pH value tends to change over time. Automatic pH regulation based on real-time pH measurements is a key component for stable hydroponics systems.

Technical Implementation:
  1. pH Sensor: The pH sensor described in Article 1 continuously provides measurements.
  2. Microcontroller: The ESP32 compares the current pH value with the target value.
  3. Actuators – Peristaltic Pumps: Small peristaltic pumps are ideal for precise and slow dosing of pH-Up (bases) and pH-Down (acids). They move liquids by compressing a tube, avoiding direct contact of the liquid with the pump mechanism – important for corrosive acids/bases. Each pump requires its own relay or suitable motor driver.
  4. Control Logic:
    • If pH < target value (too acidic): A small amount of pH-Up is dosed.
    • If pH > target value (too basic): A small amount of pH-Down is dosed.

    It is important to include a waiting period (e.g., 5-15 minutes) after each dosing for mixing and a new measurement to avoid overshooting the control (PID controller approaches are ideal for this, but for beginners a simple hysteresis control may suffice).

Practical Idea: Simple pH Doser

Use two peristaltic pumps (one for pH-Up, one for pH-Down), each connected to the ESP32 via a 1-channel relay. Read the pH value. If the value is outside a defined tolerance range (e.g., target pH ± 0.1), activate the corresponding pump for 5-10 seconds. Then pause for 10-15 minutes before measuring and dosing again.

2.2.2 Automatic Nutrient Dosing (EC Value)

Plants consume nutrients, causing the EC value of the solution to decrease. Automatic dosing keeps the EC value in the optimal range, ensuring constant nutrient availability.

Technical Implementation:
  1. EC Sensor: The EC sensor (Article 1) provides current measurements.
  2. Microcontroller: Compares the measured EC value with the target EC.
  3. Actuators – Peristaltic Pumps: Depending on the nutrient system used, 2-3 peristaltic pumps are needed (for A, B components and possibly trace elements or boost). These pumps should be resistant to concentrated nutrient solutions.
  4. Control Logic: When the EC value falls below the target value, the nutrient components are dosed in a fixed ratio (follow manufacturer specifications!). Here too, waiting periods and new measurements after each dosing are essential.
Practical Idea: EC Doser with Fixed Ratio

Assume you are using a 2-component nutrient solution (A and B) mixed in a 1:1 ratio. Connect two peristaltic pumps via relays to the ESP32. When the EC value falls below the target value minus a tolerance, activate both pumps simultaneously for 5-10 seconds. Then wait 15-20 minutes before measuring again. Perform dosing in small steps to avoid overdosing.

2.3 Safety and Redundancy in Automation

Automated systems are convenient, but also pose risks in case of malfunction (e.g., overdosing, flooding). Safety mechanisms are therefore essential.

  • Maximum Dosing Amounts/Runtimes: Implement maximum runtimes for pumps or maximum dosing amounts per time unit in the code to prevent overdosing or flooding in case of sensor or software failures.
  • Additional Water Level Sensors: A second, independent water level sensor (e.g., a float switch as emergency shutoff) at a higher level can prevent overfilling even if the primary sensor fails.
  • Alerts: At critical values (e.g., pH value outside safe range despite dosing, water level problems), the system should generate an alarm message (e.g., email, push notification, acoustic signal). This will be covered in detail in a later article.
  • Manual Override: A simple way to manually switch off or bypass automation when needed should always be available.

2.4 Conclusion

The automation of irrigation and nutrient dosing transforms aquaponics and hydroponics systems from maintenance-intensive installations to precision-controlled environments. Through the use of microcontrollers and suitable actuators, reliable and efficient systems can be realized that ensure optimal plant supply while minimizing manual labor. The implementation of safety mechanisms is of utmost importance to prevent failures and ensure system stability. In the next step, we will focus on intelligent lighting control.

Context: