WateringUnit

Watering is a capacitive soil moisture detection and adjustment unit. The product integrates water pump and measuring plates for soil moisture detection and pump water control. It can be used for intelligent plant breeding scenarios and can easily achieve humidity detection and Irrigation control. The measurement electrode plate uses the capacitive design, which can effectively avoid the corrosion problem of the electrode plate in actual use compared with the resistive electrode plate.

Support the following products:

WateringUnit

Micropython Example:

import os, sys, io
import M5
from M5 import *
import time
from unit import WateringUnit
water = WateringUnit((33,32)) # for core2
water.on()
time.sleep(1)
water.off()
print(water.get_voltage())
print(water.get_raw())

class WateringUnit

Constructors

class WateringUnit(port: tuple) None

Initialize the Fader.

参数:

port – The port to which the Fader is connected. port[0]: adc pin, port[1]: pump pin.

UIFLOW2:

init.svg

Methods

WateringUnit.get_voltage() float

Get the voltage of the sensor.

返回:

The voltage of the sensor.

UIFLOW2:

get_voltage.svg

WateringUnit.get_raw() int

Read the raw value of the ADC.

返回:

The raw value of the ADC.

UIFLOW2:

get_raw.svg

WateringUnit.on() None

Turn on the pump.

UIFLOW2:

on.svg

WateringUnit.off() None

Turn off the pump.

UIFLOW2:

off.svg

WateringUnit.set_pump(state: int) None

Set the state of the pump.

参数:

state (int) – The state of the pump.

UIFLOW2:

set_pump.svg