For the first time, this fall I built a garden with an aim to grow some of my own food. Where I live, there is ample space on most properties to have a garden, and I hoped to ease some of the burdens of doing so by using the Thingy:53 for automation and pest control. My hope is that others can use my ideas and work on this project to help with their own gardens!
1st Idea - Determining Soil MoistureMy first idea was to build a model and use the inferencing capabilities of the Thingy:53 to predict soil moisture, based on environmental conditions, without actually monitoring the soil moisture. I like the idea of simplifying a smart watering system by removing the wires and soil sensors that others (with similar aspirations) will often place throughout their garden. However, this effort proved to be challenging.
Here are the envisioned steps:
1. Collect data to be classified as DayDry, DayWet, NightDry, NightWet
2. Build a model around this data
3. Deploy the model, use the inferencing results to average out the conditions over time, and come up with a estimate for the soil moisture
This might look something like assigning a 0-1 value for each inference type, and continuously counting and storing those values to be averaged over time.
DataCollection
I collected data over a 2 week period, in a variety of conditions
Building the Model
Here is my impulse setup and model results:
I went through a number of iterations to get to this point, trimming data, adjusting training cycles - until the model seemed to be performing the best. But... that isn't saying much. It turns out I need more model adjustment, more data, or probably both. Below is an example of inferencing results on a dry day (predicting DayWet) and) and in the same conditions but with the light guide covered (predicting DayDry).
Ultimately this is probably just a difficult problem to tackle without just measuring soil moisture directly. I think there is definitely potential here, but with the inferencing results being pretty bogus, I decided to move on to something a little simpler.
2nd Idea - Pest MonitoringOne big thing I have to worry about with the garden is animals trying to eat the vegetables. The garden has a chicken wire fence all around it that moves pretty easily when touched. You can actually pick up vibrations pretty much anywhere on the fence line since it is all connected. The idea here is to detect disturbance on the fence line and beep the buzzer, hopefully scaring away whatever is trying to et in. So I quickly recording some data representative of:
- Disturbance (shaking the fence line)
- Still (no movement)
I then built the following impulse and achieved the model results below:
Then, using the edge impulse firmware for the Thingy:53 and knaveen's code as a template for acting on the inferencing results, the buzzer sounds and the LED goes off when there is a disturbance.
All of the additions to the code fall under the display_results function:
Most of the code is from the edge-imuplse release, and the ring buffer implementation with the buzzer and LED turning on is from knaveen.
The only change I made is on the line that says
if (ix == 1 && !buzzer_on && result->classification[ix].value > 0.9) {
I changed ix==1 to ix==0, which reflects the value of ix when there is a disturbance.
After building and uploading, it was a success! Granted it is pretty simple, but it may help deter any creatures trying to have a nibble.
Comments