By Eric Musa, Botanist and Novice Home Automationist
Howdy! It’s been over a month since I’ve posted anything, but that’s moreso because writing “documentation” is hard, and less-so because I haven’t been doing anything!
I live in a second-floor apartment, but I have cultivated a lovely little garden on my outdoor balcony. I have multiple planters containing both marigolds and chili peppers, which I learned after buying the seed packets are companion plants – marigolds attract pollinators and repel certain pests, and peppers are tasty! My peppers are finally ripening (at right) which brings me such joy (though they were already good while still green).
I travel quite a bit for my job, and the summers in the south are scorchingly hot. That, along with the sad truth that my planters are miserable heat sinks, means that my peppers dry out very quickly. I have been fixated on the idea of automated watering for my crops, but the logistics of doing so on my balcony setup are quite difficult to engineer a solution for.
But! That has not stopped me, and I am using this problem as motivation for getting into embedded hardware and control systems, IoT, and home automation. At left is a Raspberry Pico driving the first real electronic system I’ve ever built (it’s a pretty LED 🤩).
I bought a couple of Picos and some breadboards recently, I brushed the dust off my old electronics kit from probably a decade ago, and I opened the soldering station I received for my birthday last year for this project. For the hardware that I already had, it feels good to get use out of things that’ve been on the shelf for a long time.
I was a little scared having never soldered anything of this size or multiplicity before, but I tested and confirmed all the soldered pins (at right) work, so quite proud of myself for this job! Soldering 40-odd pins to a tiny board did not make me want to do this en-masse, though…
After setting up my first pretty LED circuit and soldering some pins to the board so I didn’t have to hold contacts together, I set out to make this Pico a bonafide IoT sensor. Along with the Picos, I bought a set of external wifi cards. When connected to a wifi card, a Pico can act as a webserver and communicate with my local network! At left is a very simple webserver setup that, as shown, was successful!
Unfortunately, sometimes when you set out to learn stuff, you learn stuff. One thing that I learned was that you can buy Pico boardlets with a built-on wifi card. Had I known this prior, I could have avoided having to connect this mess of wires. ✨ Knowledge ✨
The final step in this saga-introduction was connecting a moisture sensor to the Pico-webserver I set up earlier. I respect the internet and much more after working with the physical hardware that it runs off of, small-scale though it may be. These wifi chips have a packet loss of like 10% which makes using them difficult when you expect consistency. That… and I spent 45 minutes finding a single “.” that was messing up my code… But after some toil, I got a sensor that can monitor soil 😎.
Shown at right is the Pico webserver providing moisture data in JSON format to my laptop running a simple webclient, the goal of this endeavor! Still far I am from true automation though. Monitoring soil moisture is one thing, but using that data to spur action, i.e., water my plants, is a whole other story, to be detailed in part 2 of this saga!