Soil Moisture Level Automation
Adventures in plant care automation
The long-term goal of this system is to create a fully contained automated plant pod that can take care of a plant or a group of plants at a time. The MVP goal is simply to indicate to a plant-care-taker that the soil moisture content is too low. The short-term goal is to have it automatically water itself from a vat. The plant can essentially ask for water.
Outlining the Goal
Accurately detect soil moisture levels: This means interpreting sensor output from a specific Analog sensor I’ve soured and set read intervals.
Transform raw values from monitoring sensors into values that make sense to carry out logical decisions on them
Create a variable ‘moisture level monitoring’ function or class that will have some internally held parameters and create moisture level statuses based on the most recently measured value.
Measure the water level in a reservoir with a sensor, and translate its output into meaningful values
using soil moisture level plus reservoir level values, control a pump output
create 2 different ways to handle pump output:
periodic pump & measure until target moisture level is hit
run pump for x time or until reservoir level is too low
This Is No Simple Task
If I were using some libraries that had sensor handling and various other items it would be really simple. But since everything will be from scratch, this will be its own little module. It will require a lot of design and testing efforts, but in the end, it will be part of my own greenhouse control library to speed up the roll-out of similar features over time.
Breaking it down into smaller chunks
My plan is to start with Step One. I need to start working with my soil sensors and be sure that I am accurately measuring before I move any further. I don’t want to risk incorrectly reading the sensor and not providing the right amount of water to any plant that is under PicoPonic care.
Task Chunk List
Verify sensor measurements and signal tuning
abstract sensor measurements into real meaningful values to the system that I can more easily make decisions with.
Create interval to check the sensor values
the interval should trigger a read from inputs, that then triggers the abstraction into system state.
A separate standard ‘system tick’ should evaluate state on some interval and decide to make updates based on the actively held state
The system state ‘tick’ should be at least 2-5x slower than the sensor read tick
create dummy water level monitoring that always provides ‘adequate water level’ status
create logic that combines water level state with moisture state to create a ‘pump safe to run signal’
create a pump control function that runs the pump on intervals to give time for the soil to saturate without flooding the pot
map the pump control output onto the system state
system tick should trigger and that system state should then map onto the outputs
Conclusion
Looks like this might end up taking a while. If I completed one task per day, that’d be 11 days. I doubt I’ll move that fast as I have other things going on in life right now.