Robotice



THE NEXT-GEN MONITORING AND REACTING PLATFORM

Inteligent grow control application



Michael Kutý, Jakub Josef

What is Robotice ?

Robotice software controls large pools of single-board computers, sensors, and other devices throughout a locations, managed through a dashboard or via the Robotice API.

GENERAL

  • Planning, Monitoring, Reasoning, Reacting
  • Multiplatform - x86 / x64 / armv*
  • Support for more than 10 platforms
  • Distributed but autonomous
  • Web UI, Android, API, CLI
  • 100% open source

Supported metrics and devices

  • Temperature / Humidity - DHT, TMP36, Hygro Soil
  • Luminosity / Lux / Light - TSL, CDS
  • Turn on / off - relay, Sispm, ..
  • Liquid Flow, Current Sensor
  • NDVI - Normalized difference vegetation index

Use Case: Grow control

Goal: to create automated solution to support plant growth

  • Normalized Difference Vegetation Index (NDVI camera)
  • Air / Soil Humidity sensor
  • Watering and fertilization control
  • Lighting control

NDVI

The Normalized Difference Vegetation Index (NDVI) is a simple graphical indicator that can be used to analyze remote sensing measurements.

Near InfraRed light (from 0.7 to 1.1 µm)
Visible light (from 0.4 to 0.7 µm)

Flower

NDVI Flower

NDVI Image Data Processing
  • 1) Flower detection by whitebased edge detection
Camera image data processing
  • 1) Flower detection by whitebased edge detection
  • 2) NDVI filters
Camera image data processing
  • 1) Flower detection by whitebased edge detection
  • 2) NDVI filters
  • 3) Fuzzyfication

Heatlh flower

NDVI = 0.81

Withered flower

NDVI = 0.37

Implementation

  • Change workflow in the compare_data (Planner, Reasoner)
  • FCL - Fuzzy Control Language (load, use)

Architecture

Flower Index

VAR_INPUT
    ndvi:             REAL;
    air_humidity:     REAL;
    soil_humidity:    REAL;
    temperature:      REAL;
END_VAR

VAR_OUTPUT
    flower_index:     REAL; (* RANGE(0 .. 100) *)
END_VAR

FUZZIFY ndvi
    TERM Poor := (-0.1, 1) ;
    TERM Excellent := (0.4, 1) (1, 0) ;
END_FUZZIFY

DEFUZZIFY flower_index
    TERM Excellent := 100 ;
    ...
END_DEFUZZIFY

RULEBLOCK flower_index
    RULE 0: IF (ndvi IS Excellent) AND (temperature IS Excellent) AND (soil_humidity IS Excellent) THEN (flower_index IS Excellent);
END_RULEBLOCK
                    

Python code


import fuzzy.storage.fcl.Reader

system = fuzzy.storage.fcl.Reader.Reader().load_from_file("./flower-index.fcl")

input = {
    "ndvi": 0.5,
    "temperature": 25,
    "air_humidity": 50,
    "soil_humidity": 50
}
output = {
    "flower_index": 0
}

system.calculate(input, output)

print output["action"]
                    

Basic Action

VAR_INPUT
    air_humidity:     REAL; (* RANGE(0 .. 100) *)
    temperature:      REAL; (* RANGE(0 .. 100) *)
END_VAR

VAR_OUTPUT
    action:    REAL; (* RANGE(0 .. 1) *)
END_VAR

plan - NOW - Yaml

    growing_cycle:
      start: 6:00:00
      end: 24:00:00

    ....

    basic_growing_plan:
      cycles:
      - start: ${growing_cycle:start}
        end: ${growing_cycle:end}
        value: 1

plan - FUTURE

    basic_growing_plan:
      cycles:
      - start: ${growing_cycle:start}
        end: ${growing_cycle:end}
        fuzzy: light-action

FAN Action - example

    basic_growing_plan:
      cycles:
      - start: ${growing_cycle:start}
        end: ${growing_cycle:end}
        low: 20
        high: 30
       ...
        fuzzy: fan-action

Links

  • Main - robotice.org
  • GitHub - github.com/robotice
  • Documentation - docs.robotice.org