SlothPlant:用本地 AI 照料容易被忘記的仙人掌
I kept forgetting about my cactus…
作者製作 SlothPlant,利用 Arduino UNO R4 WiFi 監測仙人掌的土壤濕度,只有植物需要照料時才向手機發送訊息。Flask 伺服器透過 Ollama 在筆電本地執行 gemma3:1b,由簡單規則處理明確情況,模型判斷較難處理的情況並撰寫訊息。數據不會離開筆電,專案採用 MIT 授權。
Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 🦥
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
SlothPlant is a plant caretaker for people who forget their plants. An Arduino UNO R4 WiFi watches the soil moisture of my cactus, and a small open-weight model running on my laptop reads the readings and writes a sleepy two-line message to my phone, but only when the plant actually needs me.
It saves me the chore of remembering to check on the plant. I never look at it; it quietly checks itself and speaks up when it matters. A cactus is also the ultimate sloth plant, since it barely needs anything.
Demo
Here's SlothPlant watching my cactus, with the soil sensor in the pot and wired to the Arduino's A0 pin:
And here's the notification that arrived on my phone when the soil read dry:
Code
SlothPlant 🦥🌱
A plant caretaker for people who forget their plants. An Arduino watches the soil all day, a small open-weight model running locally reads the readings, and your phone gets a sleepy two-line message only when the plant actually needs you.
Built for the Hacktoberfest Open-Source AI Challenge (Week 3: Sloth Day). It grew out of a class assignment on Arduino, and the open-source AI part was built this week.
How it works
Soil sensor -> Arduino UNO R4 WiFi -> Flask server (laptop) -> Ollama (gemma3:1b) -> ntfy -> your phone
- The Arduino reads the soil moisture sensor every few seconds and sends the value over WiFi.
- A small Flask server saves each reading to
readings.csv. - On a schedule, the server looks at recent readings and works out the trend.
- A local open-weight model (
gemma3:1bthrough Ollama) writes the plant's message and judges borderline cases. - The…
MIT licensed, with setup steps in the README.
How I Built It
The pipeline: soil sensor → Arduino UNO R4 WiFi → Flask server on my laptop → Ollama running gemma3:1b → ntfy → my phone.
-
Open-source AI:
gemma3:1b, an open-weight model, runs locally through Ollama. It writes every plant message in a sleepy, sloth-like voice and judges borderline cases from the recent trend. It runs fine on my 8 GB laptop. - Rules plus model: My first version let the model make every decision, and it confidently said "QUIET" while the soil was clearly dry. Small models turned out to be better at voice than at yes/no decisions. Now simple rules handle the obvious cases (clearly dry, clearly fine), and the model handles the in-between zone and writes the messages.
-
Along the way: Public campus WiFi blocked the Arduino from reaching my laptop, so I switched to a phone hotspot. I also hit a broken
pippath on Windows and got around it by callingpython -m pip. - Where it came from: This started as a class assignment where the Arduino just beeped when the soil was dry. The WiFi, server, and open-source AI parts were built this week in a new repo.
Why Does Open Innovation Matter?
Because the model runs on my own laptop, my data never leaves it. There are no API keys, no usage fees, and nothing that stops working if a service changes its pricing. A project like this is tiny, a $30 board and a free model sending a few messages a day, and a closed API would turn it into a recurring cost for almost no work. Open weights also let me pick a model small enough for a student laptop and swap it later without rewriting anything.
The Lazy Payoff
During testing, my first "thirsty" notification arrived without me checking on anything, which was the whole point. I'm still tuning it: my thresholds are placeholders from class testing, and a cactus likes dry soil, so it can ask for water more than it should. Next steps are per-plant tuning, or telling the model the plant is a cactus so it asks far less often.
來源:DEV Community · dev.to

