Maker.io main logo

M5Stack Smart Plant Watering

2021-10-19 | By M5Stack

License: General Public License Environmental Arduino

* Thanks for the source code and project information provided by @Kernel Control

 

Features
  • Collects soil moisture, air humidity, temperature and pressure
  • Button push (A) for watering
  • Reuses configured Wifi connection
  • Publishes Home Assistant state
  • Support Home Assistant auto-discovery
  • Reconnect to Wifi with a button (B)
  • Send manual MQTT configuration and state with a button (C)
  • Signal lack of water with RGB bar (on M5Stack Fire) and warning image

 

Installation

 

Hardware

  • Plug the ENV unit in Port A
  • Plug the Watering unit in port B
  • Plant the Watering unit in the soil
  • Connect the internal pipe of the watering unit to a water source
  • Put the external pipe of the watering unit in the soil
  • Boot the M5Stack in Wifi mode

Software

1 
 
 
 

In the readSensors function, update the from low and from high values according to your Watering unit calibration.

  • Update the MQTT configuration in the code to suit your own MQTT server.
  • Still in UI Flow, use the Manager to upload the code and images to the device.

Note: Swap Unit Env II with Unit Env III in UI Flow if needed as the former has reached its end of life 

 

Usage
  • When started, the application connects to the existing Wifi, initiates the MQTT client configuration and publishes the Home Assistant discovery message.
  • Every 30 seconds, it reads the sensors values, updates the displayed values and publishes the state messages for Home Assistant on MQTT.
  • Press button A to start watering. Release the button to stop.
  • Press button B to re-initiate the Wifi connection sequence (will be triggered only when disconnected).
  • Press button C to manually publish the Home Assistant configuration and sensors state to MQTT.

 

TODO
  • Icons for button actions
  • Watering via MQTT
  • Show battery and Wifi status

 

Code

https://github.com/kernelcontrol/m5stack-smart-plant-watering

Software apps and online services

https://flow.m5stack.com/

 

 

制造商零件编号 K007
M5STACK FIRE IOT DEV KIT (PSRAM)
M5Stack Technology Co., Ltd.
¥303.06
Details
制造商零件编号 U001-C
ENV III UNIT WITH TEMPERATURE HU
M5Stack Technology Co., Ltd.
¥62.03
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum