ESCLABS
Published © CC BY-SA

PlantMote: Let Your Plant Show How It Feels

Thisplant pot shows the soil water percentage as emojis

BeginnerWork in progress4 hours260

Things used in this project

Hardware components

M5stack AtomS3
×1
Battery, 3.7 V
Battery, 3.7 V
×1
Gravity: Analog Soil Moisture Sensor For Arduino
DFRobot Gravity: Analog Soil Moisture Sensor For Arduino
×1
USB Li Ion Battery Charger
Adafruit USB Li Ion Battery Charger
×1
Male Header 40 Position 1 Row (0.1")
Male Header 40 Position 1 Row (0.1")
×1

Software apps and online services

M5Stack UIFlow 2.0
Tinkercad
Autodesk Tinkercad

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Story

Read more

Custom parts and enclosures

3d printing files

Sketchfab still processing.

top

Sketchfab still processing.

Schematics

circuit digram

Code

python code

Python
import os, sys, io
import M5
from M5 import *
from hardware import ADC
from hardware import Pin
import time



angry = None
cold = None
happy = None
adc8 = None


moisture = None


def setup():
  global angry, cold, happy, adc8, moisture

  M5.begin()
  Widgets.fillScreen(0xff0000)
  angry = Widgets.Image("/flash/res/img/angry.jpg", 0, -1, scale_x=1, scale_y=1)
  cold = Widgets.Image("/flash/res/img/cold.jpg", 0, 0, scale_x=1, scale_y=1)
  happy = Widgets.Image("/flash/res/img/happy.jpg", 0, 0, scale_x=1, scale_y=1)

  adc8 = ADC(Pin(8), atten=ADC.ATTN_11DB)


def loop():
  global angry, cold, happy, adc8, moisture
  M5.update()
  moisture = adc8.read()
  print(moisture)
  if moisture > 3500 and moisture < 4000:
    happy.setCursor(x=0, y=0)
    happy.setImage("/flash/res/img/happy.jpg")
    happy.setVisible(True)
    time.sleep(1)
  if moisture <= 2000:
    cold.setCursor(x=0, y=0)
    cold.setImage("/flash/res/img/cold.jpg")
    cold.setVisible(True)
    time.sleep(1)
  if moisture >= 4000:
    angry.setCursor(x=0, y=0)
    angry.setImage("/flash/res/img/angry.jpg")
    angry.setVisible(True)
    time.sleep(1)


if __name__ == '__main__':
  try:
    setup()
    while True:
      loop()
  except (Exception, KeyboardInterrupt) as e:
    try:
      from utility import print_error_msg
      print_error_msg(e)
    except ImportError:
      print("please update to latest firmware")

Credits

ESCLABS
1 project • 0 followers

Comments