Stufin
Home Quick Cart Profile

M5Stack Watering Unit with Moisture Sensor and Pump

Buy Now on Stufin

Component Name

M5Stack Watering Unit with Moisture Sensor and Pump

Overview

The M5Stack Watering Unit with Moisture Sensor and Pump is a comprehensive IoT-based solution designed for automated watering and soil moisture monitoring applications. This module combines a high-precision moisture sensor, a water pump, and a microcontroller-based control system, making it an ideal choice for smart gardening, agriculture, and environmental monitoring projects.

Functionality

  • Soil Moisture Monitoring: Continuously measure the soil moisture levels using a high-precision sensor, providing accurate readings in real-time.
  • Automated Watering: Control the water pump to supply the optimal amount of water to the plants based on the soil moisture levels, ensuring plants receive the right amount of water.
  • Customizable Watering Schedules: Allow users to set custom watering schedules, including frequency, duration, and timing, to suit specific plant requirements.
  • Remote Monitoring: Integrate with the M5Stack ecosystem, enabling users to monitor soil moisture levels, watering schedules, and pump status remotely via the cloud or mobile app.
  • Alerts and Notifications: Send notifications and alerts to users when the soil moisture levels fall below a set threshold, ensuring timely intervention to prevent water stress.
The M5Stack Watering Unit with Moisture Sensor and Pump is capable of

Key Features

  • High-Precision Moisture Sensor: Featuring a high-accuracy capacitive soil moisture sensor with a measurement range of 0-100% and an accuracy of 3%.
  • Water Pump: Includes a built-in, compact DC water pump capable of delivering a maximum flow rate of 1.5L/min and a maximum pressure of 1.5bar.
  • Microcontroller-Based Control System: Built around the ESP32 microcontroller, providing Wi-Fi and Bluetooth connectivity, and supporting a wide range of programming languages.
  • Modular Design: Features a modular design, allowing users to easily integrate the module with other M5Stack units and expansion boards.
  • Power Management: Equipped with a battery management system, supporting Li-ion battery charging and monitoring, with a maximum input voltage of 5V.
  • Compact Form Factor: Measuring only 54mm x 54mm x 25mm, making it suitable for a wide range of applications, from small-scale gardens to large-scale agricultural projects.

Technical Specifications

| Specification | Description |

| --- | --- |

| Moisture Sensor Measurement Range | 0-100% |

| Moisture Sensor Accuracy | 3% |

| Water Pump Flow Rate | 1.5L/min |

| Water Pump Pressure | 1.5bar |

| Microcontroller | ESP32 |

| Connectivity | Wi-Fi, Bluetooth |

| Power Input | 5V (Li-ion battery charging) |

| Dimensions | 54mm x 54mm x 25mm |

| Weight | 120g |

| Operating Temperature | -20C to 85C |

| Storage Temperature | -40C to 125C |

Applications

  • Smart Gardening
  • Precision Agriculture
  • Environmental Monitoring
  • Automated Irrigation Systems
  • Greenhouse Automation

Certifications and Compliance

CE, FCC, and RoHS certified

Complies with relevant safety and environmental regulations

Warranty and Support

1-year limited warranty

Dedicated customer support and technical assistance

Comprehensive documentation and tutorials available

Pin Configuration

  • M5Stack Watering Unit with Moisture Sensor and Pump Pinout Guide
  • The M5Stack Watering Unit with Moisture Sensor and Pump is a comprehensive IoT module designed for automating plant watering systems. This documentation provides a detailed explanation of each pin on the module, helping users understand how to connect and utilize the component effectively.
  • Pinout Structure:
  • The M5Stack Watering Unit has a total of 11 pins, which can be categorized into three groups:
  • 1. Moisture Sensor Pins (3 pins)
  • 2. Pump Control Pins (3 pins)
  • 3. Power and Communication Pins (5 pins)
  • Pin Description:
  • Moisture Sensor Pins:
  • 1. AO (Analog Out) Pin: This pin provides an analog signal output from the moisture sensor, indicating the soil moisture level. The voltage output ranges from 0V to 3.3V, with higher voltages indicating higher moisture levels. Connect this pin to an analog input pin on your microcontroller (e.g., ESP32, Arduino) to read the moisture data.
  • 2. VCC Pin: This pin supplies power to the moisture sensor. Connect it to a 3.3V power source (e.g., VCC pin on the M5Stack Core module).
  • 3. GND Pin: This pin provides a ground connection for the moisture sensor. Connect it to a ground pin on your microcontroller or power supply.
  • Pump Control Pins:
  • 1. PUMP Pin: This pin controls the water pump. Connect it to a digital output pin on your microcontroller to enable/disable the pump. A HIGH signal (3.3V) turns on the pump, while a LOW signal (0V) turns it off.
  • 2. PUMP_VCC Pin: This pin supplies power to the water pump. Connect it to a 5V power source (e.g., VCC pin on the M5Stack Core module).
  • 3. PUMP_GND Pin: This pin provides a ground connection for the water pump. Connect it to a ground pin on your microcontroller or power supply.
  • Power and Communication Pins:
  • 1. 5V Pin: This pin provides a 5V power output, which can be used to power external devices or modules.
  • 2. GND Pin: This pin provides a ground connection for the module. Connect it to a ground pin on your microcontroller or power supply.
  • 3. RX Pin: This pin is the receive pin for serial communication (UART). Connect it to the TX pin on your microcontroller.
  • 4. TX Pin: This pin is the transmit pin for serial communication (UART). Connect it to the RX pin on your microcontroller.
  • 5. EN (Enable) Pin: This pin is used to enable or disable the onboard voltage regulator. Connect it to a digital output pin on your microcontroller to control the power supply. A HIGH signal (3.3V) enables the voltage regulator, while a LOW signal (0V) disables it.
  • Connection Example:
  • To connect the M5Stack Watering Unit with an M5Stack Core module and a water pump, follow these steps:
  • 1. Connect the AO pin to an analog input pin on the M5Stack Core module (e.g., Pin 32).
  • 2. Connect the VCC pin to the 3.3V power output on the M5Stack Core module.
  • 3. Connect the GND pin to a ground pin on the M5Stack Core module.
  • 4. Connect the PUMP pin to a digital output pin on the M5Stack Core module (e.g., Pin 26).
  • 5. Connect the PUMP_VCC pin to the 5V power output on the M5Stack Core module.
  • 6. Connect the PUMP_GND pin to a ground pin on the M5Stack Core module.
  • 7. Connect the RX pin to the TX pin on the M5Stack Core module.
  • 8. Connect the TX pin to the RX pin on the M5Stack Core module.
  • 9. Connect the EN pin to a digital output pin on the M5Stack Core module (e.g., Pin 25).
  • Important Notes:
  • Ensure proper voltage levels and pin connections to avoid damage to the module or connected devices.
  • Use a suitable relay module or transistor to control the water pump if it requires more current than the M5Stack Watering Unit can provide.
  • Consult the datasheet and documentation for the specific water pump and microcontroller used in your project for detailed connection and usage guidelines.

Code Examples

M5Stack Watering Unit with Moisture Sensor and Pump
The M5Stack Watering Unit with Moisture Sensor and Pump is a compact, all-in-one IoT device designed for automating plant watering and monitoring soil moisture levels. This device combines a high-accuracy moisture sensor, a built-in water pump, and a modular design, making it an ideal solution for smart gardening and agriculture applications.
Hardware Specifications:
Microcontroller: ESP32 (dual-core 32-bit LX6 microprocessor)
 Moisture Sensor: High-accuracy capacitive sensor with a range of 0-100% relative humidity
 Water Pump: DC 3-6V, 100mA, with a maximum lift of 1.5m
 Power Supply: USB-C (5V, 2A)
 Communication: Wi-Fi, Bluetooth 4.2
 Operating Temperature: -20C to 60C
 Dimensions: 54mm x 54mm x 25mm
Software Libraries and Dependencies:
To use the M5Stack Watering Unit with Moisture Sensor and Pump, you will need to install the following libraries and dependencies:
M5Stack Library (for ESP32 microcontroller)
 WiFi Library (for Wi-Fi connectivity)
 BLE Library (for Bluetooth Low Energy connectivity)
Code Examples:
### Example 1: Basic Soil Moisture Monitoring and Watering
This example demonstrates how to use the M5Stack Watering Unit to monitor soil moisture levels and automatically water plants when the soil becomes too dry.
```c++
#include <M5Stack.h>
#include <WiFi.h>
#define MOISTURE_SENSOR_PIN 36 // Pin for moisture sensor
#define PUMP_PIN 27 // Pin for water pump
void setup() {
  // Initialize serial communication
  Serial.begin(115200);
// Initialize M5Stack
  M5.begin();
// Initialize moisture sensor
  pinMode(MOISTURE_SENSOR_PIN, INPUT);
// Initialize water pump
  pinMode(PUMP_PIN, OUTPUT);
}
void loop() {
  int moistureLevel = analogRead(MOISTURE_SENSOR_PIN);
  moistureLevel = map(moistureLevel, 0, 4095, 0, 100);
Serial.print("Soil Moisture Level: ");
  Serial.print(moistureLevel);
  Serial.println("%");
if (moistureLevel < 30) {
    // Water plants if soil moisture level is below 30%
    digitalWrite(PUMP_PIN, HIGH);
    delay(5000); // Water for 5 seconds
    digitalWrite(PUMP_PIN, LOW);
  }
delay(1000); // Check soil moisture level every 1 second
}
```
### Example 2: Remote Soil Moisture Monitoring and Watering Control via Wi-Fi
This example demonstrates how to use the M5Stack Watering Unit to monitor soil moisture levels remotely via Wi-Fi and control the water pump using a remote web interface.
```c++
#include <M5Stack.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <ESPAsyncWebServer.h>
#define MOISTURE_SENSOR_PIN 36 // Pin for moisture sensor
#define PUMP_PIN 27 // Pin for water pump
// Replace with your Wi-Fi credentials
const char ssid = "your_wifi_ssid";
const char password = "your_wifi_password";
AsyncWebServer server(80);
void setup() {
  // Initialize serial communication
  Serial.begin(115200);
// Initialize M5Stack
  M5.begin();
// Initialize moisture sensor
  pinMode(MOISTURE_SENSOR_PIN, INPUT);
// Initialize water pump
  pinMode(PUMP_PIN, OUTPUT);
// Connect to Wi-Fi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to Wi-Fi...");
  }
  Serial.println("Connected to Wi-Fi");
  Serial.println("Starting web server...");
server.on("/", HTTP_GET, [](AsyncWebServerRequest request) {
    request->send(200, "text/html", "<html><body><h1>Soil Moisture Level: " + String(analogRead(MOISTURE_SENSOR_PIN)) + "%</h1><form action=""/water""><input type=""submit"" value=""Water Plant""></form></body></html>");
  });
server.on("/water", HTTP_GET, [](AsyncWebServerRequest request) {
    digitalWrite(PUMP_PIN, HIGH);
    delay(5000); // Water for 5 seconds
    digitalWrite(PUMP_PIN, LOW);
    request->send(200, "text/html", "<html><body><h1>Plant watered successfully!</h1></body></html>");
  });
server.begin();
}
void loop() {
  // Update soil moisture level on web page
  server.handleClient();
  delay(1000);
}
```
Note: These examples are for illustrative purposes only and may require modifications to suit specific use cases and applications. Always ensure proper calibration and testing of the M5Stack Watering Unit with Moisture Sensor and Pump before deploying it in real-world scenarios.