Giter Site home page Giter Site logo

opensensor / growmax Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 2.0 427 KB

Micropython routines for GrowMax automation board by opensensor.io

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
automation plant-watering plant-wateringsystem raspberry-pi-pico sensors plant-monitoring

growmax's Introduction

growmax

Micropython routines for GrowMax plant watering automation boards by OpenSensor.io

To purchase a Growmax board or four sourcing parts, visit https://opensensor.io

Growmax Board install with screen and i2c CO2 sensor

Installation

To install the growmax package on a Pico or BananaPi Pico (ESP32S3), first install the appropriate firmware for Micropython that is for your device.

Ensure that you have Thonny IDE installed; for more information visit: https://thonny.org/

Launch Thonny IDE with your device connected.

Go to Tools -> Manage Packages and search for growmax Install the latest version of growmax.

Now create a new file and save it to your device as main.py In this file invoke the main routine of growmax:

from growmax.routine import main

main() 

Next you need to create your config file.

  • Open the sample config file from the pico device, it is at /lib/growmax/config.py
  • Now save this file to the root of your pico device as config.py
  • Modify any relevant config values to suit your needs for automatic plant watering.

Configuration

  • WATER_SENSOR_LOW_ENABLED Defaults True. Checks the low water level sensor before invoking the pumps.
  • WATER_SENSOR_LOW Defaults 22. Which GPIO port has the Optomax water level sensor for low levels? Supported growmax board ports are 21 and 22
  • Much more: Complete and latest default config

Verification

Test the routine by running the created main.py in Thonny IDE. You should see output in the terminal and the program should not have any errors.

Once you have verified the pico runs the code properly, your device is now plug and play ready.
Simply supply 5V USB voltage by plugging the pico growmax board into a common USB wall wart and the pico will boot the main routine.

Power and Safety

The growmax is designed with the pico power requirements in mind. When modifying the application logic, it is important to realize:

  • Pico max current is ~300 mA; when using the onboard pump ports and mosfets: ensure the pumps you source are 5V and draw less than 200 mA.
  • Should you need to control higher powered pumps and equipment, it is recommended to pair with an I2C relay board for such use cases.
  • The pico operates at 3.3V logic levels, however the pumps and water sensor ports are powered by the 5V VSYS.
  • The water sensor ports are designed for the Optomax liquid sensor and have voltage dividers for an expected 4V -> 3.3V input back to the pico.

growmax's People

Contributors

matteius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cddx derweisskrag

growmax's Issues

memory allocation failed after some iterations when using I2C display SSD1327_I2C

%Run -c $EDITOR_CONTENT
WIFI not enabled; change your config if you want wifi capabilities enabled.
Position 1 reservoir has water True and moisture value 0/10
Position 2 reservoir has water True and moisture value 0/10
Position 3 reservoir has water True and moisture value 10.66667/10
position: 3
Dose pump on GPIO pin 4 at speed 1 for 30 seconds.
Position 4 reservoir has water True and moisture value 5.666667/10
Position 5 reservoir has water True and moisture value 20.0/10
position: 5
Dose pump on GPIO pin 6 at speed 1 for 30 seconds.
Position 6 reservoir has water True and moisture value 0/10
Position 7 reservoir has water True and moisture value 0/10
Position 8 reservoir has water True and moisture value 0/10
Completed iteration; soil_moistures = [0, 0, 10.66667, 5.666667, 20.0, 0, 0, 0]
Free mem before garbage collection: 130176
Free mem after garbage collection: 132880
WIFI not enabled; change your config if you want wifi capabilities enabled.
Position 1 reservoir has water True and moisture value 13.33333/10
position: 1
Dose pump on GPIO pin 2 at speed 1 for 30 seconds.
Position 2 reservoir has water True and moisture value 13.0/10
position: 2
Dose pump on GPIO pin 3 at speed 1 for 30 seconds.
Position 3 reservoir has water True and moisture value 13.66667/10
position: 3
Dose pump on GPIO pin 4 at speed 1 for 30 seconds.
Position 4 reservoir has water True and moisture value 5.666667/10
Position 5 reservoir has water True and moisture value 20.0/10
position: 5
Dose pump on GPIO pin 6 at speed 1 for 30 seconds.
Position 6 reservoir has water True and moisture value 0/10
memory allocation failed, allocating 8193 bytes
Position 7 reservoir has water True and moisture value 0/10
memory allocation failed, allocating 8193 bytes
Position 8 reservoir has water True and moisture value 0/10
memory allocation failed, allocating 8193 bytes
Completed iteration; soil_moistures = [13.33333, 13.0, 13.66667, 5.666667, 20.0, 0, 0, 0]
Free mem before garbage collection: 127120
Free mem after garbage collection: 127936
WIFI not enabled; change your config if you want wifi capabilities enabled.
Position 1 reservoir has water True and moisture value 12.66667/10
memory allocation failed, allocating 8193 bytes
position: 1
Dose pump on GPIO pin 2 at speed 1 for 30 seconds.
Position 2 reservoir has water True and moisture value 13.0/10
memory allocation failed, allocating 8193 bytes
position: 2
Dose pump on GPIO pin 3 at speed 1 for 30 seconds.
Position 3 reservoir has water True and moisture value 13.33333/10
memory allocation failed, allocating 8193 bytes
position: 3
Dose pump on GPIO pin 4 at speed 1 for 30 seconds.
Position 4 reservoir has water True and moisture value 5.666667/10
memory allocation failed, allocating 8193 bytes
Position 5 reservoir has water True and moisture value 19.66667/10
memory allocation failed, allocating 8193 bytes
position: 5
Dose pump on GPIO pin 6 at speed 1 for 30 seconds.
Position 6 reservoir has water True and moisture value 0/10
memory allocation failed, allocating 8193 bytes
Position 7 reservoir has water True and moisture value 0/10
memory allocation failed, allocating 8193 bytes
Position 8 reservoir has water True and moisture value 0/10
memory allocation failed, allocating 8193 bytes
Completed iteration; soil_moistures = [12.66667, 13.0, 13.33333, 5.666667, 19.66667, 0, 0, 0]
Free mem before garbage collection: 122784
Free mem after garbage collection: 123216
WIFI not enabled; change your config if you want wifi capabilities enabled.
Position 1 reservoir has water True and moisture value 12.66667/10
memory allocation failed, allocating 8193 bytes
position: 1
Dose pump on GPIO pin 2 at speed 1 for 30 seconds.
Position 2 reservoir has water True and moisture value 13.0/10
memory allocation failed, allocating 8193 bytes
position: 2
Dose pump on GPIO pin 3 at speed 1 for 30 seconds.
Position 3 reservoir has water True and moisture value 13.33333/10
memory allocation failed, allocating 8193 bytes
position: 3
Dose pump on GPIO pin 4 at speed 1 for 30 seconds.
Position 4 reservoir has water True and moisture value 5.666667/10
memory allocation failed, allocating 8193 bytes
Position 5 reservoir has water True and moisture value 20.0/10
memory allocation failed, allocating 8193 bytes
position: 5
Dose pump on GPIO pin 6 at speed 1 for 30 seconds.
Position 6 reservoir has water True and moisture value 0/10
memory allocation failed, allocating 8193 bytes
Position 7 reservoir has water True and moisture value 0/10
memory allocation failed, allocating 8193 bytes
Position 8 reservoir has water True and moisture value 0/10
memory allocation failed, allocating 8193 bytes
Completed iteration; soil_moistures = [12.66667, 13.0, 13.33333, 5.666667, 20.0, 0, 0, 0]
Free mem before garbage collection: 117696
Free mem after garbage collection: 118416
WIFI not enabled; change your config if you want wifi capabilities enabled.
Position 1 reservoir has water True and moisture value 12.66667/10
memory allocation failed, allocating 8193 bytes
position: 1
Dose pump on GPIO pin 2 at speed 1 for 30 seconds.

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.