This is awesome. I have been working on a similar open source project the past few years trying to manage my many plants inside and outside. I was using a raspberry pi and multiple arduinos to make a garden automation. I dont have the tweets live yet but this would be great to share a plant twitter feed from the garden. Would like to share timelapse of previous days growth each day.
The project is https://mudpi.app and may be useful if you decide to expand your setup.
This is cool. Does anyone know any very low-power wireless sensors that I could put in, say, 10 plants and have them all talk to a single receiver (rather than having 1 RPi / plant)? Ideally the sensors would have mini solar panels (since plants would be in the sun anyway).
RPi's are very nice, but for a project like this, I'd reach for an ESP32 or the like - they are cheap, have analog input, and WiFi built in, some with integrated OLED displays, and are Arduino compatible. Also scriptable with Python or Lua.. So, similar to what the author did, but skipping the RPi for communications.
You can get them down to very low power by having them go into deep sleep and only wake up every minute or ten to take a reading, hop on the network, and publish the value somewhere, like an MQTT broker, or send a text etc.
If one can get a digital rather than analog sensor for a few dollars more, then chaining a ton of them up to a bus like i2c should make for a simple many-sensor-one-microcontroller setup: https://www.adafruit.com/product/4026
> You can get them down to very low power by having them go into deep sleep and only wake up every minute or ten to take a reading, hop on the network, and publish the value somewhere,
Doing this also greatly prolongs the life of the cheap resistive sensors that sarabee dismisses. If there's current through them for only a millionth of the time, then their life is extended by a million (not quite, but there is a large factor there).
If you wanted to get fancy you could drive the sensors with an AC signal (sine wave, say) through a DC-blocking capacitor, and use a precision rectifier (an op amp, two diodes and a capacitor pretty much) to measure the voltage. AC drive would reduce corrosion further.
> If one can get a digital rather than analog sensor for a few dollars more,
With a BCD to ten-output chip on the Arduino (e.g. 74HC42, < $1) you could have up to 10 of the cheap resistive sensors per Arduino. Each of the 10 outputs of the '42 is used as the power source for one resistive sensor.
Of course you'd need wires everywhere for this (simple "bell wire" would do if it's out of the sun). I like wires--I find them much more reliable than Wi-Fi or low power digital radio, not to mention having lower power requirements--but they seem to be out of fashion these days.
With chained counter chips you could have hundreds of sensors. But then your Arduino wouldn't get any sleep, and might need cloning to share the workload. And your wiring tag system had better be reliable! :)
There are ethernet modules available for the Arduino, but yes, an ESP32 would probably be easier.
I've been looking into this myself a bit, and it's worth mentioning that the ESP32 can do 8 channels worth of analog input (and that's only on the first ADC, there's a second you can use if you disable WiFi, and that's something you'll likely be doing to conserve power anyway). You can get pretty far on analog-only, you might be able to save yourself from doing bussed sensors if you have a bunch of plants all together.
Thanks, this is interesting. Seems like it would be quite cheap to cobble together an ESP32 + cheap sensor. How would you power it - battery or solar? Any estimates of battery runtimes I could get if it woke up every 4 hours or so?
I have a couple Govee temp/humidity sensors which send out the data as a bluetooth low energy advertising packet -- which anyone can read -- and from what I can tell two AAA batteries should last a year or two. They send out the advertising packet around every 10 seconds so 'low energy' is an accurate naming it seems.
Mostly got them to learn about bluetooth and wrote (half a) daemon to log the packets, currently it just prints the data to cout.
If you water your plants by hand, swapping a battery isn't too big a deal. Solar might work if your plant is consistently in direct sunlight, but you need to keep some amount of charge to keep at least the RTC running so that's a hurdle you'll have to ponder.
I don't have any estimates of battery runtime or anything, but I'll note that WiFi is battery-expensive and takes a few seconds to actually connect to the desired network so you'll want to wake WiFi as little as possible. Meanwhile, actually doing sensor readings can be done pretty often. So it's entirely feasible that you might do a bunch of sensor readings and then upload them all in one go to save power. From there on out it's a question of how much power a sensor draws, how much power the device draws, and how often you want to wake it.
I have been messing around with this a lot. With a pretty bare esp32 no leds and taking a soil reading every 5 mins (and sent via wifi) I have got 1-2 weeks runtime on a 1000mah battery. Reducing wifi and read intervals greatly increases life. You then add in recharging and get much longer runtimes.
Ive gotten away with as small as a 6v solar panel 3.5W to keep a box online for 6 months solid.
I use radio (nrf24l01) instead of wifi for talking between the arduinos and the centralized rpi, to save power and for convenience. I also use the standard atmega328 microcontroller chip. Atmega runs on a coin cell for well over 8 months.
I like this, but it could be taken further. Why not equip the plant with the means to seek its own beverage, as this artist has done by adding a motorized base to the plant?
Here's a site that did something similar, starting in 2006 with a kit where you could call the plant to get info about it[1]. Back when ThinkGeek was a thing, I remember them selling kits to send out tweets about plant water levels.
The project is https://mudpi.app and may be useful if you decide to expand your setup.