Watering Unit
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:
Micropython Example:
1import os, sys, io 2import M5 3from M5 import * 4from unit import WateringUnit 5 6 7label0 = None 8label1 = None 9label2 = None 10label3 = None 11watering_0 = None 12 13 14def setup(): 15 global label0, label1, label2, label3, watering_0 16 17 M5.begin() 18 Widgets.fillScreen(0x222222) 19 label0 = Widgets.Label("Voltage:", 50, 80, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18) 20 label1 = Widgets.Label("ADC:", 50, 140, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18) 21 label2 = Widgets.Label("label2", 150, 80, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18) 22 label3 = Widgets.Label("label3", 150, 140, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18) 23 24 watering_0 = WateringUnit((8, 9)) 25 26 27def loop(): 28 global label0, label1, label2, label3, watering_0 29 M5.update() 30 label2.setText(str(watering_0.get_voltage())) 31 label3.setText(str(watering_0.get_raw())) 32 if (watering_0.get_raw()) > 30000: 33 watering_0.on() 34 else: 35 watering_0.off() 36 37 38if __name__ == "__main__": 39 try: 40 setup() 41 while True: 42 loop() 43 except (Exception, KeyboardInterrupt) as e: 44 try: 45 from utility import print_error_msg 46 47 print_error_msg(e) 48 except ImportError: 49 print("please update to latest firmware")
UIFLOW2 Example: