Cyberpunk your Aloe-vera

Well, maybe not quite Aloe-RoboCop-Vera:


But, it certainly has now moved into the 21st century.

A short while ago (End of Nov 2022), so maybe 4 weeks ago? I was very proud of myself for determining that I shall get a little LCD screen (round) and I shall connect it up to a Raspberry Pi PICO and to some soil moisture sensors....

I posted about having "fun" getting the LCd screen to work with the PICO and that it was only a matter of formality to get it hooked up and measuring the soil etc..etc...

I made a statement at the end of that article post that I will see this through and it will not go by the way-side, like so many other projects have in the past.

Now, after many distractions (and mainly a postal strike or two in the middle), I can admit, I have now done it - albeit with a slight cheat.... but this cheat has / will allow me to do even more!

MUWAHAHAHAAAAA!


I stripped down one of the capacitive moisture sensors and tried to figure out how it worked:

https://shop.pimoroni.com/products/grow-moisture-sensor-pack-of-3?variant=32271401123923

Well... I was getting readings / values - but I had nothing to compare / baseline it with... hmmm... and the values seemed a little random, the only mentioned it uses Pulse-Frequency Modulation.

At the time, I didn't have any other source-material to review.

So, I did what any body else would....and what I was resisting doing previously... I spent £33 and bought the Grow kit:


I then had to wait about 3 weeks for it to arrive in the post.... of which it eventually did!  I do find it a little odd that the I2C pins are wonky, maybe that's my OCD?  It must have been done for some reason or other? anyway... so it arrived.... my Aloe-Vera has been gasping for a drink for weeks now - yes, I thought what better way than to let it dry out a bit, so I can get a "dry" reading.

Anyway, turns out that this little bad-boy uses a ton of Pins, about 19 in total.  yikes!  I suppose it does really, thinking about it, 4 buttons, LCD screen, 3 PFM sensors and 3 motor-pump thingies, along with a light sensor too... yeah, that might require more than a PICO.


I did however have a really old (2017/18-ish) RPi Zero W still connected to a really old 2-wheeled robot thing.. so that got ripped out/off... stripped, new OS installed and then I noticed the Grow Hat now has a one-line installer.....and a tutorial... interesting....interesting....


I did "the thing" and let it run through the installer... then I took apart the installer and looked at what it was doing, where it was going, what it was fetching and from where - they've spent some serious time on this installer, it's pretty awesome!

long and short is, I found the gold:


This piece of library code does the conversion for the PFM values

https://github.com/pimoroni/grow-python/blob/master/library/grow/moisture.py

I would never have guessed that 50 was wet and 900 was dry (extreme end values).

Then I found this tutorial:

https://learn.pimoroni.com/article/assembling-grow#how-the-moisture-sensors-work


What does all that mean?

Well... it means I got it up and running... and it was beeping the hell out of itself telling me it needed watering!

I'll upload the video (of course badly shot, as usual) of me watering it whilst it was beeping... it stopped beeping about 5 mins after the video, so it does work.

What is quite swish is that the light sensor on the board detects if it is light or dark (wow, genius!) and uses that to determine if/when to make the buzzing noise (as it really is annoying!) - that's really smart, you don't want your plant buzzing the alarm at 2am - although I could wire it up to say "FEED ME"


Drum roll please... and here is the proof it is working and that I did eventually get around to "finishing the project", maybe the scope crept a little sideways? but it did get there in the end:








It is a shame the phone does not take decent images of the LCD screens - they are really bright and colourful and are very nice!

Anyway....


What now? well... now that I can figure out how to use the sensors - I have 5 more - I can strip the wiring back, extend the cables (they are only 35cm) and then look at placing them outside in the garden raised plant beds where I'll be growing our own vegetables / salad stuff next year (2023)... and that's what this exercise was really about.  Being able to monitor the soil outside...and then use the ESP8266-01 WiFi devices to then trigger the watering / sprinkler system etc..etc...etc...

ah, it all starts to make sense now.

Well, as the A-Team would say... actually I've forgotten the exact quote, was it "I love it when a plan comes together?"... yep, sure do... even if I had to pay £33+P&P in order to boost me along.


Right, now back to doing some more fun "homework":


Oh, is that the time?.... hmmm... maybe it's best to wait a few more hours for the sun to come up :-)


Comments