4.1.2. Moisture Sensor—DFRobot

We used a SEN0308 DFRobot soil humidity sensor, which detects soil humidity and sends analog signals to the ESP32. The sensor is shown in Figure 4.

**Figure 4.** DFRobot moisture sensor.

The SEN0308 is a capacitive moisture sensor that offers improved waterproof performance, increased length, and high corrosion resistance [28]. It solves a critical issue encountered with commonly used resistive moisture sensor probes, which is probe corrosion. The SEN0308 has excellent corrosion resistance and can be inserted into the soil for long periods.

We inserted the sensor probe into the soil. The sensor measures changes in capacitance that are caused by alterations in the dielectric due to humidity [29]. It does not measure moisture directly but instead measures the moisture's ions. The sensor sends analog signals to the ESP32 based on the measurement, which is converted to a digital signal by the ESP32.

#### 4.1.3. Temperature Sensor—DS18B20

We used a DS18B20 one-wire bus temperature sensor probe, as shown in Figure 5. These sensors provide up to 12-bit temperature measurements in Celsius and have an alarm function with non-volatile user-programmable lower and upper trigger points. Each sensor has a unique 64-bit ID burned in at the factory to differentiate them, which allows us to control multiple sensors with a single GPIO pin of a microcontroller. This sensor's significant advantages are its high accuracy and waterproofing [30].

**Figure 5.** DS18B20 waterproof temperature sensor.

#### 4.1.4. Air Humidity Sensor—DHT22

We used a DHT22 humidity–temperature sensor, as shown in Figure 6. It is low-cost and uses a capacitive humidity sensor to measure the humidity in the air. It also uses a thermistor to measure the temperature. The data can be obtained from the data pin of the DHT22. The DHT22 is good for 0–99.9% humidity readings wit +/−2% accuracy [31].

**Figure 6.** DHT22 air humidity sensor.

4.1.5. Water Flow Sensor—FS300A G3/4 Inch

The FS300A consists of a water rotor, a hall-effect sensor, and a plastic valve body, as shown in Figure 7. The water flows in through the inlet and out through the outlet due to the flow of water and the wheel rolls, and so does the magnet. The rotation of the magnet triggers the hall-effect sensor, which outputs high- and low-square waves. We calculate the water flow by counting the square waves [32].

**Figure 7.** FS300A G3/4 inch water flow sensor.

4.1.6. Solenoid Valve—Hunter PGV-100G (24VAC)

We used a hunter PGV one-inch solenoid valve, which is an electrically controlled valve. This valve is shown in Figure 8. A solenoid is an electric coil with a movable magnetic core. Applying an electric current to this coil creates a magnetic field, which moves the core and allows water to flow. If the current is cut off, the valve closes, and the water flow stops [33].

**Figure 8.** Hunter PGV-100G solenoid valve.

### 4.1.7. Relay

A relay is a simple electrically controlled switch. By sending a signal from the ESP32, we can turn the switch on and supply a 24 V AC to the solenoid valve and open it.
