Coder Social home page Coder Social logo

denizyunus / smart-flower-pot-controller Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 11 KB

Smart Flower Pot Controller is a Micropython-powered system for managing and monitoring soil moisture, temperature, and light in planters or pots. The project features a user-friendly API and can send notifications or adjust LED colors based on environmental conditions, enhancing the plant's well-being.

Python 100.00%
ble flower-pot iot sensor smart-gardening soil-moisture temperature-monitoring automation gardening light-sensor plant-care smart-home technology arduino esp32

smart-flower-pot-controller's Introduction

Introduction

This system was developed for a startup working on smart flower pots. It offers an all-in-one solution to monitor and manage various environmental parameters such as light, temperature, and soil moisture in real time. The focus is on creating an interactive and intelligent system for flower pots that can send notifications, control LEDs, adjust Water Pump states, provide visual feedback on an OLED screen, and much more, based on sensor readings and user preferences.

Table of Contents

  1. Introduction
  2. Features
  3. Prerequisites
  4. Installation
  5. Usage
  6. API Description

Features

  • Sensor Management: Handles readings from LDR, temperature, and soil moisture sensors.
  • Bluetooth Communication: Sends commands and receives sensor data via BLE.
  • Water Pump and LED Control: Dynamically controls Water Pump states and RGB LEDs.
  • Visual Feedback: Displays happy/sad faces on an OLED screen based on conditions.
  • Threaded Execution: Runs multiple concurrent threads for seamless operation.
  • Exception Handling: Robust error handling for ease of debugging.
  • Flexible API: Provides an API for interaction, including calibration and custom actions.

Prerequisites

  • MicroPython-compatible microcontroller
  • Supported sensors (LDR, temperature, soil moisture)
  • OLED display
  • RGB LED, Water Pump motor
  • BLE support

Installation

Below is the list of modules used in this project and their corresponding pin connections:

  • Light Dependent Resistor (LDR): Pin 34
  • Temperature Sensor (DHT22): Pin 18
  • Soil Moisture Sensor: Pin 32
  • OLED Display: Pin 22, Pin 21
  • RGB LED: Pin 5, Pin 17, Pin 16
  • Water Pump: Pin 4

Usage

  1. Connect the Modules: Connect all the modules to their corresponding pins as described in the Modules and Pins section. Ensure proper connections and consult the hardware documentation if needed.
  2. Place Sensors in Soil: Place the temperature and soil moisture sensors into the soil in the planter or pot.
  3. Upload the Code: Transfer the MicroPython code to your microcontroller.
  4. Run the Code: Execute the code on the microcontroller.
  5. BLE Mobile App: Use a mobile app to send functions over Bluetooth (as there are many applications on mobile app stores.)
  6. Water Pump Caution: Do not connect the water pump until the system is fully ready and calibrated to avoid any unexpected behavior.
  7. Enjoy Your Smart Flower Pot: Monitor and manage your smart flower pot through the app and watch as it takes care of your plants.

API Description

The system accepts various JSON commands to control and monitor the smart flower pots. Below is a detailed explanation of each command:

Calibration Command ("c")

  • JSON: {"command":"c"}
  • Description: This command is used to start the calibration mode for the sensors. Calibration ensures accurate readings and optimal functioning of the smart flower pot.

Set Required Light and Moisture ("r")

  • JSON: {"command":"r", "reqLight":"80", "reqMoist":"70"}
  • Description: This command sets the required light and moisture levels to make the face on the OLED display happy. If these requirements are not met, the display will show a sad face.
    • reqLight: The required light percentage.
    • reqMoist: The required soil moisture percentage.

Value Condition Command ("v")

  • JSON Example for Light: {"command":"v", "type":"light", "min":"50", "max":"60", "action":"notification", "param":"An example notification"}
  • JSON Example for Moisture: {"command":"v", "type":"moist", "min":"50", "max":"60", "action":"led", "param":"255,255,255"}
    • Description: This command sets the software to perform specific actions (e.g., sending notifications or lighting an LED) based on the given sensor values (light, moisture, temperature).
      • type: The type of value to monitor (e.g., "light", "moist").
      • min: The minimum value of the range.
      • max: The maximum value of the range.
      • action: The task to perform when the value is within the specified range. It can be "notification" for sending a message or "led" for controlling the LED.
      • param: Parameters related to the action. For LED, it's the color, and for notifications, it's the message content.

Get Values Command ("get")

  • JSON: {"command":"get", "type":"LDR/Moist/Temp/SoilTemp"}
  • Description: This command retrieves the specified values (light, moisture, temperature) asynchronously.
    • type: The type of value to get. Can be "LDR", "Moist", "Temp", "SoilTemp".

These commands enable you to interact with and control the smart flower pot system through the recommended mobile app via Bluetooth, providing you with a seamless and user-friendly experience.

smart-flower-pot-controller's People

Contributors

denizyunus avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.