Inspiration
My family grows olives in Sidi Bou Zid, in central Tunisia, and water is always tight in the summer. I looked into smart irrigation systems and almost all of them need internet and a cloud server to work. That doesn't fit a farm like ours, and it probably doesn't fit most small farms in dry regions. So I wanted to try the opposite: a system that runs with no internet and no central server.
What it does
Saqi decides how to split a limited amount of water between the different parts of a farm. Each zone has a cheap device with a soil sensor and a short-range radio, and the devices only talk to their direct neighbors. From those local exchanges they figure out which zones are the most dry and send the water there, with no central computer. It still works if some of the radio links go down.
How I built it
I didn't have hardware, so I wrote a simulation in Python (NumPy and Matplotlib). It models a grid of zones that lose water each day, with occasional rain, and a daily water budget that is smaller than what the farm actually needs. I implemented three methods: a timer that splits the water equally, a central controller that can see the whole farm, and Saqi.
For Saqi, the devices use average consensus (a gossip method): each device repeatedly averages a value with its neighbors until they all settle on the same number, with no central node. I used Metropolis weights so it converges to the correct average:
$$ x_i \leftarrow \sum_{j \in N(i)} w_{ij}\, x_j $$
Then I ran the simulation over many random seasons and compared how many zones each method kept alive.
Challenges I ran into
Most of the time went into fixing versions that were wrong.
- My first version had the wrong goal. It gave a little water to everyone instead of saving the zones about to die, so it actually killed more zones than the simple timer.
- My central controller was spending more water than the budget allowed, which made it look better than it should. After I made it stick to the budget, the comparison was fair.
- The gossip part didn't converge at first. I fixed it by using Metropolis weights and computing the averaging with matrices.
What I learned
- A decentralized system can do about as well as a central one when everything is connected, and clearly better when the network breaks.
- When the network is bad, bigger farms split into more disconnected pieces, so the central system gets worse as the farm gets larger.
What's next
I want to build a few real nodes with cheap sensors and solar power and test them on our farm for a season. The same approach could work for other shared, limited resources, like small water or power systems in places without reliable infrastructure.
Log in or sign up for Devpost to join the conversation.