Perfect for beginners who want to automate watering for one plant. This example demonstrates the basic functionality of GrowMax with minimal complexity.
- GrowMax board from opensensor.io
- Raspberry Pi Pico (or Pico W)
- 1x small water pump (5V, <200mA)
- 1x Optomax water level sensor (recommended)
- Water reservoir (bottle or container)
- Tubing for water connections
- Micro USB cable and 5V power supply
This setup works well for:
- Houseplants: Pothos, snake plants, rubber plants
- Herbs: Basil, mint, parsley
- Small vegetables: Cherry tomatoes, peppers
- Flowering plants: African violets, begonias
Create this config.py file on your device:
import machine
# Hardware Configuration
GROWMAX_MCU = "RP2040"
# Soil Moisture & Watering - Using only position 1
SOIL_WET_THRESHOLD = 12 # Start conservative (drier)
PUMP_WHEN_DRY = False # Safety: only pump when water detected
PUMP_CYCLE_DURATION = 20 # 20 seconds - adjust based on plant size
# Water Level Safety
WATER_SENSOR_LOW_ENABLED = True
WATER_SENSOR_LOW = 22 # GPIO pin for water sensor
# Disable unused features for simplicity
RELAY_BOARD_ENABLED = False
ADAFRUIT_SCD4X_ENABLED = False
ATLAS_PH_METER_ENABLED = False
DISPLAY = None
# WiFi disabled for basic setup
WIFI_ENABLED = False
WIFI_SSID = ""
WIFI_PASSWORD = ""
# Cloud features disabled
OPEN_SENSOR_COLLECT_DATA = False
OPEN_SENSOR_API_KEY = None
DEVICE_NAME = "Single-Plant-Setup"
OPEN_SENSOR_RETRIEVE_COMMANDS = False- Mount your GrowMax board with the Pico attached
- Connect the water pump to pump port 1 on the GrowMax board
- Install moisture sensor in position 1 (insert 2-3 inches into soil)
- Connect water level sensor to GPIO 22 (place in reservoir)
- Set up tubing from pump to plant, ensuring good water flow
- Install MicroPython firmware on your Pico
- Install GrowMax library via Thonny IDE
- Copy the configuration above to
config.pyon your device - Create main.py:
from growmax.routine import main main()
- Run the program in Thonny IDE
- Check the output - you should see something like:
Position 1 reservoir has water True and moisture value 15/12 Position 2 reservoir has water True and moisture value 0/12 Position 3 reservoir has water True and moisture value 0/12 ... - Verify readings:
- Position 1 should show actual moisture readings
- Positions 2-8 will show 0 (no sensors connected)
- Water sensor should show
Truewhen reservoir has water
The SOIL_WET_THRESHOLD determines when your plant gets watered:
# For plants that like it moist (ferns, peace lilies)
SOIL_WET_THRESHOLD = 8
# For average houseplants (pothos, rubber plants)
SOIL_WET_THRESHOLD = 12
# For plants that prefer drier soil (snake plants, succulents)
SOIL_WET_THRESHOLD = 18Testing Tips:
- Start with a higher number (drier) and adjust down if needed
- Water your plant manually, then check the moisture reading
- The reading when soil is "just right" is your target threshold
The PUMP_CYCLE_DURATION controls how long the pump runs:
# Small plants or seedlings
PUMP_CYCLE_DURATION = 10
# Medium houseplants
PUMP_CYCLE_DURATION = 20
# Large plants or dry soil
PUMP_CYCLE_DURATION = 30Safety Notes:
- Always start with shorter durations
- Monitor the first few watering cycles
- Adjust based on how much water your plant actually needs
When your system runs, you'll see output like this:
Position 1 reservoir has water True and moisture value 15/12
Position 1
Completed iteration; soil_moisture's = [15, 0, 0, 0, 0, 0, 0, 0]
Free mem before garbage collection: 89456
Free mem after garbage collection: 91232
What this means:
- Position 1: Your plant's sensor position
- reservoir has water True: Water level sensor detects water
- moisture value 15/12: Current reading (15) vs threshold (12)
- Position 1 (on its own line): Pump activated because 15 > 12
- soil_moisture's = [15, 0, 0, ...]: Array of all 8 sensor readings
This configuration includes important safety features:
WATER_SENSOR_LOW_ENABLED = True # Always keep this True
PUMP_WHEN_DRY = False # Never pump when reservoir is emptyPUMP_CYCLE_DURATION = 20 # Start short, increase if needed- Check moisture threshold - may be too low (try increasing the number)
- Verify water in reservoir - ensure water level sensor detects water
- Check pump connections - ensure pump is connected to port 1
- Test pump manually:
from growmax.pump import Pump pump = Pump(channel=1) pump.dose(1, 5) # Run for 5 seconds
- Reduce pump duration - try 10-15 seconds
- Increase moisture threshold - higher numbers = drier soil before watering
- Check sensor placement - ensure it's in the root zone, not too deep
- Check sensor connections - ensure sensor is properly seated
- Verify sensor placement - insert 2-3 inches into soil
- Clean sensor probes - remove any buildup or corrosion
Your setup is working correctly when:
- ✅ Moisture readings change as soil dries out
- ✅ Pump activates when soil reaches threshold
- ✅ Plant receives appropriate amount of water
- ✅ Water level sensor prevents dry pumping
- ✅ System runs continuously without errors
Once your single plant setup is working well, consider:
WIFI_ENABLED = True
WIFI_SSID = "YourNetwork"
WIFI_PASSWORD = "YourPassword"OPEN_SENSOR_COLLECT_DATA = True
OPEN_SENSOR_API_KEY = "your-api-key" # From opensensor.ioSee our Multi-Plant Garden example.
Check out the Greenhouse Monitoring example.
- Multi-Plant Garden - Scale up to 8 plants
- Smart Indoor Garden - Add WiFi and cloud features
- Apartment Herb Garden - Optimized for herbs
Congratulations! You've automated your first plant! 🌱✨
Your plant will now be watered automatically whenever the soil gets dry. Monitor it for the first few days to ensure everything is working perfectly.